DockHostingDocs
Stacks

Laravel

Deploy a Laravel app with its database, migrations, assets and the right production settings.

What we detect

composer.json and artisan at your app's root make it a Laravel app. We read your Laravel version from composer.json.

  • Install: composer install (without dev dependencies), and npm if you have a package.json (for Vite assets).
  • Build: npm run build when there's a frontend.
  • Serve: PHP-FPM behind nginx, on port 8080.

Settings we add

When they're missing we set APP_ENV=production, APP_DEBUG=false, SESSION_DRIVER=file, CACHE_STORE=file and QUEUE_CONNECTION=sync. Your own values always win.

Set your own APP_KEY

Without one, we generate an APP_KEY for each deploy, which logs everyone out on redeploy. Generate one locally with php artisan key:generate --show and add it in Variables.

Database

Create a MySQL, MariaDB or PostgreSQL database and link it: your app receives DB_CONNECTION, DB_HOST, DB_PORT, DB_DATABASE, DB_USERNAME and DB_PASSWORD, the names Laravel's config/database.php reads.

Your .env says sqlite?

If your .env has DB_CONNECTION=sqlite and you link a SQL database, the database replaces SQLite automatically.

Migrations

We run your migrations after every deploy, with:

php artisan migrate --force

A failing migration shows in the deploy's log.

Behind our proxy

TRUSTED_PROXIES=* and HTTPS=on are set so Laravel builds https:// URLs and reads the visitor's real IP. If you configure trusted proxies yourself, trust all of them:

bootstrap/app.php (Laravel 11)
->withMiddleware(function (Middleware $middleware) {
    $middleware->trustProxies(at: '*');
})

Queues and scheduler

QUEUE_CONNECTION=sync runs jobs immediately, inside the web request. Background workers and the scheduler need an app that's always on, so use a paid plan, because Free apps sleep.

On this page