Skip to content

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. 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. 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. 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. 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. 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. 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. 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. 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. 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. 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.

Get new articles in your inbox

Practical tutorials and deep dives, about once a week. No spam, unsubscribe anytime.

Privacy policy

Add DEV Talk to your Home Screen

  1. 1 Tap the Share button in Safari's toolbar.
  2. 2 Scroll down and tap Add to Home Screen.
  3. 3 Tap Add. Open it from the Home Screen to read like an app and to turn on notifications with the bell.

We use cookies to improve your experience and analyze traffic. By continuing, you agree to our Privacy Policy.