Skip to content

Docker Compose

Use Docker Compose when running agent-wechat alongside other services (like OpenClaw) or when you need more control over the configuration.

1. Generate an auth token

Terminal window
mkdir -p ~/.config/agent-wechat
openssl rand -hex 32 > ~/.config/agent-wechat/token
chmod 600 ~/.config/agent-wechat/token

2. Create docker-compose.yml

services:
agent-wechat:
image: ghcr.io/thisnick/agent-wechat:latest
container_name: agent-wechat
security_opt:
- seccomp=unconfined
cap_add:
- SYS_PTRACE
- NET_ADMIN # required only if using a proxy
ports:
- "6174:6174"
volumes:
- agent-wechat-data:/data
- agent-wechat-home:/home/wechat
- ~/.config/agent-wechat/token:/data/auth-token:ro
environment:
- PROXY=${PROXY:-} # optional: user:pass@host:port
restart: unless-stopped
volumes:
agent-wechat-data:
agent-wechat-home:

3. Start the container

Terminal window
docker compose up -d

Key configuration

Security options (required)

  • seccomp=unconfined — allows all syscalls (ptrace needs this)
  • SYS_PTRACE — required to interact with the WeChat desktop process

These are not optional. Without them, the server cannot control WeChat. See Hosting Requirements for details.

Volumes

VolumePath in containerPurpose
agent-wechat-data/dataAgent database, auth token
agent-wechat-home/home/wechatWeChat user data, databases, media files
Token file/data/auth-tokenRead-only auth token mount

Networking with OpenClaw

If running OpenClaw on the same Docker network, set the server URL to the container name:

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

Proxy

Set the PROXY environment variable to route all container traffic through a proxy:

Terminal window
PROXY=user:pass@host:port docker compose up -d

Prefix with socks5:// for SOCKS5 proxies.