# 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](/platform/deployments/builds#dockerfiles-generated-or-your-own) unless the repo has its own.

## Configuration

Everything that lives in a local `.env` moves to [environment variables](/platform/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](/deploy-with-ai/overview)? Your local `.env` is read and set on the app for you.

## Database

Provision [managed MySQL or PostgreSQL](/platform/databases) 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](/platform/databases/connect).

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

```bash
php artisan migrate --force
```

## Caches and logs

- Build caches (`config:cache`, `route:cache`, `view:cache`) can run in the [build command](/create/build-settings#build-command) - they read no secrets.
- Send logs to stderr (`LOG_CHANNEL=stderr`) so they land in [runtime logs](/platform/observability#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](/create/scaling).

## Related

- [Connect an app](/platform/databases/connect): Connection details in both shapes Laravel takes.
- [Environment variables](/platform/environment-variables): Bulk-edit the whole set as a .env file.
- [Symfony](/platform/frameworks/symfony): The other PHP framework, same container shape.
