Deployment & Hosting
🐳

Docker Deployment for OpenClaw

Run OpenClaw in a Docker container for portable, reproducible deployments.

5 min read|
dockercontainerdockerfile

Why Docker?

Docker packages OpenClaw and its dependencies into a portable container. Benefits:

  • Consistent environment across machines
  • Easy deployment and updates
  • Isolation from host system
  • Simple rollbacks

Quick Start

Using Docker Compose

Create docker-compose.yml:

version: '3.8'
services:
  openclaw:
    image: openclaw/openclaw:latest
    container_name: openclaw
    restart: always
    volumes:
      - ./openclaw-data:/root/.openclaw
    environment:
      - OPENROUTER_API_KEY=sk-or-...
      - TELEGRAM_BOT_TOKEN=...
    ports:
      - "3000:3000"

Run:

docker compose up -d

Using Docker Run

docker run -d \
  --name openclaw \
  --restart always \
  -v $(pwd)/openclaw-data:/root/.openclaw \
  -e OPENROUTER_API_KEY=sk-or-... \
  -e TELEGRAM_BOT_TOKEN=... \
  openclaw/openclaw:latest

Custom Dockerfile

If you need customization:

FROM node:20-slim

RUN npm install -g openclaw

WORKDIR /root/.openclaw

COPY openclaw.json .
COPY skills/ ./skills/

CMD ["openclaw", "start"]

Build and run:

docker build -t my-openclaw .
docker run -d --name openclaw --restart always my-openclaw

Data Persistence

Mount a volume for persistent data:

  • /root/.openclaw — Configuration, memory, history, skills

Without a volume mount, data is lost when the container restarts.

Updating

docker compose pull
docker compose up -d

Or for docker run:

docker pull openclaw/openclaw:latest
docker stop openclaw && docker rm openclaw
# Re-run the docker run command

Monitoring

docker logs -f openclaw          # View logs
docker stats openclaw             # Resource usage
docker exec -it openclaw sh       # Shell into container

Tips

  • Use .env files for secrets instead of inline environment variables
  • Pin to specific version tags for production stability
  • Set memory limits to prevent runaway usage
  • Use Docker health checks for automatic restart on failure
dockercontainerdockerfiledocker composecontainerized

Ready for your AI assistant?

Get started with Claw for All today. No setup, no terminal, just sign up and go.

Get Started

Related Guides