Docker-based setup for running OpenClaw — an open-source AI agent framework. This repo provides everything you need to self-host OpenClaw with a single docker compose command.
| File / Folder | Purpose |
|---|---|
docker-compose.yml |
Two services: CLI (interactive) and Gateway (web UI + whisper + browser) |
Dockerfile.gateway |
Gateway image: base OpenClaw + whisper-cli (audio) + Playwright Chromium (stealth browser) |
scripts/upgrade.sh |
One-command upgrade to the latest OpenClaw version |
data/openclaw.json |
Example config (tracked): Codex + Telegram, browser + audio; replace with your own tokens/settings |
data/browser/chrome-wrapper.sh |
Stealth Chrome wrapper (anti-detection flags) used when browser tool is enabled |
data/browser/stealth-browse.js |
Stealth Playwright script for bot-protected sites (screenshot, content, click, type, scroll) |
data/ |
Persistent volume mount for all OpenClaw data |
- Docker and Docker Compose v2
- An API key from any LLM provider, or Codex OAuth (configured during onboarding)
git clone https://github.com/your-org/openclaw_setup.git
cd openclaw_setup
cp .env.example .envEdit .env and set at minimum:
OPENCLAW_GATEWAY_TOKEN— authentication token for the web UI. Generate one with:openssl rand -hex 32
The image is built directly from the OpenClaw source repo:
docker compose buildThis walks you through linking your Claude AI credentials:
docker compose run --rm openclaw-cli onboarddocker compose up -d openclaw-gatewayThe web UI will be available at http://localhost:18789 (or the port you configured).
For interactive CLI sessions:
docker compose run --rm openclaw-cliAll settings live in .env. See .env.example for the full list with descriptions. Key options:
| Variable | Default | Description |
|---|---|---|
OPENCLAW_IMAGE |
openclaw:local |
Docker image name |
OPENCLAW_GATEWAY_PORT |
18789 |
Web UI port |
OPENCLAW_BRIDGE_PORT |
18790 |
Bridge connection port |
OPENCLAW_GATEWAY_BIND |
lan |
Network binding: localhost, lan, or public |
OPENCLAW_GATEWAY_TOKEN |
(required) | Auth token for web UI access |
OPENCLAW_DOCKER_APT_PACKAGES |
(empty) | Extra system packages to install in the container |
The included data/openclaw.json is an example set up for Codex and Telegram with the browser tool and audio transcription (whisper-cli) enabled. You should replace it with your own configuration: set gateway.auth.token for web UI access, and if you use Telegram set channels.telegram.botToken and channels.telegram.allowFrom (array of user IDs). The file is tracked in git. Gateway env vars (OPENCLAW_GATEWAY_TOKEN, TELEGRAM_BOT_TOKEN, TELEGRAM_ALLOW_FROM) are still passed into the container and can override or supplement the file.
All persistent data is stored in ./data/, which maps to ~/.openclaw inside the container:
data/
├── openclaw.json # Configuration (tracked); gateway token, Telegram, browser, audio
├── browser/
│ ├── chrome-wrapper.sh # Stealth Chrome wrapper for browser tool
│ └── stealth-browse.js # Stealth Playwright for bot-protected sites
├── agents/ # Agent configs and session transcripts (.jsonl)
├── canvas/ # Canvas files
├── cron/ # Cron job definitions
├── memory/ # Vector embeddings (SQLite) for semantic search
└── workspace/ # Working directory for agent tasks
Note:
openclaw.jsonis tracked. Other sensitive paths (credentials, identity keys, etc.) remain in.gitignore.
To pull the latest OpenClaw source and rebuild:
./scripts/upgrade.shThis will rebuild the Docker image from the latest main branch, restart the gateway, and clean up old images. Your data in ./data/ is preserved.
- The gateway binds to
127.0.0.1by default, so it is not exposed to the public internet. - Change
OPENCLAW_GATEWAY_BINDtolocalhostfor the most restrictive access, orpubliconly if you understand the risks. - Never commit your
.envfile — it contains secrets.
See the OpenClaw repository for license details.