LanguageGB
App Deployment

Deploy a Laravel app

Laravel apps run behind nginx. The platform installs Composer dependencies, builds your front-end assets, keeps your app key and SQLite database across deploys, and runs migrations on every deploy.

What this covers

A Laravel app is a PHP application built with the Laravel framework. On each deploy the platform clones your repository, runs composer install (and npm run build when there is a package.json), and builds the app's .env from your .env.example, production defaults (APP_ENV=production, APP_DEBUG=false, APP_URL set to your address) and your environment variables, which always win. It generates an APP_KEY once and keeps it across deploys unless you set your own. With the default SQLite connection the database file is kept outside the release, so your data survives redeploys. php artisan migrate --force runs before traffic moves to the new release; if a migration fails, the deploy stops and the previous release keeps serving.

Before you start

Your repository needs artisan and composer.json at its root, or in the folder you set as Subdirectory. Keep a .env.example in the repository and don't commit .env. Choose the database: SQLite works with no setup; for managed PostgreSQL set DB_CONNECTION=pgsql and DB_URL to the DATABASE_URL from your Database tab. Public and private repositories both work. For a private one, create a GitHub token with the repo scope and paste it into the GitHub token field when you deploy; leave that field empty for a public repository.

How to do it

  1. Want to see it work first? Deploy our Laravel starter from the public repository https://github.com/cirro-admin/cmcloudhosting-demo with Subdirectory laravel and Runtime laravel. Its README lists every field, and once it runs you have a working reference for your own app.
  2. Purchase an App Hosting plan or start a free trial from the Services page.
  3. Push your Laravel project to a GitHub repository with artisan at the root.
  4. Don't commit your .env file. Put settings in .env.example, without secrets, and real values in the portal's environment variables.
  5. Navigate to Portal → Services and open your App Hosting service.
  6. Set Action to Deploy Laravel app and Runtime to laravel.
  7. Paste your GitHub repository URL into the Artifact Reference field.
  8. Leave the build and start command fields empty: Composer, the asset build and the server are handled for you.
  9. Click Redeploy App. The platform runs composer install, builds assets, writes the .env, runs php artisan migrate --force and only then moves traffic to the new release.
  10. SQLite needs no setup, and its file is kept between deploys. For managed PostgreSQL, set DB_CONNECTION=pgsql and DB_URL to the DATABASE_URL from your Database tab, then redeploy: migrations run against it automatically.
  11. Visit your assigned domain to confirm the Laravel app is running.

Starter code and references

What our team checks

Support checks that the repository is accessible, artisan is present, Composer dependencies install cleanly, migrations succeed, and the app answers on its address.

Next step

Push your Laravel project with artisan at the root and composer.json present, then open the deploy form.

Contact Support