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
mkdir -p ~/.config/agent-wechatopenssl rand -hex 32 > ~/.config/agent-wechat/tokenchmod 600 ~/.config/agent-wechat/token2. 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
docker compose up -dKey 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
| Volume | Path in container | Purpose |
|---|---|---|
agent-wechat-data | /data | Agent database, auth token |
agent-wechat-home | /home/wechat | WeChat user data, databases, media files |
| Token file | /data/auth-token | Read-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:
PROXY=user:pass@host:port docker compose up -dPrefix with socks5:// for SOCKS5 proxies.