Guide

How to Run OpenClaw with Docker

Docker is ideal for VPS and headless deployments. Run OpenClaw in a container with persistent config, auto-restart, and easy updates.

Quick Answer

Run OpenClaw in Docker: docker run -d -p 18789:18789 -v openclaw-data:/root/.openclaw openclawai/openclaw. Then manage it with ClawSquire or access the Dashboard at localhost:18789.

Recommended

Use ClawSquire to Manage Docker OpenClaw

After running OpenClaw in Docker (steps below), use ClawSquire to connect and manage the containerized OpenClaw — same as managing a VPS. Add your server, click Connect, and ClawSquire handles the SSH tunnel automatically.

VPS Manager — One-Click Connect

Add your Docker host, enter SSH credentials, click Connect. No manual tunnel commands.

ClawSquire VPS Manager showing remote server connection form with host field, SSH port 22, username, password authentication, and green Connect button for automatic SSH tunnel to OpenClaw Dashboard
Dashboard in Remote Mode

Manage OpenClaw on your Docker host from your laptop — config, channels, health check.

ClawSquire Dashboard in Remote Mode connected to OpenClaw on a server showing OpenClaw Dashboard button, Safety Level, Quick Actions for setup and health check
Channels — Configure Telegram, DeepSeek

Add and manage messaging channels and LLM providers from the visual interface.

ClawSquire Channels page showing Telegram channel with Configured badge, DeepSeek provider, and Add Channel button for OpenClaw messaging setup

Setup Steps

Manual Alternative

1

Prerequisites

Ensure Docker is installed. Docker Compose is optional but recommended for production.

docker --version
2

Quick Start with Docker Run

Run OpenClaw in a detached container with a persistent volume:

docker run -d --name openclaw \
  -p 18789:18789 \
  -v openclaw-data:/root/.openclaw \
  openclawai/openclaw:latest
3

Docker Compose (Recommended for Production)

Create a docker-compose.yml file:

version: '3.8'
services:
  openclaw:
    image: openclawai/openclaw:latest
    ports:
      - "18789:18789"
    volumes:
      - openclaw-data:/root/.openclaw
    restart: unless-stopped
    environment:
      - DEEPSEEK_API_KEY=${DEEPSEEK_API_KEY}
volumes:
  openclaw-data:

Then start the stack:

docker compose up -d
4

Access the Dashboard

If running on the same machine, open http://localhost:18789. For remote VPS, use an SSH tunnel:

ssh -L 18789:localhost:18789 user@your-vps-ip

Then open http://localhost:18789 in your browser.

5

Configuration

Config persists in the openclaw-data volume. Edit via the Dashboard, or use:

docker exec -it openclaw openclaw config set ...
6

Update

With Docker Compose:

docker compose pull && docker compose up -d

With docker run:

docker pull openclawai/openclaw:latest && docker restart openclaw

Troubleshooting

Port already in use+

Change the port mapping (e.g. -p 18790:18789) or stop the process using port 18789.

Container won't start+

Check logs: docker logs openclaw. Verify the image exists and your environment variables are set correctly.

Config lost after restart+

Ensure the volume is mounted. Use -v openclaw-data:/root/.openclaw for docker run, or the volumes section in docker-compose.yml.

Next Steps