Self-hosting

Docker, a TLS proxy, the production checklist, monitoring, backups and upgrades.

Forkbase is free to self-host under FSL-1.1-ALv2: use it for your own apps and your company's; each version becomes Apache-2.0 two years after its release. What the licence doesn't allow is offering Forkbase itself as a competing hosted service.

What you need

  • A Linux or macOS machine. 1 vCPU and 1 GB of RAM run a small app; agents' worlds and jobs want more.
  • postgres mode: Postgres 16 or later, anywhere Forkbase can reach. chronos mode: nothing else.
  • The Chronos engine for agents: the installer adds it with FORKBASE_ENGINE=1, and the Docker image has it.
  • Node 22.6+ and/or Python 3 on the machine if you run jobs.
  • A TLS proxy (Caddy, nginx, a load balancer) in front. Forkbase serves plain HTTP.

Install the binary

One command puts forkbase and the engine in ~/.local/bin:

shell
curl -fsSL https://github.com/2090-labs/forkbase/releases/latest/download/install.sh | FORKBASE_ENGINE=1 sh

It picks the build for the machine (macOS or Linux, x86-64 or ARM; the Linux builds are static and run on any distribution), checks it against the release's SHA256SUMS, runs it once, and only then puts it in place. It never runs anything as root. For a server, install into /usr/local/bin yourself:

shell
curl -fsSL https://github.com/2090-labs/forkbase/releases/latest/download/install.sh -o install.sh
sudo env FORKBASE_INSTALL_DIR=/usr/local/bin FORKBASE_ENGINE=1 sh install.sh
VariableWhat it does
FORKBASE_ENGINE=1also installs the Chronos engine (the version this release was tested with), with its own checks
FORKBASE_VERSION=v0.2.0installs that release instead of the one the script came from
FORKBASE_INSTALL_DIRwhere the binaries go (default ~/.local/bin)
FORKBASE_VERIFY=1requires the Sigstore signature check (needs cosign); 0 skips it. With cosign on the PATH it runs anyway

Each build is signed keylessly by 2090 Labs' release account. To check a download by hand:

shell
cosign verify-blob --bundle forkbase-x86_64-unknown-linux-musl.tar.gz.sigstore.json \
  --certificate-identity chronos-release@project-7a947b34-cb98-4716-8f2.iam.gserviceaccount.com \
  --certificate-oidc-issuer https://accounts.google.com forkbase-x86_64-unknown-linux-musl.tar.gz

Every release, its notes and its files: github.com/2090-labs/forkbase/releases. To build from source instead: cargo build --profile dist -p forkbase (the dashboard first: cd dashboard && npm ci && npm run build).

Docker

There is no published image yet: build it from the release you want.

shell
git clone --branch v0.2.0 https://github.com/2090-labs/forkbase && cd forkbase

The image holds forkbase, the engine and Node 22 (so TypeScript and JavaScript jobs run in it), runs as a non-root user, keeps its state in /data, and listens on 0.0.0.0:8000.

shell
docker build -f deploy/Dockerfile -t forkbase .

That compiles Forkbase (it wants 8 GB of memory). deploy/Dockerfile.release makes the same image from a release's signed tarballs instead, in a minute, for both architectures:

shell
docker buildx build -f deploy/Dockerfile.release --platform linux/amd64,linux/arm64 \
  --build-arg VERSION=0.2.0 --build-arg ENGINE_VERSION=0.9.2 -t forkbase:0.2.0 .

Python jobs need python3 in the image: build FROM it, or run jobs on a server that has it (jobs.enabled).

Over your own Postgres:

shell
POSTGRES_PASSWORD=$(openssl rand -hex 16) docker compose -f deploy/docker-compose.postgres.yml up -d
curl http://127.0.0.1:8000/health
docker compose -f deploy/docker-compose.postgres.yml exec forkbase forkbase keys

On the engine alone:

shell
docker compose -f deploy/docker-compose.chronos.yml up -d

Both compose files publish port 8000 on the host's loopback only. Configure with FORKBASE_* variables (see Configuration).

A TLS proxy

Caddy, which gets the certificate itself:

text
api.myapp.com {
    reverse_proxy 127.0.0.1:8000
}

WebSockets (/realtime/v1/websocket) pass through as is. With nginx, forward Upgrade and Connection headers, and set X-Forwarded-For so sign-in throttling sees real addresses.

Then set auth.external_url to https://api.myapp.com: tokens name it, and emailed links and OAuth point at it.

systemd

After installing into /usr/local/bin, give Forkbase its own user and folder:

shell
sudo useradd --system --home /var/lib/forkbase --create-home forkbase
sudo install -d -o forkbase -m 700 /etc/forkbase
cd /etc/forkbase && sudo -u forkbase env FORKBASE_DATA=/var/lib/forkbase forkbase init --db chronos
# postgres mode: --db postgres, and the database URL in /etc/forkbase/database-url (owner-only)
ini
# /etc/systemd/system/forkbase.service
[Unit]
After=network-online.target

[Service]
User=forkbase
WorkingDirectory=/etc/forkbase
Environment=FORKBASE_DATA=/var/lib/forkbase
Environment=FORKBASE_DATABASE_URL_FILE=/etc/forkbase/database-url
EnvironmentFile=-/etc/forkbase/env
ExecStart=/usr/local/bin/forkbase start
Restart=on-failure

[Install]
WantedBy=multi-user.target

Production checklist

  • auth.external_url and auth.site_url set to https:// addresses.
  • Email is smtp (the default log writes sign-in links to the log).
  • Secrets in variables or files readable by Forkbase's user only, not in forkbase.toml.
  • The data folder is backed up. Its secrets.json signs the API keys and sessions and holds the engine's tokens; without it the old keys stop working.
  • The service key is only on your servers. If it leaks, rotation alone doesn't stop it: POST /auth/v1/admin/keys/rotate (it answers the new anon and service_role keys and the new kid), put the new keys everywhere they're used, then GET /auth/v1/admin/keys and POST /auth/v1/admin/keys/{kid}/retire the old key, now verifying. Retiring ends every API key and session it signed.
  • RLS is on for every table people reach with the anon key.
  • Every agent has a merge policy you wrote; approvers get Slack or email.
  • /metrics is scraped and /health is checked.
  • Jobs run only code you trust.

Several servers

Several Forkbase servers can share one database for more throughput or availability. Schedules fire once, jobs are leased (a dead server's jobs go back in line), and realtime changes reach every server through LISTEN/NOTIFY. Give them the same secrets.json (copy it from the first server's data folder): it holds the key the API keys and sessions are signed with.

Backups

  • postgres mode: back up your Postgres as you do now (it holds your data and Forkbase's state), plus the data folder.
  • chronos mode: the dashboard's Database, Backups (or POST /platform/v1/backups) copies the engine's folder into <data>/backups/<time> while it serves; copy that off the server. main also keeps its history: restore it to a checkpoint or a time from the same page. To start from a backup, stop Forkbase, put the backup in place of <data>/chronos/db, and start it.
  • a dump: in postgres mode, Database, Backups downloads a pg_dump (custom format, for pg_restore); it needs the Postgres client tools on the server (FORKBASE_PG_DUMP names the binary).
  • storage: the local folder or your S3 bucket.

Upgrades

Run the installer again (it installs the latest release, or FORKBASE_VERSION), or rebuild the image, then restart. Read the release's notes first: releases. Migrations run at start, are append-only, and never drop your data. Run forkbase migrate first if several servers share the database.

Monitoring

  • GET /health: 200 when the database (and the engine) answer, 503 otherwise. The body has status, version, mode, uptime_s, database (pool) and engine.
  • GET /metrics: Prometheus text, with agent runs' counters and tool durations.
  • Each agent run's steps: GET /agents/v1/runs/{id}/ledger, and as OpenTelemetry traces with FORKBASE_OTLP_ENDPOINT. See Observability.
  • Logs on stderr; FORKBASE_LOG=debug for more.

Something wrong or missing? Edit this page on GitHub or open an issue.

Self-hosting · Forkbase