Skip to content

Install with Docker Compose

This setup runs four containers on one machine: PostgreSQL, the API, one or more background workers and the web UI. All images are pulled from the GitHub Container Registry; nothing needs to be built or cloned.

  • Docker Engine with the Docker Compose plugin (docker compose version)
  • openssl to generate secrets
  • Network access from this machine to the SSH ports of the hosts you want to manage (see Requirements)
firehawk/
├── docker-compose.yml
├── .env
└── sshkeys/ optional SSH private key files hosts can refer to
Terminal window
mkdir -p firehawk/sshkeys && cd firehawk

Save this as docker-compose.yml:

# FIREHAWK_TAG in .env: latest (latest build of the default branch) or a release like 1.0.0 / 1.0 / 1.
# Update: docker compose pull && docker compose up -d
services:
db:
image: postgres:16-alpine
restart: unless-stopped
environment:
POSTGRES_USER: ${POSTGRES_USER:-firehawk}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-firehawk}
POSTGRES_DB: ${POSTGRES_DB:-firehawk}
volumes:
- pgdata:/var/lib/postgresql/data
healthcheck:
test: ["CMD-SHELL", "pg_isready -U ${POSTGRES_USER:-firehawk}"]
interval: 5s
timeout: 5s
retries: 10
networks: [firehawk]
api:
image: ${FIREHAWK_REGISTRY:-ghcr.io/eos916101}/firehawk-api:${FIREHAWK_TAG:-latest}
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-firehawk}:${POSTGRES_PASSWORD:-firehawk}@db:5432/${POSTGRES_DB:-firehawk}
POSTGRES_USER: ${POSTGRES_USER:-firehawk}
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-firehawk}
RUN_WORKER: "false"
volumes:
- ./sshkeys:/app/sshkeys
ports:
- "${API_PORT:-8000}:8000"
depends_on:
db:
condition: service_healthy
networks: [firehawk]
# background jobs (drift checks, alias refreshes, safe-deploy checks, rollouts, notifications);
# scale with: docker compose up -d --scale worker=3
worker:
image: ${FIREHAWK_REGISTRY:-ghcr.io/eos916101}/firehawk-api:${FIREHAWK_TAG:-latest}
command: ["python", "-m", "app.worker"]
restart: unless-stopped
env_file: .env
environment:
DATABASE_URL: postgresql+asyncpg://${POSTGRES_USER:-firehawk}:${POSTGRES_PASSWORD:-firehawk}@db:5432/${POSTGRES_DB:-firehawk}
WORKER_CONCURRENCY: ${WORKER_CONCURRENCY:-8}
volumes:
- ./sshkeys:/app/sshkeys
stop_grace_period: 30s
depends_on:
db:
condition: service_healthy
networks: [firehawk]
frontend:
image: ${FIREHAWK_REGISTRY:-ghcr.io/eos916101}/firehawk-frontend:${FIREHAWK_TAG:-latest}
restart: unless-stopped
ports:
- "${FRONTEND_PORT:-8080}:80"
depends_on: [api]
networks: [firehawk]
networks:
firehawk:
name: firehawk_firehawk
driver: bridge
volumes:
pgdata:

The API and the worker use the same image; the worker only runs a different command. The API runs with RUN_WORKER=false because the separate worker service processes the background jobs.

Generate .env with fresh secrets:

Terminal window
cat > .env <<EOF
# image version: pin a release in production (1 = no breaking changes, 1.0 = patches only, 1.0.0 = exact)
FIREHAWK_TAG=1
# signs sessions and encrypts stored secrets: back it up, never lose or change it casually
SECRET_KEY=$(openssl rand -hex 32)
# bundled PostgreSQL (the password only applies when the database volume is first created)
POSTGRES_USER=firehawk
POSTGRES_PASSWORD=$(openssl rand -hex 16)
POSTGRES_DB=firehawk
# published ports
API_PORT=127.0.0.1:8000
FRONTEND_PORT=8085
# the address users open in the browser
FRONTEND_ORIGIN=https://firehawk.example.com
# first account, created only while the database has no user
BOOTSTRAP_ADMIN_EMAIL=admin@firehawk.local
BOOTSTRAP_ADMIN_PASSWORD=$(openssl rand -base64 18)
TOKEN_EXPIRE_MINUTES=720
DRIFT_CHECK_INTERVAL_MINUTES=30
WORKER_CONCURRENCY=8
EOF
chmod 600 .env
grep BOOTSTRAP_ADMIN_PASSWORD .env

Notes:

  • API_PORT=127.0.0.1:8000 publishes the API on localhost only. Users never need port 8000: the UI proxies /api/ to the API internally. Use API_PORT=8000 if you want the API reachable from other machines.
  • FRONTEND_PORT defaults to 8080 in the Compose file when not set; this documentation uses 8085.
  • Set FRONTEND_ORIGIN to the URL users actually open (behind a reverse proxy, the HTTPS URL). It is also the default public URL for notification links and the single sign-on redirect.
  • Every variable is described in Configuration.
Terminal window
docker compose up -d
docker compose ps
docker compose logs -f api

On the first start the API waits for PostgreSQL (up to DB_WAIT_SECONDS, default 90), creates the schema, runs the migrations, creates the bootstrap admin account and the built-in roles.

Terminal window
# the API is up (returns the running version)
curl -s http://127.0.0.1:8000/api/health
# {"status":"ok","service":"firehawk-api","version":"1.0.0"}
# the API reaches the database
curl -s http://127.0.0.1:8000/api/ready
# {"status":"ok","database":"ok"}
# the same through the UI container
curl -s http://127.0.0.1:8085/api/ready

/api/ready answers with HTTP 503 and "database":"unreachable" while the database cannot be reached.

Then open http://<server>:8085, sign in with the bootstrap credentials and change the password (Users & access, Reset password on your account). The version is shown in the sidebar and on the login page.

For anything beyond a test, put a TLS reverse proxy in front: see TLS and reverse proxy.

Hosts can authenticate with a private key file placed in sshkeys/ (mounted at /app/sshkeys in the API and worker containers) and referred to by file name on the host form. Make the files readable by the container user only.

Stored credentials on the Credentials page need no files, are encrypted in the database and support key rotation; prefer them. See Credentials and jump hosts.

Background work (drift checks, dynamic alias refreshes, safe-deploy checks, rollouts, rule expiry, notifications) runs on the workers. Run more of them for many hosts:

Terminal window
docker compose up -d --scale worker=3

Each worker processes up to WORKER_CONCURRENCY jobs at once (default 8). See Background jobs and workers.

Variable Default in the Compose file Container port Purpose
FRONTEND_PORT 8080 80 Web UI and /api/ proxy
API_PORT 8000 8000 API and its interactive docs at /docs

PostgreSQL is not published; it is only reachable on the internal firehawk_firehawk network.

Terminal window
docker compose pull
docker compose up -d

Migrations run automatically when the new containers start. Back up the database and .env first, and read Versions and upgrades for tag pinning and rollback.

To reach managed hosts over IPv6 from the containers, the Docker network needs an IPv6 subnet, and the API and nginx must listen on IPv6. Add a docker-compose.override.yml (Compose reads it automatically):

services:
api:
command: ["uvicorn", "app.main:app", "--host", "::", "--port", "8000"]
frontend:
command:
- sh
- -c
- "/docker-entrypoint.d/20-envsubst-on-templates.sh && sed -i 's/listen 80;/listen 80; listen [::]:80;/' /etc/nginx/conf.d/default.conf; exec nginx -g 'daemon off;'"
networks:
firehawk:
enable_ipv6: true
ipam:
config:
- subnet: 172.20.0.0/16
- subnet: fd00:f1e:4a3c::/64

Pick subnets that do not overlap with other Docker networks on the machine. The network has to be recreated (docker compose down, then up -d). See Troubleshooting for why the listeners matter.