Deployment Overview
OpenClaw runs anywhere: your laptop, a single VPS, Docker Compose, Kubernetes, or a fully managed cloud environment. This guide helps you choose the right deployment strategy, walk through a production-ready architecture, and ensure you've covered the essentials before going live.
Deployment Options at a Glance
OpenClaw is a Python package — it runs wherever Python 3.10+ runs. Choose your deployment method based on your team size, reliability requirements, and operational overhead tolerance:
| Method | Best for | Complexity | Cost estimate |
|---|---|---|---|
| Bare metal / VM | Single developers, small teams, full control | Low | $5-20/mo VPS |
| Docker | Dev/staging, consistent environments, small production | Low | $10-50/mo |
| Kubernetes | Production, high availability, auto-scaling, multi-tenant | High | $100-500+/mo |
| AWS (ECS/EKS/Lambda) | AWS-native teams, elastic scaling, managed infra | Medium | Pay per use |
| GCP (Cloud Run) | Serverless, scale-to-zero, Google ecosystem | Low–Medium | Pay per request |
| Azure (ACI/AKS) | Microsoft ecosystem, Azure DevOps integration | Medium | Pay per use |
Production Architecture
A production-ready OpenClaw deployment is more than just the agent process. The following components work together to provide reliability, observability, and security:
- OpenClaw daemon — the agent runtime, accepts tasks via REST API or message queue and executes them asynchronously
- Task queue — Redis or RabbitMQ for async task dispatch, retry logic, and workload distribution across multiple workers
- Cache layer — Redis for LLM response caching; reduces API costs and latency for repeated or similar queries
- Secrets manager — HashiCorp Vault, AWS Secrets Manager, or Doppler for storing API keys outside of config files and environment variables
- Database — SQLite works for development; PostgreSQL is recommended for production conversation history and audit logs
- Observability stack — Prometheus + Grafana for metrics, or a managed APM like Datadog or New Relic
- Reverse proxy — Nginx or Caddy in front of the OpenClaw API for TLS termination, rate limiting, and request logging
Internet → [Nginx / Caddy (TLS)] → [OpenClaw API]
↓
[Task Queue (Redis)]
↓ ↓
[Worker 1] [Worker 2]
↓ ↓
[Cache (Redis)] [Database (PostgreSQL)]
↓
[LLM Provider APIs]Minimum System Requirements
OpenClaw is lightweight — you don't need a powerful server for most workloads. The main resource consumers are the task queue (Redis) and any local models you run:
| Component | Minimum | Recommended (Production) | Notes |
|---|---|---|---|
| CPU | 1 vCPU | 4 vCPU | More CPUs = more concurrent workers |
| RAM | 512MB | 4GB | Add 256MB per concurrent agent |
| Disk | 4GB | 20GB SSD | Logs, SQLite, local model cache |
| Python | 3.10+ | 3.12 | Async improvements in 3.11+ |
| Network | Outbound HTTPS | 1Gbps, low latency to LLM regions | Most latency comes from LLM API calls |
| OS | Linux / macOS / Windows | Ubuntu 22.04 LTS or later | Docker available on all platforms |
Pre-Deployment Checklist
Before deploying to production, verify each of these items. Skipping any of them is the most common cause of production incidents:
| Item | Priority | Guide |
|---|---|---|
| API keys stored in secrets manager, not in config files or env vars | Required | Secrets Management |
| CPU and memory limits configured per worker | Required | Docker Setup |
| Sandboxing enabled to prevent filesystem/network escapes | Required (production) | Sandboxing |
| Token budget and cost alerts configured | Required | Token Optimization |
Health check endpoint verified (/health) | Required for load balancers | Kubernetes |
| Log aggregation pipeline set up | Recommended | Structured Logging |
| Alerting rules configured for failures and latency | Recommended | Alerting |
| Backup and recovery plan for conversation database | Recommended | Self-Hosted |
Core Environment Variables
These environment variables must be set in every deployment environment. Never hardcode them in your config files:
# Required — at least one LLM provider key
OPENAI_API_KEY=sk-...
ANTHROPIC_API_KEY=sk-ant-...
# Required in production
OPENCLAW_ENV=production
OPENCLAW_SECRET_KEY=your-32-byte-random-secret
# Optional but recommended
REDIS_URL=redis://redis:6379/0
DATABASE_URL=postgresql://user:pass@db:5432/openclaw
OPENCLAW_LOG_LEVEL=INFOSee the complete reference at All Environment Variables.
Recommended Deployment Workflow
A simple but effective workflow for deploying OpenClaw changes to production:
- Build and test locally with
docker compose upand run your test suite - Push to a staging environment — an identical replica of production with test data
- Run smoke tests on staging: a handful of representative agent tasks that cover critical paths
- Deploy to production using a rolling update (zero downtime) — one instance at a time
- Monitor the first 30 minutes after deploy: watch error rates, latency, and cache hit ratios
- Keep the previous image tagged so you can roll back in under 2 minutes if needed
Deployment Option Comparison
Choosing the right deployment target depends on your organization's existing infrastructure, expertise, compliance requirements, and operational capacity. Docker Compose on a single VM is the simplest path for small teams with a single agent at low traffic. Kubernetes suits organizations that already operate Kubernetes clusters and need fine-grained resource management across many services. Cloud-managed services (ECS, Cloud Run, Container Apps) are the best default for most new deployments — they eliminate infrastructure management overhead while providing production-grade reliability, scaling, and security integration with the cloud provider's IAM and secrets systems.
Consider your team's operational expertise honestly. A Kubernetes deployment that no one on the team knows how to debug in production is worse than a simpler Docker deployment that your team manages confidently. Operational complexity should match your team's capabilities — deploy the simplest approach that meets your reliability and scaling requirements, and only add complexity when you have a clear, quantified need for it. The most reliable production system is the one your team understands well enough to maintain and troubleshoot.