clawfirm-box is the self-hosted mini-box runtime with HTTPS hosting and Nameservers.
It is designed for a box owner and their AI agent to interact with the box directly.
- a fresh
dropletorec2 instancewith an<ip>with ssh access from your AI agent. - a fresh domain
<domain>with apex (ns1 and ns2) set to the ip and nameservers set tons1/ns2.<domain>. Namecheap requires you to register this new clawbox's<ip>underPersonal DNS Server. clawfirm-clitool
Install clawfirm-cli tool with "curl -fsSL https://clawfirm.ai/install.sh" and run "clawfirm --help"Send the following prompt (important! use your ip and domain!) to your AI agent (e.g., OpenClaw, Codex, Claude Code) to setup a new all-in-one clawfirm-box:
Help me set up a new self-hosted Clawfirm box for <domain> using clawfirm-cli over SSH.
Assume SSH key access already works as root on the DigitalOcean droplet at <ip>.
The domain is <domain>, and its nameservers are already set to ns1.<domain> and ns2.<domain>.
Use the default public clawfirm-box setup flow on a fresh Ubuntu droplet.
Verify SSH, bootstrap the box, verify the box API, verify DNS delegation/authority for <domain>.
Fix any setup issues you find, and leave it ready to publish via clawfirm-cli.
Deploy an index.html with h1 text "Hello World!" at https://<domain>
Do not stop at partial setup, continue until it is ready or you have a concrete blocker with evidence.Check if your domain was configured successfully at https://<domain>
- the box daemon HTTP API
- static release publish, rollback, and listing logic
- domain reconcile helpers for Caddy and local site state
- local DNS helper scripts for bind9-backed box setups
- bootstrap and deployment scripts for a single-box install
- tests and TLA+ specs for the runtime contract
One machine can run:
- the Clawfirm box daemon
- Caddy
- local release storage under
/srv/clawfirm-box/sites - local DNS helper commands
- optional bind9 for authoritative DNS on the same machine
That gives the owner a direct box-native API that clawfirm-cli or another agent client can talk to.
src/runtime server and domain/release logicscripts/bootstrap, deploy, DNS, and smoke helperssystemd/starter unit filesenv/box-oriented env templatesdocs/public docs for setup and API shapetest/handler and runtime testsspec/TLA+ models
- Ubuntu 24.04 VPS
- root access or a sudo-capable user
- at least one public IPv4 address for the box
- a domain you control if you want public HTTPS and DNS on the box
- ability to change registrar DNS settings for that domain
- ports
80and443open, plus53/tcpand53/udpif this box will run authoritative DNS - enough disk for release history under
/srv/clawfirm-box/sites
Have these values ready before setup:
BOX_PUBLIC_IP, the public IPv4 that will serve the sites and daemonBOX_DOMAIN, the main domain you want the box to manage, for exampleexample.com
The box can derive these conventions from BOX_DOMAIN:
- daemon hostname:
box.<domain> - nameservers:
ns1.<domain>andns2.<domain>
Registrar / DNS requirements:
- set registrar host/glue records for
ns1.<domain>andns2.<domain>to the box IP when the box will be authoritative - set the domain nameservers at the registrar to
ns1.<domain>andns2.<domain> - for normal apex hosting,
@ -> <BOX_PUBLIC_IP>should exist - for the default web alias,
www -> @orwww -> <BOX_DOMAIN>should exist unless you intentionally want apex-only behavior
Recommended prep:
apt update && apt upgrade -y
apt install -y curl git ca-certificatesIf this box will run the full stack locally:
apt install -y nodejs npm caddy bind9 bind9-utilsnpm install
cp .env.example .env
npm startHealth check:
curl http://127.0.0.1:8787/healthCanonical bring-up guide:
docs/fresh-box-bring-up.md
This is the recommended path when starting from a fresh VPS and wanting to:
- bootstrap once over SSH
- expose the daemon at
https://box.<domain> - switch to routine REST-only operation through
clawfirm-clior direct API calls
Render a box env scaffold:
CLAWFIRM_BOX_PUBLIC_IP=203.0.113.10 \
CLAWFIRM_BOX_DOMAIN=example.com \
CLAWFIRM_BOX_HOSTNAME=box.example.com \
CLAWFIRM_BOX_TOKEN=replace-me \
./scripts/render-box-env.shOr do a one-command bootstrap directly on the fresh box:
CLAWFIRM_BOX_PUBLIC_IP=203.0.113.10 \
CLAWFIRM_BOX_DOMAIN=example.com \
CLAWFIRM_BOX_TOKEN=replace-me \
./scripts/bootstrap-fresh-box.shWhen CLAWFIRM_BOX_INSTALL_BIND=1 is enabled, this helper now also:
- seeds the initial authoritative zone for
<domain> - creates
Arecords for@,box,ns1, andns2 - creates the default
www -> <domain>alias - installs a clean snippet-only Caddyfile import so later reconcile calls do not double-load site configs
Stage bootstrap assets:
./scripts/bootstrap.shInstall local DNS helper wrappers for a bind9-backed box:
sudo ./scripts/install-bind-backend.shAfter bootstrap, normal publish / reconcile / release operations should go through the box daemon HTTP API rather than SSH.
Typical clawfirm-cli shapes after bootstrap:
clawfirm mini box.example.com doctor api --json
clawfirm mini box.example.com status --json
clawfirm mini box.example.com reconcile example.com --json
clawfirm mini box.example.com publish ./site --domain example.com
clawfirm mini box.example.com releases list example.comSee also:
docs/fresh-box-bring-up.mddocs/box-api-contract.mdscripts/e2e-box-smoke.shscripts/bootstrap-fresh-box.sh
Important endpoints:
GET /healthPOST /publishPOST /releasesPOST /rollbackPOST /delete-releasePOST /domains/reconcilePOST /dns/get-zonePOST /dns/ensure-zonePOST /dns/apply-records
See docs/box-daemon-api.md for the current contract.
For the narrower client-facing contract between clawfirm-cli and the box daemon, see docs/box-api-contract.md.
npm testHandler-only tests:
npm run test:handlersTLA+ checks:
npm run test:tlaThis repo is the public starting point for the mini-box path. It already contains working runtime code and bootstrap scaffolding, but it is still being polished into a smoother owner-facing install story.