Laravel
Deploy Laravel apps — Composer, the app key, migrations, and queues.
DockHosting detects Laravel from a composer.json that requires laravel/framework, installs dependencies with Composer, and serves your app with PHP-FPM behind a web server.
Requirements
composer.jsonat the repository root (or your configured root directory)APP_KEYset as an environment variable — Laravel throwsMissingAppKeyExceptionon every request without one. Generate one locally withphp artisan key:generate --showand paste thebase64:...value into your project's environment variables- A database, if your app uses one — see Databases
Common deploy failures
composer install --no-dev fails
The build runs composer install --no-dev --optimize-autoloader. This step fails most often because:
- A required PHP extension isn't available in the build image — check your
composer.json'srequireblock for extensions likeext-gdorext-imagickthat need to be declared, not assumed present - A private package repository (a private Packagist, a private VCS) needs credentials that aren't configured
composer.lockis out of sync withcomposer.json— regenerate it locally withcomposer updateand commit the result
MissingAppKeyException after a successful build
The build succeeded but the app throws this on first request. APP_KEY isn't set, or it's set to an empty value. Generate a real key and add it to your project's environment variables — see Requirements above.
Stale cached views or config after a redeploy
Laravel caches compiled views and config in storage/ and bootstrap/cache/. If storage/ is a persistent volume that survives redeploys, a cache built against a previous version's config can serve stale output. Clear it after a deploy that changes config or views:
php artisan view:clear && php artisan config:clear && php artisan cache:clearMigrations
Run migrations against your attached database from a one-off shell, or as a deploy step if your project is configured to run one:
php artisan migrate --force--force is required in production because Laravel otherwise prompts for confirmation, which has no terminal to answer it in an automated deploy.
Queues
A php artisan queue:work process is a long-running worker, not a request handler — see the note on long-running processes under Node.js; the same reasoning applies here. It needs to run as its own always-on project rather than sharing the web app's container.