Documentation menu

Deploy Laravel on Light Cloud - a PHP container on port 8080, configured through environment variables instead of a committed .env file.

Deploy Laravel

Laravel is detected from composer.json and artisan, and runs as a PHP container on port 8080. No Dockerfile needed - one is generated unless the repo has its own.

Configuration#

Everything that lives in a local .env moves to environment variables - Laravel reads them the same way, per environment:

  • APP_KEY - generate one (php artisan key:generate --show) and set it; the app won't boot without it.
  • APP_ENV=production, APP_DEBUG=false.
  • Deploying from Claude or VS Code? Your local .env is read and set on the app for you.

Database#

Provision managed MySQL or PostgreSQL and set either DATABASE_URL or the discrete DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME, DB_PASSWORD - both shapes come straight off the Credentials tab.

Migrations run where the database is reachable - from the startup command or your laptop:

php artisan migrate --force

Caches and logs#

  • Build caches (config:cache, route:cache, view:cache) can run in the build command - they read no secrets.
  • Send logs to stderr (LOG_CHANNEL=stderr) so they land in runtime logs.
  • Sessions and cache default to files, which don't survive instances coming and going - use the database or cookie drivers on an app that scales.