Skip to content

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.

  • Docker and Docker Compose installed
  • A classic GitHub personal access token (GH_TOKEN) with repo, workflow and read:org scopes
  • 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.

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. Full repo rather than public_repo, because a state repository is private; on a classic token it also carries the Dependabot and code-scanning alert reads
  • workflow — separate from repo and not implied by it: this is what lets a cycle’s pull request touch .github/workflows/
  • read:org — wanted by gh itself rather than by any call the pipeline makes, and only once the token is classic. gh’s minimum-scope check skips an empty X-Oauth-Scopes header (what a fine-grained token sends) but enforces repo plus one of read:org/write:org/admin:org on a classic one, so without it gh auth status and every scripts/doctor.sh GitHub 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:

Terminal window
# From the host
export 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 1

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

  1. 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
  2. Set ANTHROPIC_API_KEY=<key> in .env
  3. 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

  1. docker compose up -d to start the node
  2. docker compose exec scheduler claude to authenticate interactively
  3. Complete the login flow in your browser
  4. The node’s Claude session is saved to its ~/.claude volume

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.

  1. Create a node directory and download the stack:

    Terminal window
    mkdir -p ~/poetic-node
    cd ~/poetic-node
    base=https://raw.githubusercontent.com/Pullwright/agent-ops/main/deploy/docker
    curl -fsSLO "$base/compose.yaml"
    curl -fsSLO "$base/ts-serve.json"
    curl -fsSL "$base/.env.example" -o .env
    curl -fsSLO "https://raw.githubusercontent.com/Pullwright/agent-ops/main/scripts/watch-node.sh"
    chmod +x watch-node.sh
  2. Edit .env to name the node and set credentials:

    Terminal window
    $EDITOR .env

    Required:

    • NODE_NAME=<your-node-name> — a short identifier (alphanumeric, no spaces)
    • GH_TOKEN=<token> — GitHub PAT from above
    • ANTHROPIC_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=tailnet
    • TS_AUTHKEY=<key> — Tailscale authkey; see Tailscale

    Optional (for preview deployment checking):

    • VERCEL_AUTOMATION_BYPASS_SECRET — from Vercel project settings
    • VERCEL_TOKEN — optional, for build logs on failed deployments
  3. Start the container:

    Terminal window
    docker compose up -d
  4. If using subscription OAuth, log in to Claude:

    Terminal window
    docker compose exec scheduler claude
    # Follow the interactive login flow
  5. Run the first health check:

    Terminal window
    docker compose exec scheduler /app/scripts/doctor.sh

    This verifies your configuration, GitHub access, and model credentials. All three Egress checks should show [ ok ].

  6. Run a dry run to see the pipelines in action:

    Terminal window
    docker compose exec scheduler /app/agent-cycle.sh --dry-run

    This selects work without launching agents — a good first check that everything is wired up.

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:

Terminal window
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:

  • ~/.claude is a volume. Claude’s OAuth credentials refresh and write back. The entrypoint seeds settings.json only when absent, never group-writable; a settings.json left 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_dir is a volume. The pipelines’ memory lives here and is shared between nodes via the state repository (see Keeping every node warm).

  • state_dir must 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 with docker build --build-arg PUID=<uid> deploy/docker.

  • The dashboard is never reachable from a network. The tailnet profile puts it in the Tailscale sidecar’s namespace; the local profile publishes it only to the host’s loopback (127.0.0.1:${DASHBOARD_PORT:-8787}). If port 8787 is taken, set DASHBOARD_PORT in .env to move the host side of the mapping.

  • Profiles in COMPOSE_PROFILES decide what runs alongside the scheduler:

    Profile What it adds
    tailnet Tailscale sidecar + dashboard, served over HTTPS to your tailnet at https://<node>.<tailnet>
    local Dashboard on loopback only (http://127.0.0.1:8787)
    node-health HTTP health endpoints (/livez, /readyz, /healthz, /metrics) on loopback at port 8788 for monitoring
    auto-update Watchtower, which pulls new images and restarts into them

    The scheduler is in no profile: it runs on every node.

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.

If you’re running a Vercel project serving previews from a custom domain:

Terminal window
echo "EGRESS_EXTRA_ALLOW=preview.example.com" >> .env
docker compose up -d egress-proxy

Comma- 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.

If everything times out after enabling the fence:

  1. Check the MTU. An MTU black hole through the proxy looks exactly like a refused domain. See the MTU note in compose.yaml.

  2. 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
  3. Check the domain is in the allowlist. Open deploy/docker/egress-allowlist.txt or set EGRESS_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.

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.

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