Install a node
A node is one Compose project running the agent-ops scheduler and supporting services in containers. This page covers the container installation path only.
Prerequisites
Section titled “Prerequisites”- Docker and Docker Compose installed
- A classic GitHub personal access token (
GH_TOKEN) withrepo,workflowandread:orgscopes - Claude model credentials (API key or subscription)
- A Tailscale authkey (optional, for dashboard access over your tailnet)
See docs/DATA-HANDLING.md to understand what data the pipeline reads, stores, and retains.
GitHub authentication
Section titled “GitHub authentication”The pipeline authenticates with GitHub in two ways:
Primary: A personal access token (GH_TOKEN) set in .env. Make it a classic token: a fine-grained one reaches a single account, and a fleet whose repositories span more than one owner needs a token that reaches them all. Required scopes:
repo— to read and write to the repositories the pipeline works on. Fullreporather thanpublic_repo, because a state repository is private; on a classic token it also carries the Dependabot and code-scanning alert readsworkflow— separate fromrepoand not implied by it: this is what lets a cycle’s pull request touch.github/workflows/read:org— wanted byghitself rather than by any call the pipeline makes, and only once the token is classic.gh’s minimum-scope check skips an emptyX-Oauth-Scopesheader (what a fine-grained token sends) but enforcesrepoplus one ofread:org/write:org/admin:orgon a classic one, so without itgh auth statusand everyscripts/doctor.shGitHub check fail on a token that is in fact working
Optionally: Forge authoring App (D18 decision 1). If your installation provisions a GitHub App for short-lived tokens, set PULLWRIGHT_AUTHOR_APP_ID and PULLWRIGHT_AUTHOR_INSTALLATION_ID (or, for a fleet spanning more than one owner, PULLWRIGHT_AUTHOR_INSTALLATION_IDS, a JSON map of owner to installation id) in .env, and point PULLWRIGHT_AUTHOR_PRIVATE_KEY_PATH at the App’s .pem private key on the host — Compose bind-mounts it read-only into the container at that same path, so the key’s contents never go in .env. The App mints tokens automatically, letting you rotate the key or remove the App without restarting nodes. Omit these and nodes authenticate with GH_TOKEN alone, which is the simpler path.
Test token access:
# From the hostexport GH_TOKEN=<your-token>gh repo list --limit 1
# From inside the container (after bringing it up)docker compose exec scheduler gh repo list --limit 1Model authentication
Section titled “Model authentication”The scheduler runs Claude over text from GitHub, so every node needs model credentials. Two paths, and a node may hold both at once — the credit mix (config.json’s providers.anthropic.lanes, docs/reference/configuration.md) draws between them by weight on every launch rather than treating one as a fallback for the other; a node configuring only one of the two runs on it exactly as described below, unaffected by that option’s existence. The mix can also be moved live, across the whole fleet, with agent-cycle.sh --mix <provider> <lane>=<weight>... — no image roll or container recreate needed — which outranks config.json’s own weights for the keys it names; agent-cycle.sh --status reports which side, config or the live lever, is governing each lane right now.
Primary: BYO API key
- Get an Anthropic API key from console.anthropic.com, scoped at creation to a single workspace (the Create-key dialog offers this as an optional choice) — Anthropic’s own guidance for a shared or automated workload like this one is a service-account key scoped to one workspace
- Set
ANTHROPIC_API_KEY=<key>in.env docker compose up -d— the key is picked up at container start
This scales to any number of nodes sharing the same key. A key created without the single-workspace scope — a personal key, or a service-account key created for several workspaces — is refused on every request with a 400 unless .env’s ANTHROPIC_WORKSPACE_ID also names the workspace to bill (its own wrkspc_… id, from the Console’s Settings → Workspaces).
Alternative: Subscription OAuth
docker compose up -dto start the nodedocker compose exec scheduler claudeto authenticate interactively- Complete the login flow in your browser
- The node’s Claude session is saved to its
~/.claudevolume
This path is interactive per node (no script), and the subscription’s terms limit it to your own use, not a service for others. Until one of these is configured, every cycle fails at its first stage; once either is configured and then starts being refused — the key revoked, rescoped away, or the login lapsed — the Script’s own credential preflight (requirement 2.0h) catches it before the next GitHub gather and files an issue, rather than crash-looping the fleet until a human happens to read the log by hand.
Install a container node
Section titled “Install a container node”-
Create a node directory and download the stack:
Terminal window mkdir -p ~/poetic-nodecd ~/poetic-nodebase=https://raw.githubusercontent.com/Pullwright/agent-ops/main/deploy/dockercurl -fsSLO "$base/compose.yaml"curl -fsSLO "$base/ts-serve.json"curl -fsSL "$base/.env.example" -o .envcurl -fsSLO "https://raw.githubusercontent.com/Pullwright/agent-ops/main/scripts/watch-node.sh"chmod +x watch-node.sh -
Edit
.envto name the node and set credentials:Terminal window $EDITOR .envRequired:
NODE_NAME=<your-node-name>— a short identifier (alphanumeric, no spaces)GH_TOKEN=<token>— GitHub PAT from aboveANTHROPIC_API_KEY=<key>(primary), subscription OAuth (step 4), or both — see “Model authentication” above for running both at once
Optional (for dashboard over your tailnet):
COMPOSE_PROFILES=tailnetTS_AUTHKEY=<key>— Tailscale authkey; see Tailscale
Optional (for preview deployment checking):
VERCEL_AUTOMATION_BYPASS_SECRET— from Vercel project settingsVERCEL_TOKEN— optional, for build logs on failed deployments
-
Start the container:
Terminal window docker compose up -d -
If using subscription OAuth, log in to Claude:
Terminal window docker compose exec scheduler claude# Follow the interactive login flow -
Run the first health check:
Terminal window docker compose exec scheduler /app/scripts/doctor.shThis verifies your configuration, GitHub access, and model credentials. All three Egress checks should show
[ ok ]. -
Run a dry run to see the pipelines in action:
Terminal window docker compose exec scheduler /app/agent-cycle.sh --dry-runThis selects work without launching agents — a good first check that everything is wired up.
The Compose stack
Section titled “The Compose stack”The image carries the whole toolchain (/app is agent-ops itself). A node updates by pulling a new image, never by pulling a branch inside a running container. Each merge to main that touches files the container reads publishes a new image to ghcr.io/pullwright/agent-ops as latest and as the commit SHA.
To pin a node to a known-good build or roll back, set in .env:
AGENT_OPS_IMAGE=ghcr.io/pullwright/agent-ops:<sha>Check the package registry for available SHAs. A documentation-only merge publishes no image.
Five things are worth knowing:
-
~/.claudeis a volume. Claude’s OAuth credentials refresh and write back. The entrypoint seedssettings.jsononly when absent, never group-writable; asettings.jsonleft over from before this, hand-edited to be group-writable, or replaced by a symbolic link, is moved aside to a.quarantined-<timestamp>sibling and reseeded on the next start. -
state_diris a volume. The pipelines’ memory lives here and is shared between nodes via the state repository (see Keeping every node warm). -
state_dirmust be writable by the container user (uid 1000 by default). The entrypoint refuses to start if it is not. To match a different host uid, rebuild withdocker build --build-arg PUID=<uid> deploy/docker. -
The dashboard is never reachable from a network. The
tailnetprofile puts it in the Tailscale sidecar’s namespace; thelocalprofile publishes it only to the host’s loopback (127.0.0.1:${DASHBOARD_PORT:-8787}). If port 8787 is taken, setDASHBOARD_PORTin.envto move the host side of the mapping. -
Profiles in
COMPOSE_PROFILESdecide what runs alongside the scheduler:Profile What it adds tailnetTailscale sidecar + dashboard, served over HTTPS to your tailnet at https://<node>.<tailnet>localDashboard on loopback only ( http://127.0.0.1:8787)node-healthHTTP health endpoints ( /livez,/readyz,/healthz,/metrics) on loopback at port 8788 for monitoringauto-updateWatchtower, which pulls new images and restarts into them The scheduler is in no profile: it runs on every node.
The egress fence
Section titled “The egress fence”The scheduler reaches the internet only through the egress-proxy service’s domain allowlist (deploy/docker/egress-allowlist.txt). This is topology, not convention: the scheduler sits on an internal Docker network with no gateway, and the proxy is the only way out. It permits HTTPS only to the domains the pipelines actually use:
- GitHub (
github.com,raw.githubusercontent.com,ghcr.io) - Anthropic API
- Vercel previews (if configured)
- npm registry (for build-time dependencies)
- Docker image registry
Everything else is refused, including Claude Code’s optional traffic (updates, telemetry, error reporting), which the scheduler’s environment turns off at the source.
For a node needing an extra domain
Section titled “For a node needing an extra domain”If you’re running a Vercel project serving previews from a custom domain:
echo "EGRESS_EXTRA_ALLOW=preview.example.com" >> .envdocker compose up -d egress-proxyComma- or whitespace-separated for multiple domains. Fleet-wide additions belong in deploy/docker/egress-allowlist.txt instead, where each entry names the code that needs it.
Troubleshooting the fence
Section titled “Troubleshooting the fence”If everything times out after enabling the fence:
-
Check the MTU. An MTU black hole through the proxy looks exactly like a refused domain. See the MTU note in
compose.yaml. -
Run doctor.sh. The Egress section names three failure shapes:
- Proxy path broken
- Allowlist not enforcing
- Direct egress still open (this node’s compose.yaml predates the fence)
Terminal window docker compose exec scheduler /app/scripts/doctor.sh -
Check the domain is in the allowlist. Open
deploy/docker/egress-allowlist.txtor setEGRESS_EXTRA_ALLOW(above).
There is deliberately no off-switch variable: unfencing a node is an explicit edit to its compose.yaml, made knowingly or not at all.
Node roles: active and standby
Section titled “Node roles: active and standby”Set ROLE=active in .env for nodes meant to run cycles unattended; the rest stay standby. Any number of nodes may be active at once — per-item claims keep them off each other’s work. A standby node still publishes its heartbeat and follows every peer’s memory, so promoting one is one variable change away.
For more on how this works, see Which node runs the cycles.
Next steps
Section titled “Next steps”After installation:
- See Configure to set up repositories and work sources
- See Run and pause to operate the pipelines
- See Watch to monitor your nodes
- See the node runbook (
deploy/docker/README.md) for the detail behind bring-up, everyday commands, and the failover drill