w wokku
Get Started
~/docs
/
frameworks

# Deploy Phoenix (Elixir)

Updated · Edit on GitHub ↗

Deploy a Phoenix app to Wokku with Postgres and Ecto migrations on release.

Prerequisites

1. Create the app

Apps → New App → server, name my-phoenix-app, box size, Create.

2. Prepare your Phoenix app

The Elixir buildpack detects mix.exs, fetches deps, and builds assets. Add a
Procfile:

procfile
web: mix phx.server
release: mix ecto.migrate

In config/runtime.exs, read the port and database from the environment:

elixir
config :my_app, MyAppWeb.Endpoint,
  http: [ip: {0, 0, 0, 0}, port: String.to_integer(System.get_env("PORT") || "4000")],
  server: true
config :my_app, MyApp.Repo, url: System.get_env("DATABASE_URL")

3. Set environment variables

App → Config:

Key Value
SECRET_KEY_BASE mix phx.gen.secret output
MIX_ENV prod
PHX_HOST my-phoenix-app.wokku.app

4. Add a database

bash
wokku addons:create postgres my-phoenix-app

Wokku injects DATABASE_URL; wire it in runtime.exs (above). See
Create & Link a Database.

5. Deploy

bash
git remote add wokku git@git.wokku.cloud:my-phoenix-app
git push wokku main

Live at https://my-phoenix-app.wokku.app.

Custom domain

Custom Domains — update PHX_HOST to match, then redeploy.

Troubleshooting

  • Endpoint not serving — set server: true in runtime.exs and bind to {0,0,0,0} + $PORT.
  • SECRET_KEY_BASE missing — generate with mix phx.gen.secret and set it.
  • Migrations didn’t run — confirm the release: line; check deploy logs.

Next steps

Was this page helpful?