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.
What a team deployment looks like
Section titled “What a team deployment looks like” 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.
Before you start
Section titled “Before you start”- 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.
1. Configure the stack
Section titled “1. Configure the stack”Copy the example environment file and set strong passwords:
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:
docker compose -f deploy/docker-compose.yml up -d --buildThe 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.
2. Put TLS in front of the coordinator
Section titled “2. Put TLS in front of the coordinator”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 to127.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
ztthere, with--server http://127.0.0.1:8080.
Use Tailscale’s access controls to decide who can reach the coordinator’s HTTPS port.
3. Handle the first admin token
Section titled “3. Handle the first admin token”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.
Get the token
Section titled “Get the token”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:
umask 077cat > ~/zentri-bootstrap-token # paste the zt_a_ token, press Enter, then Ctrl-DFrom 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:
umask 077printf 'zt_a_%s\n' "$(LC_ALL=C tr -dc '0-9A-Za-z' < /dev/urandom | head -c 43)" > ~/zentri-bootstrap-tokenThe 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.
services: server: environment: ZENTRI_BOOTSTRAP_ADMIN_TOKEN_FILE: /run/secrets/zentri-bootstrap-token volumes: - /home/you/zentri-bootstrap-token:/run/secrets/zentri-bootstrap-token:roStart 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.
Replace it with your own admin
Section titled “Replace it with your own admin”Keep the token out of your shell history and your process list by putting it in a header file:
API=https://zentri.your-tailnet.ts.netumask 077printf '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.invitezt login --server $API --invite - < ~/alex.inviteThen revoke the bootstrap token and delete the files:
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_atrm admin.headers ~/zentri-bootstrap-token ~/alex.inviteThe admin user stays, with no working token. A restart does not make a new bootstrap token, because an admin exists.
4. Invite your team
Section titled “4. Invite your team”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-toolcomes 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:
umask 077printf 'Authorization: Bearer %s\n' "$token" > admin.headersunset 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 .codeDelete 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:
zt login --server https://zentri.your-tailnet.ts.net --project web --invite -zt doctorThe 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.
5. Set project rules
Section titled “5. Set project rules”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.
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.
6. Run agents in sandboxes
Section titled “6. Run agents in sandboxes”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.
-
Run an OpenShell v0.1.10 gateway and point the
openshellCLI at it. On native Linux, keep the Docker driver’s defaultsupervisor_network_mode = "host", so the sandbox reaches the coordinator on loopback. -
Build the image for your agent once:
Terminal window make sandbox-image AGENT=claude-code # or codex, opencode -
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. -
Make
openshellthe default launcher, withZENTRI_LAUNCHER=openshellor"launcher": "openshell"in theztconfig, or pass--launcher openshelltozt start.
export ZENTRI_OPENSHELL_PROVIDERS=anthropic-alexzt 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.
7. Turn on the merge check
Section titled “7. Turn on the merge check”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.
8. Back up and verify
Section titled “8. Back up and verify”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:
docker compose -f deploy/docker-compose.yml run --rm --no-deps server audit verifyOptional parts
Section titled “Optional parts”- 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.
/metricsneeds an admin token or an integration token withmetrics:read. SetOTEL_EXPORTER_OTLP_ENDPOINTto export traces. See observability.
Limitations
Section titled “Limitations”- No published release, package, or Helm chart. The install scripts are built and wait for the first release. The Helm chart in
deploy/helm/zentriinstalls 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
openshelllauncher 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.
Related pages
Section titled “Related pages”- Quickstart runs everything on one machine first.
- Why the coordinator is not sandboxed explains the trust boundary.
- Sandboxing covers the
openshelllauncher. - Roles and skill levels covers what each role may do.
- Tailscale covers the network.
- Troubleshooting helps when a step fails.
- Configuration and environment list every setting.