Deploy a Laravel app to Wokku with Postgres, run migrations on every release,
and go live on HTTPS — in a few minutes.
Prerequisites
- A Wokku account and a connected server
- An SSH key registered under Profile → SSH Keys (for
git push) - A Laravel app locally (
composer create-project laravel/laravel my-appif you’re starting fresh)
1. Create the app
- Go to Apps → New App
- Choose your server and name it (e.g.
my-laravel-app) - Pick a box size and click Create
wokku apps:create my-laravel-app --server my-server
2. Prepare your Laravel app
Add a Procfile to your project root so Wokku knows how to serve the app and
run migrations on each deploy:
web: vendor/bin/heroku-php-apache2 public/
release: php artisan migrate --force
The buildpack auto-detects Laravel from composer.json and installs PHP +
Composer dependencies. The release process runs after a successful build,
before traffic shifts — so migrations apply with zero downtime.
3. Set environment variables
Laravel needs at least an app key and production env. Generate a key locally
with php artisan key:generate --show, then:
Open your app → Config and add:
| Key | Value |
|---|---|
APP_KEY |
base64:... (from key:generate --show) |
APP_ENV |
production |
APP_DEBUG |
false |
wokku config:set my-laravel-app \
APP_KEY="base64:..." APP_ENV=production APP_DEBUG=false
See Environment Variables for the full reference.
4. Add a database
Provision a Postgres database and link it — Wokku injects a DATABASE_URL
automatically. Point Laravel at it by setting DB_CONNECTION=pgsql (Laravel
reads DATABASE_URL natively in recent versions).
App → Resources → Add-ons, choose Postgres, and link it to the app.
wokku addons:create postgres my-laravel-app
wokku config:set my-laravel-app DB_CONNECTION=pgsql
More detail in Create & Link a Database.
5. Deploy
Copy the git remote from your app’s overview page, then:
git remote add wokku git@git.wokku.cloud:my-laravel-app
git push wokku main
Connect your repo under Apps → Connect GitHub and every push to your
deploy branch ships automatically. See GitHub Auto-Deploy.
git remote add wokku git@git.wokku.cloud:my-laravel-app
git push wokku main
Watch the build stream in your logs. When it finishes, your app is live at
https://my-laravel-app.wokku.app.
6. Add a custom domain
Point your own domain and Wokku provisions SSL automatically — see
Custom Domains.
Troubleshooting
- 500 on first load — usually a missing
APP_KEY. Set it (step 3) and redeploy. - Migrations didn’t run — confirm the
release:line is in yourProcfileand check the deploy logs. - Storage / sessions — use the database or cache driver for sessions in production; local disk is ephemeral.