Deploy Laravel / PHP
How nesly detects, builds and serves a Laravel / PHP project — and the two commands that put it on a live URL.
Deploy Laravel / PHP on nesly
A Laravel / PHP project is built into a container and run as a server process.
cd your-project
nesly addon add mysql
nesly addon add bucket
nesly addon add valkey
nesly deploy --yesThe first deploy creates the project and prints the live URL; after that,nesly deploy is enough.
How detection sees it
- A Laravel tree (artisan + composer.json) runs as a container via the PHP runtime.
- The first deploy mints APP_KEY and stores it on the project — the same value on every later deploy.
- With no database yet, the first deploy also sets SESSION_DRIVER=cookie (Laravel's default sqlite file is not in the image and would not survive a new pod).
- APP_URL is derived from the project's live URL (preview deployments get the preview URL); set it yourself to override.
- With the mysql addon, DB_* is derived from DATABASE_URL — a fresh skeleton stops talking to sqlite.
- With the bucket addon, FILESYSTEM_DISK is set to s3 (AWS_* already injected) so uploads are not lost on a new pod.
- With the valkey addon, SESSION_DRIVER, CACHE_STORE, and QUEUE_CONNECTION become redis (REDIS_URL already injected).
When detection is not what you want, say it yourself: build and start commands, root directory and output directory live in nesly.tomlcommitted next to the code — see builds.
Worth knowing
- Schema changes belong in nesly.toml: release = "php artisan migrate --force".
- Install league/flysystem-aws-s3-v3 when using the bucket disk.
- If you delete APP_KEY, set it again with nesly env set (or redeploy after clearing it so a new one is minted).
- QUEUE_CONNECTION=redis still needs a worker (Procfile or cron) to drain jobs — attaching Valkey alone does not run them.
- Attach a managed database with
nesly addon add postgres(ormssql) — connection env vars are injected on the next deploy. - When a deploy fails,
nesly diagnosereads the logs for you and names the fix.
Full walkthrough: get started. Custom domains, backups, GitHub deploys and the rest of the reference: nesly CLI.