Deployment Guide
This guide covers deploying OpenClaw gateway to production environments, from local development to cloud-hosted infrastructure.Overview
OpenClaw gateway can be deployed in several modes:- Local machine — Your laptop/desktop (Mac, Linux, WSL2)
- VPS/Bare metal — Dedicated servers (Hetzner, DigitalOcean, OVH)
- Cloud platforms — Managed services (Fly.io, Railway, Render, GCP)
- Container orchestration — Docker, Docker Compose, Kubernetes
System Requirements
Minimum Specifications
- CPU: 1 core (2+ cores recommended for multiple agents)
- RAM: 512 MB minimum, 1-2 GB recommended
- Storage: 1 GB minimum, 5+ GB recommended for workspace and logs
- Network: Stable internet connection, persistent IP recommended
Runtime Requirements
- Node.js: 22+ (LTS recommended)
- Optional: Docker for containerized deployments
- Optional: Tailscale for secure remote access
Pre-Deployment Checklist
Before deploying to production:Deployment Options
Local Development
Ideal for:- Personal use
- Development and testing
- Single-user scenarios
VPS Deployment
Ideal for:- Always-on personal assistant
- Remote access from multiple devices
- Better uptime than local machine
Hetzner
€4-20/month, excellent performance, EU-based
DigitalOcean
$6-40/month, simple setup, global regions
Linode
$5-40/month, strong support, predictable pricing
Vultr
$6-40/month, high-frequency compute options
Fly.io Deployment
Ideal for:- Global edge deployment
- Auto-scaling
- Managed infrastructure
fly.toml configures:
- 2GB RAM, 2 shared CPUs
- Persistent volume for state
- HTTPS with automatic certificates
- Auto-restart on failure
fly.toml):
Railway Deployment
Ideal for:- Simple one-click deployment
- Automatic builds from GitHub
- Integrated database options
Render Deployment
Ideal for:- Managed Docker hosting
- Free tier available
- Auto-deploy from Git
render.yaml:
- Fork OpenClaw repository
- Connect to Render dashboard
- Create “New Web Service” from repo
- Render auto-detects
render.yaml - Deploy!
Google Cloud Platform
Ideal for:- Enterprise deployments
- Integration with GCP services
- Custom VM configurations
Environment Variables
Critical environment variables for production:| Variable | Description | Required |
|---|---|---|
OPENCLAW_GATEWAY_TOKEN | Authentication token | Yes (if using token auth) |
OPENCLAW_GATEWAY_PASSWORD | Authentication password | Yes (if using password auth) |
CLAUDE_AI_SESSION_KEY | Claude API session key | Yes (for Claude provider) |
CLAUDE_WEB_SESSION_KEY | Claude web session | Optional |
OPENCLAW_STATE_DIR | State directory path | Optional (default: ~/.openclaw) |
OPENCLAW_WORKSPACE_DIR | Workspace directory | Optional |
NODE_ENV | Node environment | Optional (default: production) |
PORT | Gateway port | Optional (default: 18789) |
Health Checks
Monitor gateway health:Persistence and State
OpenClaw stores state in:- Config:
~/.openclaw/config.json - Sessions:
~/.openclaw/agents/<agent-id>/sessions/ - Workspace:
~/.openclaw/workspace/(default) - Credentials:
~/.openclaw/credentials/ - Logs: Platform-specific (systemd journal, Docker logs)
Platform-Specific Notes
Linux (systemd)
The onboarding wizard installs a systemd user service:macOS (launchd)
Gateway runs as a LaunchAgent:Docker Considerations
See Docker Guide for detailed Docker setup.Updating Production Deployments
VPS Update
Cloud Platform Updates
- Fly.io:
fly deploy(rebuilds from Dockerfile) - Railway: Push to connected Git branch
- Render: Auto-deploys on Git push
- GCP Cloud Run: Re-run
gcloud run deploy
Next Steps
Docker Setup
Containerized deployment with Docker Compose
Security Guide
Secure your gateway with best practices
Troubleshooting
Common issues and solutions
Multi-Agent Setup
Route channels to isolated agents

