Generate a release Dockerfile, set your secrets, push, then run migrations. Want a working repo first? Deploy the phoenix starter from Templates.
Build with a Dockerfile
Phoenix generates a production Dockerfile, a release, and bin/server / bin/migrate scripts:
mix phx.gen.release --docker
Commit the generated files. Wokku builds the Dockerfile and runs its CMD (/app/bin/server). You don’t need a Procfile.
Runtime config
The generated config/runtime.exs already reads PORT, DATABASE_URL, SECRET_KEY_BASE and PHX_HOST. bin/server sets PHX_SERVER=true, so the endpoint starts.
wokku apps:create my-app --shared postgres
wokku config:set my-app \
SECRET_KEY_BASE="$(mix phx.gen.secret)" \
PHX_HOST=my-app.wokku.app
The Postgres add-on sets DATABASE_URL. See Create & Link a Database.
Deploy and migrate
git remote add wokku git@git.wokku.cloud:my-app
git push wokku main
wokku run my-app -- /app/bin/migrate
Run the migrate command after every deploy that adds migrations. Live at https://my-app.wokku.app. First deploy? See the Quickstart.
Custom domain
After you add a custom domain, set PHX_HOST to it and restart: wokku ps:restart my-app.
Troubleshooting
- App boots but never responds — check
runtime.exsbindsPORTon all interfaces and thatPHX_SERVER=trueis set (start withbin/server). SECRET_KEY_BASEmissing — generate one withmix phx.gen.secretand set it.- WebSocket/LiveView origin errors —
PHX_HOSTmust match the hostname you’re visiting.