This guide covers deploying MicroClaw using Docker and Docker Compose for containerized, reproducible deployments.
docker info
docker run --rm ubuntu:25.10 echo ok
MicroClaw includes an official Dockerfile in the repository. You can build from source or use prebuilt images.
git clone https://github.com/microclaw/microclaw.git
cd microclaw
docker build -t microclaw:latest .
docker pull microclaw/microclaw:latest
Create a docker-compose.yml file:
version: '3.8'
services:
microclaw:
image: microclaw/microclaw:latest
container_name: microclaw
restart: unless-stopped
volumes:
- ~/.microclaw:/root/.microclaw
environment:
- TELEGRAM_BOT_TOKEN=your_telegram_bot_token
- API_KEY=your_llm_api_key
- MICROCLAW_LLM_PROVIDER=anthropic
- MICROCLAW_MODEL=claude-sonnet-4-20250514
ports:
- "10961:10961"
networks:
- microclaw-network
networks:
microclaw-network:
driver: bridge
With sandbox mode and MCP support:
version: '3.8'
services:
microclaw:
image: microclaw/microclaw:latest
container_name: microclaw
restart: unless-stopped
volumes:
- ~/.microclaw:/root/.microclaw
- ~/.microclaw/working_dir:/root/.microclaw/working_dir
# Docker socket for sandbox mode (use with caution)
- /var/run/docker.sock:/var/run/docker.sock
environment:
# LLM Configuration
- MICROCLAW_LLM_PROVIDER=anthropic
- MICROCLAW_API_KEY=sk-ant-...
- MICROCLAW_MODEL=claude-sonnet-4-20250514
# Channel Configuration
- TELEGRAM_BOT_TOKEN=your_telegram_bot_token
- DISCORD_BOT_TOKEN=your_discord_bot_token
# Optional: Sandbox Configuration
- MICROCLAW_SANDBOX_MODE=all
- MICROCLAW_SANDBOX_SECURITY_PROFILE=hardened
# Optional: Memory Configuration
- MICROCLAW_MEMORY_TOKEN_BUDGET=1500
- MICROCLAW_MAX_TOKENS=8192
ports:
- "10961:10961"
networks:
- microclaw-network
# Optional: Resource limits
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
networks:
microclaw-network:
driver: bridge
| Variable | Description | Example |
|---|---|---|
MICROCLAW_LLM_PROVIDER |
LLM provider name | anthropic, openai, ollama |
MICROCLAW_API_KEY |
API key for LLM provider | sk-ant-... |
MICROCLAW_MODEL |
Model to use | claude-sonnet-4-20250514 |
MICROCLAW_LLM_BASE_URL |
Custom provider URL | https://api.example.com |
| Variable | Description | Example |
|---|---|---|
TELEGRAM_BOT_TOKEN |
Telegram bot token | 123456:ABC-DEF1234... |
DISCORD_BOT_TOKEN |
Discord bot token | ... |
SLACK_BOT_TOKEN |
Slack bot token | xoxb-... |
SLACK_APP_TOKEN |
Slack app token (Socket Mode) | xapp-... |
| Variable | Description | Default |
|---|---|---|
MICROCLAW_DATA_DIR |
Data directory | /root/.microclaw |
MICROCLAW_SANDBOX_MODE |
Sandbox mode | off |
MICROCLAW_SANDBOX_SECURITY_PROFILE |
Security profile | standard |
MICROCLAW_MAX_TOKENS |
Max tokens per response | 8192 |
MICROCLAW_MAX_TOOL_ITERATIONS |
Max tool iterations | 100 |
MICROCLAW_MEMORY_TOKEN_BUDGET |
Memory token budget | 1500 |
docker compose up -d
docker compose logs -f microclaw
docker compose down
docker compose restart
MicroClaw supports running bash commands in isolated Docker containers for security.
Via environment variable:
environment:
- MICROCLAW_SANDBOX_MODE=all
- MICROCLAW_SANDBOX_SECURITY_PROFILE=hardened
Via configuration file (~/.microclaw/microclaw.config.yaml):
sandbox:
mode: "all" # off | all
backend: "auto"
security_profile: "hardened" # hardened | standard | privileged
image: "ubuntu:25.10"
container_prefix: "microclaw-sandbox"
no_network: true
require_runtime: false
| Profile | Capabilities | Use Case |
|---|---|---|
hardened |
--cap-drop ALL --security-opt no-new-privileges |
Production, untrusted code |
standard |
Docker default capabilities | General use |
privileged |
--privileged |
Debugging only |
docker exec -it microclaw microclaw doctor sandbox
MicroClaw stores data in the following directories:
| Directory | Purpose | Recommended Mount |
|---|---|---|
/root/.microclaw |
Configuration, database, memory | ~/.microclaw:/root/.microclaw |
/root/.microclaw/working_dir |
Tool working directory | ~/.microclaw/working_dir:/root/.microclaw/working_dir |
/root/.microclaw/runtime/logs |
Runtime logs | Included in main volume |
# Backup configuration
tar -czf microclaw-backup-$(date +%Y%m%d).tar.gz ~/.microclaw
# Restore configuration
tar -xzf microclaw-backup-YYYYMMDD.tar.gz -C ~/
services:
microclaw:
image: microclaw/microclaw:latest
environment:
- MICROCLAW_LLM_PROVIDER=anthropic
- MICROCLAW_API_KEY=sk-ant-...
- TELEGRAM_BOT_TOKEN=your_token
volumes:
- ~/.microclaw:/root/.microclaw
ports:
- "10961:10961"
services:
microclaw:
image: microclaw/microclaw:latest
environment:
- MICROCLAW_LLM_PROVIDER=anthropic
- MICROCLAW_API_KEY=sk-ant-...
- DISCORD_BOT_TOKEN=your_token
volumes:
- ~/.microclaw:/root/.microclaw
ports:
- "10961:10961"
For multiple accounts, use the configuration file approach:
services:
microclaw:
image: microclaw/microclaw:latest
volumes:
- ~/.microclaw:/root/.microclaw
# Configuration in ~/.microclaw/microclaw.config.yaml
The Web UI is available on port 10961 by default:
ports:
- "127.0.0.1:10961:10961" # Localhost only (secure)
For remote access (use with authentication):
ports:
- "0.0.0.0:10961:10961" # All interfaces
docker exec -it microclaw microclaw web password-generate
services:
microclaw:
deploy:
resources:
limits:
memory: 2G
reservations:
memory: 512M
services:
microclaw:
deploy:
resources:
limits:
cpus: '2.0'
reservations:
cpus: '0.5'
Add health monitoring to your Docker Compose:
services:
microclaw:
image: microclaw/microclaw:latest
healthcheck:
test: ["CMD", "microclaw", "gateway", "status"]
interval: 30s
timeout: 10s
retries: 3
start_period: 40s
services:
microclaw:
logging:
driver: "json-file"
options:
max-size: "10m"
max-file: "3"
# Follow logs
docker compose logs -f
# Last 100 lines
docker compose logs --tail=100
# Specific time range
docker compose logs --since="2026-02-28T00:00:00" --until="2026-02-28T23:59:59"
# Check Docker daemon
docker info
# Check container logs
docker compose logs microclaw
# Verify environment variables
docker compose config
# Fix volume permissions
docker run --rm -v ~/.microclaw:/data alpine chown -R root:root /data
# Verify Docker socket is mounted
docker exec -it microclaw ls -la /var/run/docker.sock
# Test sandbox
docker exec -it microclaw microclaw doctor sandbox
Any questions?
Feel free to contact us. Find all contact information on our contact page.