Skip to the content
Vaubaan Gateway
Docs menu

Install with Docker Compose

The reference Compose file runs the gateway, its data volume, a volume of its own for the encryption key, and a Caddy proxy that terminates TLS for your domain. It builds the gateway's image from the repository, or runs a released one.

Requirements

  • Docker with Compose v2.
  • A DNS name pointing at the host; its https:// origin is the instance's public URL.
  • Ports 80 and 443 reachable from the internet: Caddy obtains and renews the certificate.

Steps

git clone https://github.com/vaubaan/gateway.git
cd gateway
cp deploy/config/.env.example deploy/config/.env
cp deploy/config/gateway.example.yaml deploy/config/gateway.yaml
openssl rand -hex 24       # prints a value for VAUBAAN_BOOTSTRAP_TOKEN

Edit deploy/config/.env: GATEWAY_DOMAIN, VAUBAAN_PUBLIC_URL (https, same host), VAUBAAN_ADMIN_EMAILS, and VAUBAAN_BOOTSTRAP_TOKEN. Then:

docker compose --env-file deploy/config/.env -f deploy/compose.yaml up -d --build
curl -s https://your-domain/healthz

/healthz answers {"status":"ok",...} with the version and the commit. Then the first sign-in, and check your instance.

A missing or invalid key stops the container with exit code 78 and a message naming every key (docker compose --env-file deploy/config/.env -f deploy/compose.yaml logs gateway); the minimum is in Install, minimum configuration.

Run a released image instead

To run a released image rather than build one, replace the build: block and the image: line of the gateway service in deploy/compose.yaml by image: ghcr.io/vaubaan/gateway@sha256:..., the digest you verified, and drop --build. Which tag to pick and how to verify it: verify an image.

The encryption key

The instance generates its encryption key at its first start, on a volume of its own, never on the store's: compose.yaml mounts the volume gateway-key at /keys, and the example .env sets VAUBAAN_MASTER_KEY_FILE=/keys/master.key and VAUBAAN_MASTER_KEY_GENERATE=1. The gateway writes the file (32 random bytes, base64, mode 0600) and the setup's first step, Your encryption key, hands it to you: download it and keep it outside the host. A backup of the store opens with it only.

  • Back the two volumes up separately. A copy that holds both the store and its key opens every credential. The start warns when the key file and the store share a mount; VAUBAAN_ACCEPT_KEY_BESIDE_STORE=1 silences it, for a platform with one volume whose snapshots you keep apart from the key.
  • Nothing is generated once the store holds data: a key missing on an existing store stops the container with exit code 78.
  • To provide the key yourself, run npm run gen-master-key (needs Node.js) and put the output in VAUBAAN_MASTER_KEY, or in a secret file named by VAUBAAN_MASTER_KEY_FILE (a Docker secret, /run/secrets/name), and leave VAUBAAN_MASTER_KEY_GENERATE unset.
  • Download it again from Settings → Administration → Encryption, after a fresh sign-in; every download is recorded in the activity.

A key on the data volume

Instances installed up to 2.0.0-alpha.11 keep their key at /data/master.key, beside the store. They keep starting, with the warning. To move the key to its own volume, stop the gateway, copy the key, set VAUBAAN_MASTER_KEY_FILE=/keys/master.key in deploy/config/.env, start, check, then remove the old copy:

docker compose --env-file deploy/config/.env -f deploy/compose.yaml stop gateway
docker compose --env-file deploy/config/.env -f deploy/compose.yaml run --rm --no-deps \
  --entrypoint sh gateway -c 'cp -p /data/master.key /keys/master.key'
$EDITOR deploy/config/.env                 # VAUBAAN_MASTER_KEY_FILE=/keys/master.key
docker compose --env-file deploy/config/.env -f deploy/compose.yaml up -d
docker compose --env-file deploy/config/.env -f deploy/compose.yaml run --rm --no-deps \
  --entrypoint sh gateway -c 'rm /data/master.key'

The two configuration files

  • Pass --env-file deploy/config/.env on every Compose command (up, down, logs, config): Compose reads GATEWAY_DOMAIN from it and hands that one variable to the proxy. Without it the command stops with a message naming GATEWAY_DOMAIN. The proxy receives nothing else; the master key, the bootstrap token and the sign-in provider's secret go to the gateway container only. GATEWAY_DOMAIN must be the host of VAUBAAN_PUBLIC_URL; nothing checks it for you.
  • The YAML file wins over the environment, key by key, silently. gateway.example.yaml ships with every key commented out, so the copy changes nothing and .env decides until you uncomment a key. Uncomment only what you want the file to own, replace the example value (gateway.example.com, gateway-admins and ops@example.com are examples), and remove the twin variable from .env. You may use either source alone.
  • Secrets go in through ${NAME} or ${file:/path} references in the YAML, or *_FILE variables.
  • Both files are gitignored (deploy/config/.env, deploy/config/gateway.yaml); the *.example* files are tracked. Never commit your copies.

Every key: configuration keys.

The proxy

  • Caddy is the one proxy the gateway believes. compose.yaml puts it at a fixed address of its own network (172.30.253.2 on 172.30.253.0/29) and sets VAUBAAN_TRUSTED_PROXIES to that address alone. If that subnet is taken on your host, change the subnet and both addresses of compose.yaml together. Never trust a whole Docker pool: every container on it could then pick the address it is limited and audited under. A value in .env wins, for another proxy in front of Caddy.
  • The gateway sets its own security headers; the proxy must not add or override them. The proxy must not buffer responses (the MCP door streams) nor cap request bodies under /git/ (a push streams through). The reference Caddyfile does neither.
  • Hardening. compose.yaml runs the gateway with a read-only root filesystem, every capability dropped, no-new-privileges and /tmp as a tmpfs; the server writes nothing but /data and /tmp.

Your own proxy instead of Caddy: run behind your own proxy.

Then

Last changed 2026-12-02. This page as Markdown: /docs/install/docker-compose.md