Deployment
This guide covers deploying OpenClaw on your own infrastructure, running it as a system daemon, and planning for growth.
Recommended Topology
The simplest production deployment is a single server running the OpenClaw Gateway with all agents:
Your Server (Ubuntu / Linux)
├── OpenClaw Gateway (:18789)
│ ├── coordinator agent
│ ├── dev-agent (Docker sandboxed)
│ ├── product-agent
│ └── risk-agent
├── Tailscale / SSH tunnel → remote access
├── Database (read-only replica) → for agent queries
└── systemd service → auto-restart, logging
Installation
Install OpenClaw as a systemd daemon:
openclaw onboard --install-daemon
This sets up:
- Auto-restart on failure
- System logging via journald
- Automatic startup on boot
Starting the Gateway
openclaw gateway --port 18789
Or, if installed as a daemon:
systemctl start openclaw
systemctl status openclaw
Remote Access
If your server is in a local datacenter or behind a firewall, use Tailscale Serve or an SSH tunnel with token auth for remote access.
Tailscale provides zero-config VPN access with built-in auth. It's the simplest way to securely access your OpenClaw gateway from anywhere.
Health Checks
# Full system health check
openclaw doctor
# Check all channel connections
openclaw channels status --probe
# Verify agent routing
openclaw agents list --bindings
Scaling Considerations
When to Stay on a Single Server
A single server handles most use cases well:
- Up to 5–10 agents
- Moderate message volume
- Team of 10–50 users
When to Consider Scaling
- Token costs exceeding your budget on the current setup
- Uptime requirements beyond what a single server provides
- Need for geographic distribution
Scaling Options
- Dedicated VPS — Some cloud providers offer one-click OpenClaw deploys for straightforward scaling
- Load-balanced gateways — Multiple gateway instances behind a load balancer (advanced)
- Separate gateways per team — If teams are fully independent, separate installations may be simpler
Hardware Recommendations
Dedicated machine required. OpenClaw has full filesystem access and can execute arbitrary commands. Never install it on a machine with sensitive data or active personal use.
- Mac Mini (M4, 16GB, 256GB) — Quiet, low-power, reliable. Good for home/office setups.
- VPS — DigitalOcean, Railway, Render, or Google Cloud. Best for teams that need uptime without managing hardware.
- Old laptop — Fine for experimentation. Keep it plugged in and connected to the network.
For physical hardware without a monitor: enable Screen Sharing and Remote Login in macOS System Settings, then SSH in from your main machine.
Cost Considerations
Token costs depend on model choices, heartbeat frequency, and message volume.
- 1–2 agents on Sonnet — ~$100–200/month via API
- 5–10 agents (mixed Opus + Sonnet) — ~$500–1000/month via API
- Subscription-based — Using an existing Claude or ChatGPT subscription is cheapest (~$20/month) but check the provider's terms of service for automated usage
Cost levers:
- Model-per-agent — Use Opus only for agents that need complex reasoning (coordinator, risk). Use Sonnet for everything else.
- Sub-agents on cheaper models — The coordinator does synthesis; sub-agents do data gathering on Sonnet.
- Heartbeat frequency — Fewer checks means fewer tokens. Most agents don't need checks more frequent than every 30 minutes.
- lightContext flag — Set
lightContext: trueon heartbeat tasks that don't need full conversation history.
Troubleshooting
Agent not responding:
openclaw doctor— Check gateway healthopenclaw channels status --probe— Verify channel connectionsopenclaw agents list --bindings— Confirm the agent is bound to the right channel
Agent forgetting tasks:
- Check that the session memory hook is enabled
- Ask the agent to inspect its own crons and HEARTBEAT.md
- Review
MEMORY.mdfor unexpected or missing entries
Agent executing wrong actions:
- Review
TOOLS.mdfor incorrect tool references - Check
SOUL.mdboundaries — they may need to be more explicit - Run
openclaw security auditto check for permission gaps
Broken scheduling:
- Ask the agent to inspect and list its cron definitions
- Verify
HEARTBEAT.mdhas the correct format and intervals - Check that the heartbeat interval in
openclaw.jsonis set (default: 30 minutes)
Recovery from severe breakage: OpenClaw workspaces are just markdown files and JSON configs. You can debug them manually or use Claude Code to diagnose issues by pasting the workspace contents.
Phased Rollout
Start with one agent, add incrementally. Coordination complexity is the primary challenge in multi-agent deployments.
Phase 1: Foundation (Weeks 1–2)
- Install OpenClaw on your server
- Set up a single coordinator agent
- Connect to one messaging platform
- Write
SOUL.md,AGENTS.md,USER.md - Build a simple periodic workflow with
HEARTBEAT.md - Validate memory, sessions, and heartbeat behavior
Phase 2: Second Agent (Weeks 3–4)
- Add a specialist agent (e.g., engineering)
- Create its workspace with role-specific persona files
- Bind to the appropriate channel
- Enable Docker sandbox for code-executing agents
- Test workflows specific to that role
Phase 3: Full Team (Weeks 5–6)
- Add remaining specialist agents
- Create their workspaces and channel bindings
- Build custom skills (SQL runner, documentation writer, etc.)
- Test cross-agent data sharing via files
Phase 4: Orchestration (Weeks 7–8)
- Enable
sessions_spawnfor the coordinator agent - Build sub-agent workflows (weekly brief, analysis, monitoring)
- Set up cron jobs for automated reports
- Add additional agents if the team is ready
Phase 5: Ongoing Optimization
- Monitor token costs per agent
- Tune
HEARTBEAT.mdintervals - Iterate on workspace files based on real usage
- Expand skills from the ClawHub registry as needed