Skip to content
Start a project
Engineering

What to check before you launch a Laravel app on shared hosting

26 October 20262 min readKodaxStudios

Shared hosting can run a serious Laravel application if a few things are in place. This is the checklist we use before every launch.

Every product we sell has to run on ordinary cPanel hosting, because that is what many of our buyers have. That constraint taught us exactly what a Laravel application needs to run well on a shared server.

PHP version and extensions

Check the PHP version first. Our products need PHP 8.4, and most hosts let you switch versions per domain in the control panel. Then check the extensions: bcmath, ctype, curl, fileinfo, mbstring, openssl, pdo_mysql, tokenizer and xml are the usual list.

Point the domain at the public folder

The web root must be the application's public folder, never the project root. If your host does not let you change the document root, move the contents of public into it and update the paths in index.php. This keeps your .env file and source code out of reach of the browser.

One cron line does the work of a server

Shared hosting cannot run background workers, so the scheduler does the work. Add one cron entry that runs php artisan schedule:run every minute. With the database queue driver, scheduled jobs can process the queue too, which is how payouts, emails and syncs keep running.

Database and storage

Use MySQL 8.4 or MariaDB 10.11 or newer, create a dedicated database user, and keep the credentials only in .env. Make sure the storage and bootstrap/cache folders are writable by PHP.

Before you open the doors

  • Set APP_ENV=production and APP_DEBUG=false
  • Turn on HTTPS and force it
  • Send a test email from the admin panel
  • Make a backup, then make sure you can restore it

None of this needs a DevOps team. It needs a checklist, followed every time. If you would rather not do it yourself, we can install it for you.

Newsletter

Product news, delivered.

New releases, product updates and our latest articles. A few emails a year, nothing else.

By subscribing you agree to receive emails from KodaxStudios. You can unsubscribe at any time. See our privacy policy.