Deployment Options
Docker
Recommended for most users. Isolated, reproducible, easy to manage.
Binary
Direct installation. Fast, minimal overhead, full system integration.
Systemd Service
Run as a system service. Auto-start, logging, process management.
Kubernetes
For large-scale deployments. Orchestration, scaling, high availability.
Docker Deployment
Using Docker Compose (Recommended)
services:
zeroclaw:
image: ghcr.io/zeroclaw-labs/zeroclaw:latest
container_name: zeroclaw
restart: unless-stopped
environment:
# Required: Your LLM provider API key
- API_KEY=${API_KEY}
# Optional: Provider configuration
- PROVIDER=${PROVIDER:-openrouter}
- ZEROCLAW_MODEL=anthropic/claude-sonnet-4-20250514
# Gateway configuration
- ZEROCLAW_ALLOW_PUBLIC_BIND=true # Required for container networking
- ZEROCLAW_GATEWAY_PORT=${ZEROCLAW_GATEWAY_PORT:-42617}
volumes:
# Persist workspace and config
- zeroclaw-data:/zeroclaw-data
ports:
- "${HOST_PORT:-42617}:${ZEROCLAW_GATEWAY_PORT:-42617}"
deploy:
resources:
limits:
cpus: '2'
memory: 2G
reservations:
cpus: '0.5'
memory: 512M
healthcheck:
test: ["CMD", "zeroclaw", "status"]
interval: 60s
timeout: 10s
retries: 3
start_period: 10s
volumes:
zeroclaw-data:
Open http://localhost:42617 in your browser.
Docker Run (Single Command)
Custom Configuration
Mount a custom config file:Multi-Stage Build
Build from source with optimizations (fromDockerfile):
Binary Deployment
Build from Source
Download Pre-built Binary
Initialize Configuration
Systemd Service
Run ZeroClaw as a system service for auto-start and process management.[Unit]
Description=ZeroClaw Autonomous Agent
After=network.target
Wants=network-online.target
[Service]
Type=simple
User=zeroclaw
Group=zeroclaw
WorkingDirectory=/home/zeroclaw/.zeroclaw
# Environment
Environment="API_KEY=your-api-key-here"
Environment="PROVIDER=openrouter"
Environment="ZEROCLAW_GATEWAY_PORT=42617"
# Execution
ExecStart=/usr/local/bin/zeroclaw gateway
ExecReload=/bin/kill -HUP $MAINPID
# Restart policy
Restart=on-failure
RestartSec=10s
# Security hardening
NoNewPrivileges=true
PrivateTmp=true
ProtectSystem=strict
ProtectHome=true
ReadWritePaths=/home/zeroclaw/.zeroclaw
# Resource limits
LimitNOFILE=65536
MemoryMax=2G
CPUQuota=200%
# Logging
StandardOutput=journal
StandardError=journal
SyslogIdentifier=zeroclaw
[Install]
WantedBy=multi-user.target
# Create dedicated user
sudo useradd -r -s /bin/false -d /home/zeroclaw zeroclaw
# Create workspace
sudo mkdir -p /home/zeroclaw/.zeroclaw
sudo chown -R zeroclaw:zeroclaw /home/zeroclaw
# Reload systemd
sudo systemctl daemon-reload
# Enable auto-start
sudo systemctl enable zeroclaw
# Start service
sudo systemctl start zeroclaw
# Check status
sudo systemctl status zeroclaw
Kubernetes Deployment
For production-scale deployments with orchestration.Deployment Manifest
Deploy
Reverse Proxy Setup
Nginx with SSL
Caddy (Auto-HTTPS)
Production Checklist
Security
Security
- Enable pairing (
require_pairing = true) - Use HTTPS (reverse proxy or tunnel)
- Set webhook secrets for all channels
- Configure rate limits appropriately
- Never expose gateway on 0.0.0.0 without protection
- Use environment variables for secrets (not config files)
- Enable audit logging
Reliability
Reliability
- Configure auto-restart (systemd or Docker restart policy)
- Set up health checks
- Configure resource limits (memory, CPU)
- Use persistent storage for config and workspace
- Enable backup for workspace data
- Set up monitoring (Prometheus + Grafana)
- Configure log rotation
Performance
Performance
- Use appropriate memory backend (SQLite for production)
- Configure connection pooling
- Set reasonable rate limits
- Enable caching where appropriate
- Monitor resource usage
- Optimize tool execution timeouts
Operations
Operations
- Document deployment procedure
- Set up log aggregation
- Configure alerts for errors/downtime
- Test backup/restore procedure
- Plan update/rollback strategy
- Monitor costs (LLM API usage)
Monitoring
Prometheus + Grafana
Prometheus scrape config:zeroclaw_requests_total- Total HTTP requestszeroclaw_llm_latency_seconds- LLM API latencyzeroclaw_tool_executions_total- Tool execution countzeroclaw_memory_entries- Memory entry countzeroclaw_rate_limit_exceeded_total- Rate limit hits
Health Checks
Backup and Recovery
Backup Workspace
Restore Workspace
Troubleshooting
Gateway won't start on 0.0.0.0
Gateway won't start on 0.0.0.0
This is intentional security protection. Options:
-
Use a tunnel:
-
Explicit opt-in (use with caution):
Docker container exits immediately
Docker container exits immediately
Check logs:Common issues:
- Missing API_KEY environment variable
- Invalid configuration
- Port already in use
Memory usage keeps growing
Memory usage keeps growing
Configure memory limits:Or use Docker limits:
High CPU usage
High CPU usage
- Check for infinite loops in agent reasoning
- Reduce max_tool_iterations
- Monitor with
zeroclaw doctor - Check for inefficient tool implementations
Next Steps
Gateway Setup
Configure and secure the HTTP gateway
Creating Providers
Add custom LLM providers