Step-by-step guide
Laravel on shared hosting
Deploy and run Laravel on cPanel shared hosting, even without SSH. Each chapter solves one real problem, with copy-ready code for Laravel 11 and 12.
The guide
- 1 Can your shared hosting run Laravel? Check your shared hosting before you start: PHP version, extensions, database, SSH, cron limits and Composer. What Laravel 12 needs and what to do without SSH.
- 2 Upload Laravel to cPanel the safe way Upload Laravel to cPanel with your code outside public_html, so .env can never be downloaded. Folder layout, the index.php changes and usePublicPath explained.
- 3 Set up .env and the database Create the MySQL database in cPanel, write a production .env, set APP_KEY and run migrations, even without SSH using phpMyAdmin and migrate --pretend.
- 4 .htaccess, HTTPS and www for Laravel The .htaccess rules Laravel needs on cPanel and LiteSpeed: pretty URLs, force HTTPS, one www version, the Authorization header, and the lines you must keep.
- 5 Laravel file permissions on shared hosting The right permissions for Laravel on cPanel: 755 folders, 644 files, writable storage and bootstrap/cache. Fix "Permission denied" without ever using 777.
- 6 Run the Laravel scheduler with cPanel cron Set up Laravel's scheduler with one cPanel cron job: the full PHP path, the right PHP version, and what to do when your host doesn't allow cron every minute.
- 7 Run Laravel queues without SSH or Supervisor Run Laravel queues on shared hosting with no Supervisor or SSH: process jobs from the scheduler with queue:work --stop-when-empty, safely within host limits.
- 8 Fix storage:link on shared hosting Uploaded images giving a 404? Make the Laravel storage link work on cPanel: why storage:link goes to the wrong folder, and how to create the symlink without SSH.
- 9 Deploy updates without breaking the site A safe routine for updating Laravel on shared hosting: back up, build locally, upload a zip, run migrations and clear caches, and what you must never overwrite.
- 10 Fix common Laravel errors on shared hosting Find the cause of Laravel errors on cPanel: where the logs are, and quick fixes for 500, 403, 404, 419 and 508 errors, blank pages and PHP version problems.