Docker Compose
Run the Wardn control plane on one machine with Docker Compose, for evaluation and development.
The Compose file runs the same shape as the wardn-tiny chart: one server running every role, the web app, and a Postgres container. It is the fastest way to see Wardn on your own machine. Read Self-hosting first for what each part does.
You need Docker with the Compose plugin, and a checkout of the Wardn repository, which holds the Compose file in deploy/compose/.
Compose is for evaluation and development. The database and the keys live in Docker volumes on one machine, with nothing backing them up. Use wardn-standard for anything you would miss.
Start it
Bring the stack up
cd deploy/compose
docker compose upTo build the images from your checkout instead of using published ones, run docker compose up --build. To pin a released version, set the image variables in .env to that version's tags.
Wait for the keys and the database
On the first start, a one-off keys container makes the two secrets the install needs and keeps them in the keys volume:
- the Better Auth secret, which the web app signs sessions with and the server checks them with;
- the secret store's master key, an age key that protects the secrets Wardn stores, such as repository credentials.
A later start finds them and keeps them. The server waits for Postgres to be healthy, runs its database migrations, and then the web app creates its sign-in tables and starts.
Check the server
curl http://localhost:8080/api/v1/health
# {"status":"ok"}
curl http://localhost:8080/api/v1/ready/ready answers 200 once the database answers, every migration has run and the web app's sign-in tables exist. Until then it answers 503 and lists which check is not ready.
Create the first owner
The Compose file admits people only by invitation (WARDN_SIGNUP=invite), so nobody can sign up yet. Make the first owner with wardn admin create, open the setup link it prints, and choose a password at http://localhost:3002. For a trial nobody else can reach, set WARDN_SIGNUP=open in .env instead and anyone can sign up, each into a personal organization. From here, follow Connect a cluster and Deploy your first app.
What runs
| Service | Image | Port on your machine | Profile |
|---|---|---|---|
keys | ghcr.io/future-pirate-king/wardn-tools | none; runs once and exits | always |
postgres | postgres:18-alpine | none | postgres (on by default) |
server | ghcr.io/future-pirate-king/wardn-server | 8080 (API), 8443 (gateway) | always |
web | ghcr.io/future-pirate-king/wardn-web | 3002 | always |
pgbouncer | edoburu/pgbouncer | none | pooler |
jaeger | jaegertracing/jaeger | 16686 (its UI) | tracing |
The Compose project is called wardn-eval, so its volumes are wardn-eval_keys and wardn-eval_postgres-data. The server sets APP_ENV=production, so it refuses a weak Better Auth secret even here.
Settings in .env
Compose reads deploy/compose/.env. Everything in it is optional. These are Compose variables: the Compose file turns them into the server's settings.
| Variable | Default | What it does |
|---|---|---|
COMPOSE_PROFILES | postgres | Optional services to start, comma separated: postgres, pooler, tracing. Empty means you bring your own database. |
WARDN_POSTGRES_URL | the bundled database | Becomes POSTGRES_URL for the server and the web app. |
WARDN_POSTGRES_DIRECT_URL | empty | Becomes POSTGRES_DIRECT_URL. Set it when WARDN_POSTGRES_URL points at a pooler. |
WARDN_PUBLIC_URL | http://localhost:3002 | The address people open. Becomes the web app's base URL and the origin the server allows (CORS_ALLOWED_ORIGINS). |
WARDN_GATEWAY_HOSTS | localhost,127.0.0.1 | Becomes WARDN_GATEWAY_TLS_HOSTS: the names the gateway's generated certificate is valid for. |
WARDN_LOG_LEVEL | info | Becomes LOG_LEVEL. |
WARDN_TRACES_ENDPOINT | empty | Becomes WARDN_TRACES_ENDPOINT. |
WARDN_API_PORT | 8080 | The port the API is published on. |
WARDN_GATEWAY_PORT | 8443 | The port the gateway is published on. |
WARDN_WEB_PORT | 3002 | The port the web app is published on. |
WARDN_SERVER_IMAGE | ghcr.io/future-pirate-king/wardn-server:latest | The server image. |
WARDN_WEB_IMAGE | ghcr.io/future-pirate-king/wardn-web:latest | The web app image. |
WARDN_TOOLS_IMAGE | ghcr.io/future-pirate-king/wardn-tools:latest | The image that makes the keys. |
Change .env, then run docker compose up -d again to apply it.
Use your own database
Empty the profile list and point Wardn at your database:
COMPOSE_PROFILES=
WARDN_POSTGRES_URL=postgres://wardn:[email protected]:5432/wardn?sslmode=requireThe database must be Postgres 14 or newer, and the user must be able to create tables: the server migrates the schema when it starts. See Postgres.
Try the pooler
The pooler profile starts PgBouncer in transaction mode in front of the bundled database. Requests go through it; LISTEN, leases and migrations keep a direct connection, because a transaction pooler cannot hold a session for them.
COMPOSE_PROFILES=postgres,pooler
WARDN_POSTGRES_URL=postgres://wardn:wardn@pgbouncer:5432/wardn?sslmode=disable
WARDN_POSTGRES_DIRECT_URL=postgres://wardn:wardn@postgres:5432/wardn?sslmode=disableSee traces
COMPOSE_PROFILES=postgres,tracing
WARDN_TRACES_ENDPOINT=http://jaeger:4318Open Jaeger at http://localhost:16686. Requests, database transactions and background jobs appear as spans. See Monitoring.
Connect a cluster to it
An operator dials the gateway on port 8443 and checks its certificate. Two things have to agree:
- A name the cluster can reach your machine by. For a local cluster this is often your machine's address on the Docker or local network.
- The certificate is valid for that name. Add it to
WARDN_GATEWAY_HOSTSand restart the server.
WARDN_GATEWAY_HOSTS=localhost,127.0.0.1,192.168.1.20docker compose up -d
wardn cluster connect --create --name laptop --gateway-url https://192.168.1.20:8443The CLI talks to the API at WARDN_API_URL=http://localhost:3002. See wardn cluster connect for the other flags. The Quickstart shows the simpler route of running the control plane and the operator in the same kind cluster.
Add settings Compose does not list
The server's environment in the Compose file is fixed. To pass another setting, such as the GitHub App's, put a compose.override.yaml next to compose.yaml. Compose merges it automatically.
services:
server:
environment:
WARDN_GITHUB_APP_ID: "123456"
WARDN_GITHUB_APP_SLUG: my-wardn
WARDN_GITHUB_APP_PRIVATE_KEY_FILE: /run/wardn/github-app.pem
WARDN_GITHUB_WEBHOOK_SECRET: ${WARDN_GITHUB_WEBHOOK_SECRET}
WARDN_PUBLIC_URL: http://localhost:3002
volumes:
- ./github-app.pem:/run/wardn/github-app.pem:roThe server runs as user 10001, so the key file must be readable by it. GitHub can only deliver webhooks to an address it can reach; on a laptop, the one-minute poll picks up pushes instead. See GitHub App.
Stop, reset and update
| Command | Effect |
|---|---|
docker compose stop | Stops the containers and keeps everything. |
docker compose down | Removes the containers and keeps the volumes, so the next up finds your data and keys. |
docker compose down -v | Removes the volumes too: the database and the keys are gone for good. |
docker compose pull && docker compose up -d | Updates to the images the variables name. Migrations run when the new server starts. |
Read Upgrading before moving between versions, and Backup and restore to copy the data out.