Docker and Compose
The image
Section titled “The image”The root Dockerfile is multi-stage:
- Build stage. Checks Node is 22.19 or newer, runs
npm ci, thennpm run build(the dashboard and the server), thennpm prune --omit=dev. - Run stage.
node:22-slim, runs as the non-rootnodeuser, exposes port 3000, has a health check, and startsnode --no-warnings apps/server/dist/server.mjs.
Workspace packages stay TypeScript. Node strips the types at run time. They must be production dependencies of the server so pruning keeps them in the image.
docker build -t knetik .The docs site (apps/docs) is not part of the image.
Docker Compose (tested)
Section titled “Docker Compose (tested)”deploy/docker-compose.yml runs Knetik on one machine, with its data folder on a volume.
cd deploycp .env.example .env # fill it indocker compose up -d --buildOpen KNETIK_BASE_URL. Compose requires KNETIK_BASE_URL. The Knetik service reads the sign-in, connector and model variables from the same .env.
The data folder (KNETIK_DATA_DIR: knetik.db, flue.db and artifacts/) lives on a volume. docker compose down keeps it. docker compose down --volumes removes it along with all data, so use that only to start over.
Minimum .env
Section titled “Minimum .env”KNETIK_BASE_URL=http://localhost:3000KNETIK_ALLOWED_USERS=you@example.comKNETIK_ADMINS=you@example.comKNETIK_MAIL=consoleKNETIK_MAIL=console prints sign-in links to the server log: fine for a trial, not for production. See Sign-in.
For a real deployment
Section titled “For a real deployment”Put a TLS-terminating proxy (Caddy, nginx, or a cloud load balancer) in front, set KNETIK_BASE_URL=https://... and KNETIK_TRUST_PROXY=1. See the overview for the one-instance rule.
Checking it
Section titled “Checking it”docker compose pscurl http://localhost:3000/api/healthSign in, start a run, restart the container (docker compose restart knetik), and confirm the run and its gate are still there. The container test does exactly this.
Data and backups
Section titled “Data and backups”Everything Knetik stores on Node is in the data folder: runs, events, gate decisions, sessions and connections (encrypted) in knetik.db, the agent framework’s store in flue.db, and artifact files. Back up the whole folder (stop the server first, or use SQLite’s own backup tooling for a consistent copy) and, if you use connectors, KNETIK_SECRET_KEY. Without the key, stored connections cannot be decrypted.