One Brain, One Console
If your deployments sometimes feel haunted — gateway/websocket weirdness, headless browser instability, “restart fixed it (for now)” — the fix is usually not a magical setting. It’s a standard: Clawdbot One Brain.
Quick links
- The standard (what “One Brain” means)
- The runbook (systemd + paths + ports)
- Browser automation stability (headless Chrome)
- Verification checklist
- Troubleshooting (FAQ deep dives)
How this helps
This is written for people who run Clawdbot in the real world (VPS + systemd, multiple boxes, upgrades, long-lived browser sessions). The goal is reliability:
- no “Clawdbot websocket disconnected” surprises
- no port collisions / ghost processes after restart
- no mystery state split between multiple users/homes
- stable browser automation (headless Chrome + persistent profile)
The standard (what “One Brain” means)
“One Brain” means: exactly one canonical place where your Clawdbot state lives, and exactly one canonical service identity that owns it.
- One service user runs the gateway/console (don’t mix root + another user).
- One HOME (so auth tokens, cookies, and tool caches don’t split).
- One DATA_DIR (so transcript/PM/worklogs are not duplicated).
- One set of ports (so restarts don’t leave orphan processes holding the old ports).
Most “random” reliability failures are deterministic side effects of split state. When you unify the brain, the incidents stop looking random.
The runbook (systemd + paths + ports)
Here’s the shape of a known-good layout. Adapt the exact paths/ports to your environment, but keep the intent: one user, one home, one data directory, and one place to restart.
1) Pick the service user (and stick to it)
If you already have a “working” install, the goal is to consolidate — not to create a parallel second install.
2) Make HOME + WorkingDirectory explicit in systemd
Don’t rely on defaults. Defaults change (and differ between manual runs vs services).
[Service]
User=master
Group=master
WorkingDirectory=/home/master/clawd
Environment=HOME=/home/master
# Example: console service (adjust as needed)
ExecStart=/usr/bin/node /home/master/clawd/apps/console/server.js
Restart=on-failure
RestartSec=2
3) Put persistent data in DATA_DIR
Your console should read/write append-only or durable data (PM board, transcript, worklog) in one directory that survives upgrades.
# Example
DATA_DIR=/home/master/clawd/apps/console-data
4) Port cleanup: eliminate collisions
A common failure mode is: you restart “the” service but an old process still holds the port. The symptom becomes 502s, websockets flapping, or browser control failing to connect.
# See what’s listening (example)
ss -lntp
# If needed, use systemd to restart the canonical service
# (avoid ad-hoc node runs that create a second brain)
systemctl restart clawdbot-gateway
systemctl restart clawdconsole
Browser automation stability (headless Chrome)
For operator-grade reliability, treat the browser as a long-lived dependency, not a disposable spawn. The two big levers:
- Use a real Chrome build (deb install) when possible (fewer sandbox/snap oddities).
- Use a persistent user-data-dir so logins/cookies survive restarts (this is “persistent session”).
Known-good pattern: remote-debugging + persistent profile
Start Chrome with a stable debugging port and a stable profile directory. Then verify it’s reachable via the DevTools endpoint.
# Example (adjust paths)
google-chrome \
--headless=new \
--remote-debugging-address=127.0.0.1 \
--remote-debugging-port=18800 \
--user-data-dir=/home/master/clawd/apps/console-data/chrome-profile
Quick verification: /json/version
curl -s http://127.0.0.1:18800/json/version
Verification checklist (10 minutes)
- One user: confirm the gateway/console processes run as the same OS user.
- One HOME: confirm systemd sets HOME explicitly (and it matches where your auth profiles live).
- DATA_DIR exists: confirm your durable data writes to one directory you can back up.
- Ports: confirm the expected ports are listening, and only one process owns each.
- Websocket sanity: confirm the gateway/console connection is stable (no constant reconnect loop).
- Browser control: confirm Chrome DevTools endpoint returns /json/version and the automation client can connect.
Troubleshooting (FAQ deep dives)
If you’re already firefighting, these pages are designed to be symptom-first:
- Clawdbot gateway
- Clawdbot websocket disconnected
- Clawdbot headless Chrome
- Clawdbot persistent session
- Clawdbot debugging (remote debugging / CDP)
- Clawdbot troubleshooting (overview)
Next steps
- Start from the top: Clawdbot User Guide
- If you want managed deployments: Managed Clawdbot Hosting
- Back to the index: Clawdbot News & Articles
Get Early Access!
Hosted Clawdbot + ClawdConsole workspaces are coming very, very soon.
Join the waitlist and we’ll spin up your workspace the moment access opens.
- Same operator cockpit you’re seeing here
- Private hosted workspace
- We’ll email you your link when it’s ready