Skip to content

OpenClaw Container Setup

When both OpenClaw and agent-wechat run in Docker containers, they communicate over a shared Docker network.

Docker Compose

services:
agent-wechat:
image: ghcr.io/thisnick/agent-wechat:latest
container_name: agent-wechat
security_opt:
- seccomp=unconfined
cap_add:
- SYS_PTRACE
- NET_ADMIN
ports:
- "6174:6174"
volumes:
- agent-wechat-data:/data
- agent-wechat-home:/home/wechat
- ~/.config/agent-wechat/token:/data/auth-token:ro
environment:
- PROXY=${PROXY:-}
restart: unless-stopped
openclaw:
image: your-openclaw-image
# ... your OpenClaw config ...
depends_on:
- agent-wechat
volumes:
agent-wechat-data:
agent-wechat-home:

Key difference: server URL

When both services are on the same Docker network, use the container name as the hostname:

{
"channels": {
"wechat": {
"serverUrl": "http://agent-wechat:6174",
"token": "your-token"
}
}
}

Generating and sharing the token

Terminal window
# Generate the token on the host
mkdir -p ~/.config/agent-wechat
openssl rand -hex 32 > ~/.config/agent-wechat/token
chmod 600 ~/.config/agent-wechat/token
# Read the token value
cat ~/.config/agent-wechat/token

Copy the token value into your OpenClaw configuration.