clawops

Operations

Running a deployment after it exists, health, logs, upgrades, backups.

Everything here works the same on every provider. Commands take --stack when you have more than one; the default stack comes from ~/.clawops/config.json.

Is it up

clawops status                 # outputs, region, provisioned time
clawops doctor --stack prod    # local prerequisites plus remote health
clawops monitor                # resource and container dashboard

doctor --stack probes the gateway's /startupz endpoint and reads the body, rather than trusting the container to be running. A running container means the process started, not that it serves. It also reports which OpenClaw version the gateway is actually running, which can differ from the requested version when the stack was created with a moving tag, and it exits non-zero when any check fails. On a host with Tailscale it reports whether the host is on its tailnet and warns two weeks before its node key expires, since an expired key takes the host off the tailnet. On a stack clawops reaches over its tailnet, those are failures.

Logs

clawops logs                   # recent gateway logs
clawops logs --follow          # tail
clawops agents logs <name>     # one agent

Logs come from the gateway itself where it can serve them, and from docker logs otherwise. clawops tells you which source it used.

Reaching the gateway

The gateway publishes on 127.0.0.1 and is not exposed to your network. Forward it:

clawops tunnel                 # Control UI on http://127.0.0.1:18789
clawops ssh                    # a shell on the host

Exposing it instead is an explicit choice at plan time, --publish-gateway all with --gateway-cidr. It serves plaintext HTTP, so put TLS in front of it.

Upgrading OpenClaw

Two paths, depending on whether the machine changes.

Gateway only, new OpenClaw version, same instance:

clawops backup create
clawops gateway update 2026.9.3
clawops doctor --stack prod

Through plan → apply, when infrastructure changes too:

clawops plan --stack prod --openclaw-version 2026.9.2 --out plan.json
# read the diff, then
clawops apply plan.json

Before either, check the version is in the supported range and take a backup. Rolling back the gateway is the same command pointed at the previous version; rolling back infrastructure means applying the previous plan, so the previous plan has to still exist.

These commands restart the container

gateway restart, gateway update and config set all restart the container. State survives . It lives in a host directory bind-mounted into it, but in-flight work does not.

Backups

clawops backup create --out <file>.tar.gz
clawops backup restore --file <file>.tar.gz              # verify and expand beside the current state
clawops backup restore --file <file>.tar.gz --activate   # ...then swap it in, rolling back on failure

Without --activate, a restore touches nothing live. With it, clawops moves the current state aside (it is kept, never deleted), swaps the restored state in, restarts the gateway on it, and puts the old state back if the gateway does not answer.

A backup covers the OpenClaw state directory: config, the SQLite database, sessions, transcripts and installed plugins. It does not cover your cloud infrastructure. That is what the state backend and your plans are for, and it does not include secrets held outside the state directory.

Automating it is a cron job calling clawops backup create and copying the archive somewhere off-host. There is a worked example, including upload to S3 and a disaster-recovery checklist, in docs/backup-restore.md.

Agents and config

clawops agents list
clawops config get <key>
clawops config set <key> <value> --dry-run   # see the diff first

Config changes are validated against OpenClaw's own schema before they are written, so a bad value is refused rather than restarting the gateway into a broken state.

Host agent

New in 2.4. clawops on the gateway host, serving one OpenClaw agent that only you can reach. It reads everything about its own host and changes nothing: a destructive request comes back to you as the clawops command to run.

docker exec openclaw openclaw agents add ops        # on the host: a dedicated agent
clawops agent install --stack prod --agent ops --operator telegram:12345 \
  --allow clawops_gateway_restart
clawops status --stack prod                         # shows what the agent asked you to run
clawops agent uninstall --stack prod

Install refuses, before writing anything, unless the gateway's routing lets only you reach that agent. The agent must not be the default, must be bound only to your direct messages, and must not be reachable from other agents. It denies clawops to every other agent, and the host agent re-checks all of it on every call. Other agents can still run commands inside the gateway container on a default deployment; install names them, and --strict refuses while any remain.

A request shows in clawops status until you run that command, or for 7 days.

Fleet

New in 2.5. Host agents on several stacks can read each other over your tailnet, so the agent on one gateway can answer questions about the others. Each host is still read-only to its peers, and every change still comes back to you as a command.

# Each host is on your tailnet, joined with an auth key that carries the tag
clawops agent install --stack eu --agent ops --operator telegram:12345 --strict \
  --serve-peers tag:clawops-agent
clawops agent install --stack us --agent ops --operator telegram:12345 --strict \
  --serve-peers tag:clawops-agent --peer eu=eu-gw

clawops fleet status            # every host agent, its peers, and what stops a peer working
  • --serve-peers <tag> makes the host agent answer other host agents on port 18800, on its tailnet address. It needs no token: on every request it asks tailscaled who is calling, and answers only a node that carries the tag and is not this host. Peers get the 12 read tools, about this host only, and nothing destructive.
  • --peer <stack>=<tailnet name> lets this host agent ask that peer. A read naming the stack goes to the peer, and the answer says which host gave it. A change naming the peer is refused, with the command for you to run. It needs --strict: while any other agent could act in this gateway's container, peer queries are refused.
  • The firewall table. On every fleet member, install loads an nftables table that lets only a dedicated clawops-peer user reach peers. The gateway container, other containers and root can't, before or after a reboot. While the table is missing, peer queries are refused. The host agent checks it every 30 s and puts it back if anything removes or changes it, with an audit entry for each repair, and clawops doctor fails while it isn't the one install loaded.
  • clawops fleet status reads every stack's host over SSH and reports each host agent, its peers, the firewall table and the tailnet. It flags a peer that can't work, on the host that names it. From inside a gateway, clawops_stacks_list with fleet: true gives the same view.

Tailnet policy

clawops never edits your tailnet's policy. The fleet is designed for this one, with your login in place of you@example.com:

{
  "tagOwners": { "tag:clawops-agent": ["you@example.com"] },
  "acls": [
    { "action": "accept", "src": ["tag:clawops-agent"], "dst": ["tag:clawops-agent:18800"] },
    { "action": "accept", "src": ["you@example.com"], "dst": ["tag:clawops-agent:22"] }
  ]
}

Only you should own the tag, since anyone in tagOwners can make a node a peer. Join hosts with a tagged auth key rather than --advertise-tags. Untag or delete a host's node to take it out of the fleet: its next request is refused. The second rule keeps your own SSH to the hosts.

On the default allow-all policy the tag check is the only barrier. It holds, but clawops doctor warns about it, and the policy above adds a second one.

Hardening

clawops harden                 # ssh, ufw, fail2ban, unattended-upgrades, and more
clawops harden --dry-run

Eight modules run on every provider; AWS adds a security-group audit, SSM readiness, VPC flow logs and GuardDuty. harden reads the container's actual port bindings and opens only what the deployment really publishes. On a stack with a host agent, it keeps the agent's firewall rule when it resets ufw.

Tearing it down

clawops destroy --stack prod   # irreversible

Destroy also forgets the instance's host key, so deploying onto an address the cloud later recycles does not fail verification.

Full operations guide →

On this page