All templates

Deploy Laravel with Postgres on Rebasable

Laravel 13 on FrankenPHP; migrations and config caching run on boot.

Runtime: docker Free instance with Postgres phppostgresdocker

How it works

The Dockerfile installs Composer dependencies without dev packages and copies the app into a FrankenPHP image (Caddy with PHP built in). docker/start.sh turns the generated APP_KEY_B64 into Laravel’s base64: key, sets APP_URL from REBASABLE_EXTERNAL_URL, caches config, routes and views, runs php artisan migrate --force and serves public/ on $PORT. Sessions, cache and queue use the database. Proxies are trusted so generated URLs use https.

Run it locally

composer install
cp .env.example .env && php artisan key:generate
php artisan migrate
php artisan serve   # http://localhost:8000

Use it as your own repository

Copy the laravel folder of the templates repository into a new repo (the files at the root, rebasable.yaml included) and push it. Then add a Deploy button to its README, or create it from Blueprints, New blueprint in the dashboard. From then on, every push deploys, and pull requests get preview environments.

Good to know

  • Queue worker: add a type: worker service from the same repo with dockerCommand: php artisan queue:work.
  • Scheduler: add a type: cron service with schedule: "* * * * *" and dockerCommand: php artisan schedule:run.
  • /info returns JSON with the Laravel version and the database driver in use.