Skip to content

Production setup

This page covers what changes when a team shares one coordinator. It assumes you ran the quickstart once. It covers the network, TLS, the first admin token, invites, project rules, sandboxes, and backups.

engineer machines coordinator host (Linux)
+-------------+ +------------------------------------------+
| zt | -- tailnet --> | TLS (tailscale serve or a reverse proxy) |
+-------------+ HTTPS | -> 127.0.0.1:8080 coordinator |
| -> Postgres 16 + pgvector |
GitHub merge check -- HTTPS -->| |
| OpenShell gateway and sandboxes |
| agent -> coordinator on loopback |
+------------------------------------------+
Part Where it runs Reached over
Coordinator and Postgres One Linux host, with Docker Compose 127.0.0.1 only. Compose binds every port to loopback.
TLS The same host The tailnet, on HTTPS
zt Each engineer’s machine, or the shared host over Tailscale SSH HTTPS on the tailnet, or http://127.0.0.1:8080 on the shared host
OpenShell gateway The coordinator host Local. The sandbox reaches the coordinator on the host’s loopback.
Merge check GitHub Actions, or a GitHub App HTTPS to the coordinator

The sandbox flow has run only with the coordinator on the gateway host’s loopback. This layout keeps to that.

  • A Linux host with Docker and Compose v2 for the coordinator.
  • Tailscale on the coordinator host and on every machine that runs zt.
  • An OpenShell v0.1.10 gateway on the same host, if your agents run in sandboxes.
  • For each engineer, their own agent account or API key. Every user brings their own agent credentials. Zentri never collects, proxies, stores, or resells model access or consumer subscription tokens. See compliance.

Copy the example environment file and set strong passwords:

Terminal window
cp deploy/.env.example deploy/.env
Variable Why you change it
POSTGRES_PASSWORD The Postgres superuser password. The default is for development only.
ZENTRI_APP_DB_PASSWORD The password of zentri_coordinator, the role the coordinator serves with. It is read only when the data volume is first created, so set it before the first start.
ZENTRI_PORT, POSTGRES_PORT The host ports on 127.0.0.1, if 8080 or 5432 are taken.

deploy/.env is ignored by git. Never commit it. Then start the stack in the background:

Terminal window
docker compose -f deploy/docker-compose.yml up -d --build

The one-shot migrate service applies the schema as the database owner. The coordinator then serves as zentri_coordinator with serve --no-migrate. Its container runs as nonroot, with a read-only root filesystem, every capability dropped, and no-new-privileges. Check it with curl -s http://127.0.0.1:8080/readyz.

Docker Compose covers every service and setting. Server CLI and environment list the flags and variables.

The coordinator does not serve TLS. zt refuses a server URL that is not https://, unless the host is loopback (127.0.0.0/8, ::1, or localhost). The merge check has the same rule for its ZENTRI_URL. So every client that is not on the coordinator host needs TLS in front of the coordinator.

Pick one:

  • tailscale serve. Tailscale serves HTTPS on the tailnet with a certificate for the host’s MagicDNS name, and forwards to 127.0.0.1:8080. Nothing listens on a public interface. See Tailscale, and Tailscale’s own documentation for the command on your version. This is a Tailscale feature. Zentri’s tests do not cover it.
  • A reverse proxy with your own certificate, forwarding to 127.0.0.1:8080.
  • No TLS, shared host. Engineers connect to the coordinator host with Tailscale SSH and run zt there, with --server http://127.0.0.1:8080.

Use Tailscale’s access controls to decide who can reach the coordinator’s HTTPS port.

On its first start with no admin, the coordinator creates the default org, a user named admin, and an admin token labeled bootstrap. That token has no expiry. Treat it as temporary. Use it once to create your own admin, then revoke it.

You have two ways to get it.

Printed once. Without other setup, the coordinator prints the token to its standard output once, on the start that creates the admin. It never writes it through its structured log. With Compose, that output stays in the container’s log, so docker compose -f deploy/docker-compose.yml logs server shows it to anyone who can read Docker’s logs on the host until the container is removed. Save it to a private file:

Terminal window
umask 077
cat > ~/zentri-bootstrap-token # paste the zt_a_ token, press Enter, then Ctrl-D

From a file. Set ZENTRI_BOOTSTRAP_ADMIN_TOKEN_FILE to a file that holds one admin token, zt_a_ followed by 43 characters from 0-9, A-Z, and a-z. The coordinator then prints nothing. You can make one like this:

Terminal window
umask 077
printf 'zt_a_%s\n' "$(LC_ALL=C tr -dc '0-9A-Za-z' < /dev/urandom | head -c 43)" > ~/zentri-bootstrap-token

The Compose file does not pass this variable through. Add it, and a read-only mount of the file, in a Compose override file. This override is an example. The repository does not ship one.

deploy/docker-compose.override.yml
services:
server:
environment:
ZENTRI_BOOTSTRAP_ADMIN_TOKEN_FILE: /run/secrets/zentri-bootstrap-token
volumes:
- /home/you/zentri-bootstrap-token:/run/secrets/zentri-bootstrap-token:ro

Start with both files, -f deploy/docker-compose.yml -f deploy/docker-compose.override.yml. The container’s nonroot user must be able to read the file. Once an admin exists, the coordinator ignores the file and logs a warning.

Keep the token out of your shell history and your process list by putting it in a header file:

Terminal window
API=https://zentri.your-tailnet.ts.net
umask 077
printf 'Authorization: Bearer %s\n' "$(cat ~/zentri-bootstrap-token)" > admin.headers
id=$(curl -sS -H @admin.headers -d '{"handle":"alex","role":"admin"}' $API/v1/users | jq -r .id)
curl -sS -H @admin.headers -X POST $API/v1/users/$id/invites | jq -r .code > ~/alex.invite
zt login --server $API --invite - < ~/alex.invite

Then revoke the bootstrap token and delete the files:

Terminal window
bid=$(curl -sS -H @admin.headers $API/v1/tokens | jq -r '.tokens[] | select(.label == "bootstrap" and .revoked_at == null) | .id')
curl -sS -H @admin.headers -X POST $API/v1/tokens/$bid/revoke | jq -r .revoked_at
rm admin.headers ~/zentri-bootstrap-token ~/alex.invite

The admin user stays, with no working token. A restart does not make a new bootstrap token, because an admin exists.

Only an admin creates users and invites, over the HTTP API. For later admin calls, use your own user token. zt doctor says where it is on its config line: the OS keychain, under service zentri and account HANDLE@SERVER, or the config file. Read it into token with the command for that store, with acct set to the account zt doctor names, such as acct='you@https://zentri.example.com':

  • macOS Keychain. The entry holds the token base64-encoded after a go-keyring-base64: prefix. token=$(security find-generic-password -s zentri -a "$acct" -w | sed 's/^go-keyring-base64://' | base64 --decode)
  • Linux Secret Service. secret-tool comes with libsecret. token=$(secret-tool lookup service zentri username "$acct")
  • Windows Credential Manager. The token is the generic credential zentri:HANDLE@SERVER.
  • The config file. token=$(jq -r .token /path/to/zentri/config.json)

Then copy it into a header file only you can read:

Terminal window
umask 077
printf 'Authorization: Bearer %s\n' "$token" > admin.headers
unset token
id=$(curl -sS -H @admin.headers -d '{"handle":"ana","role":"engineer"}' $API/v1/users | jq -r .id)
curl -sS -H @admin.headers -X POST $API/v1/users/$id/invites | jq -r .code

Delete admin.headers when you finish.

Roles rank from lowest to highest. Each role can do what the roles below it can, and more:

Role Adds
viewer Read projects, sessions, claims, and intents
requester Ask for work, which is registered as queued, and answer questions, for example from Slack
engineer Start and run agent sessions
lead Create projects, change project rules, list users, and review high-risk decisions that someone else proposed
admin Create users, invites, and integration tokens, and revoke any token

A user may also get a skill_level of plain or technical. It sets how agents’ questions read for them. See roles and skill levels.

Send each invite code to its person over a private channel. It works once and expires after 15 minutes, so create it when the person is ready. They log in, paste the code, and press Enter:

Terminal window
zt login --server https://zentri.your-tailnet.ts.net --project web --invite -
zt doctor

The user token lasts 90 days. There is no renewal, so after that the person logs in again with a new invite. Anyone can revoke their own token with POST /v1/tokens/{token_id}/revoke. An admin can revoke any token in the org. The HTTP API reference lists every endpoint.

A lead or an admin creates each project, with a header file made as in step 4. Its name is lowercase letters, digits, and hyphens.

Terminal window
curl -sS -H @admin.headers -d '{"name":"web","edits_fail_open":false}' $API/v1/projects | jq -r .id
Setting Default Effect
edits_fail_open false When the coordinator cannot be reached, edits are refused after 8 seconds. Set true to let them go ahead. A lead changes it later with PATCH /v1/projects/{project_id}.
case_insensitive_paths false Folds path case before comparing claims, for repositories on case-insensitive filesystems. It is set only when the project is created.

Keep edits_fail_open off unless an outage would cost more than a collision. Each change is audited.

The local-dev launcher is not sandboxed. For a team, run agents with the openshell launcher. Each session then runs in an OpenShell sandbox with deny-by-default egress. Only zentri reaches the coordinator, only the agent and the commands it starts reach its vendor’s hosts, and only git reaches origin.

  1. Run an OpenShell v0.1.10 gateway and point the openshell CLI at it. On native Linux, keep the Docker driver’s default supervisor_network_mode = "host", so the sandbox reaches the coordinator on loopback.

  2. Build the image for your agent once:

    Terminal window
    make sandbox-image AGENT=claude-code # or codex, opencode
  3. Create an OpenShell provider that holds the engineer’s own credential, on the gateway. Name it in ZENTRI_OPENSHELL_PROVIDERS, comma-separated. The launcher passes --no-auto-providers, so no other provider is attached.

  4. Make openshell the default launcher, with ZENTRI_LAUNCHER=openshell or "launcher": "openshell" in the zt config, or pass --launcher openshell to zt start.

Terminal window
export ZENTRI_OPENSHELL_PROVIDERS=anthropic-alex
zt start --launcher openshell "ENG-101: add CSV export to the reports page"

zt doctor warns when openshell is missing or older than 0.1.10. Sandboxing explains the flow, and OpenShell policies the egress rules.

The merge check is the gate that git commit --no-verify cannot skip. An admin creates an integration token with the checks:read scope for it. Branch protection must require the check, or a failing verdict does not block a merge. The check reaches the coordinator over HTTPS, so its runner must be able to reach your tailnet address. See the GitHub check.

Back up the Postgres volume. It holds every user, token hash, intent, claim, decision, and the audit log. See backups and upgrades.

To check the audit log’s hash chain:

Terminal window
docker compose -f deploy/docker-compose.yml run --rm --no-deps server audit verify
  • Models for intent matching. The default matching runs offline. A local or OpenAI-compatible model catches some reworded duplicates. Keys and the data key are read from files, mounted the same way as the bootstrap token. See intents and dedup and calibrating dedup.
  • Slack. See the Slack bot.
  • Metrics and traces. /metrics needs an admin token or an integration token with metrics:read. Set OTEL_EXPORTER_OTLP_ENDPOINT to export traces. See observability.
  • No published release, package, or Helm chart. The install scripts are built and wait for the first release. The Helm chart in deploy/helm/zentri installs from a checkout and has run only on a local kind cluster. See Kubernetes.
  • The coordinator serves no TLS and trusts no forwarded headers. See step 2.
  • The sandbox flow has run only with a stub agent, on macOS with Docker Desktop and on GitHub’s ubuntu-latest. No real Claude Code, Codex, or OpenCode agent has run in a sandbox yet.
  • The sandbox flow has run only with the coordinator on the gateway host’s loopback. ADR-0004 recommends bridge networking and a coordinator on a separate host. That layout has not run.
  • ADR-0004 rules out the openshell launcher on Windows hosts in v0.1. A Windows engineer attaches to sandboxes on a Linux host over Tailscale SSH.
  • There is no user token renewal and no way to delete a user.
  • The merge check supports GitHub only.
  • Hardening lists more steps for an exposed host.