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.
Prerequisites
Section titled “Prerequisites”- Docker Engine with the Docker Compose plugin (
docker compose version) opensslto generate secrets- Network access from this machine to the SSH ports of the hosts you want to manage (see Requirements)
Directory layout
Section titled “Directory layout”firehawk/├── docker-compose.yml├── .env└── sshkeys/ optional SSH private key files hosts can refer tomkdir -p firehawk/sshkeys && cd firehawkThe Compose file
Section titled “The Compose file”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 -dservices: 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.
The environment file
Section titled “The environment file”Generate .env with fresh secrets:
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 casuallySECRET_KEY=$(openssl rand -hex 32)
# bundled PostgreSQL (the password only applies when the database volume is first created)POSTGRES_USER=firehawkPOSTGRES_PASSWORD=$(openssl rand -hex 16)POSTGRES_DB=firehawk
# published portsAPI_PORT=127.0.0.1:8000FRONTEND_PORT=8085
# the address users open in the browserFRONTEND_ORIGIN=https://firehawk.example.com
# first account, created only while the database has no userBOOTSTRAP_ADMIN_EMAIL=admin@firehawk.localBOOTSTRAP_ADMIN_PASSWORD=$(openssl rand -base64 18)
TOKEN_EXPIRE_MINUTES=720DRIFT_CHECK_INTERVAL_MINUTES=30WORKER_CONCURRENCY=8EOFchmod 600 .envgrep BOOTSTRAP_ADMIN_PASSWORD .envNotes:
API_PORT=127.0.0.1:8000publishes the API on localhost only. Users never need port 8000: the UI proxies/api/to the API internally. UseAPI_PORT=8000if you want the API reachable from other machines.FRONTEND_PORTdefaults to 8080 in the Compose file when not set; this documentation uses 8085.- Set
FRONTEND_ORIGINto 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.
docker compose up -ddocker compose psdocker compose logs -f apiOn 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.
Verify
Section titled “Verify”# 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 databasecurl -s http://127.0.0.1:8000/api/ready# {"status":"ok","database":"ok"}
# the same through the UI containercurl -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.
SSH key files
Section titled “SSH key files”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.
Scale the workers
Section titled “Scale the workers”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:
docker compose up -d --scale worker=3Each 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.
Update
Section titled “Update”docker compose pulldocker compose up -dMigrations run automatically when the new containers start. Back up the database and .env first, and read Versions and upgrades for tag pinning and rollback.
Optional: IPv6 on the FireHawk network
Section titled “Optional: IPv6 on the FireHawk network”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::/64Pick 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.
