Deploy PHP / Laravel
Deploy a PHP or Laravel application on Out Plane, with a real web server and a managed database.
This guide deploys a Laravel application with a production web server and connects it to a managed PostgreSQL database. For the shared deploy flow, see Deploy from GitHub.
Prepare Your App
php artisan serve is for local development only. In production, run a real server bound
to 0.0.0.0 and the port you expose. There are two reliable paths.
Option A: FrankenPHP or Octane
A single process that reads the port directly. Add Octane, then start it:
sh -c "php artisan octane:start --server=frankenphp --host=0.0.0.0 --port=$PORT"Option B: Nginx with PHP-FPM
A Dockerfile based on an nginx and PHP-FPM image, with the web root pointed at Laravel's
public/ directory. Make sure nginx listens on the port you expose rather than the image
default.
Deploy
Create an application from your repository with the Dockerfile build method, and expose
the port your server listens on.
Connect a Database
Create a managed PostgreSQL database and provide its connection string. The variable depends on your Laravel version:
- Laravel 10 and earlier read
DATABASE_URL. - Laravel 11 and later read
DB_URL.
DB_URL=postgres://user:password@host:5432/dbname?sslmode=requireConnections require SSL, so keep ?sslmode=require in the string.
Run Migrations
Out Plane has no pre deploy hook. Run php artisan migrate --force once from the
browser terminal, or fold it into your container's start sequence.
Environment Variables
| Variable | Notes |
|---|---|
APP_KEY | Generate with php artisan key:generate --show and paste the value. |
APP_ENV | production. |
APP_DEBUG | false. |
APP_URL | https://{name}-{port}-{team}.outplane.app or your domain. |
LOG_CHANNEL | stderr, so logs reach the runtime log stream. |
Production Notes
- A
502or no response usually means the server is not listening on the exposed port. - Run
php artisan config:cacheonly after all environment variables are set.