Skip to content

Self-Hosting

The simplest production setup is a VPS with Docker:

  1. Provision a VPS — any provider (AWS EC2, DigitalOcean, Hetzner, etc.) with at least 2 GB RAM and 10 GB disk
  2. Install Docker — follow Docker’s official docs
  3. Deploy with Docker Compose — see Docker Compose setup

Security considerations

  • The auth token secures the API. Keep it secret and use HTTPS if exposing the port externally.
  • The container runs with elevated privileges (SYS_PTRACE, seccomp=unconfined). Run it on a dedicated VM or isolated Docker host.
  • Use HTTPS if exposing port 6174 externally. Both the API and VNC viewer at /vnc/ require the auth token.

Monitoring

Check the container health:

Terminal window
# Container status
docker ps | grep agent-wechat
# Server and login status
wx status
# Container logs
wx logs
# or
docker compose logs -f agent-wechat

Backups

Back up the Docker volumes periodically:

Terminal window
# Back up WeChat data
docker run --rm -v agent-wechat-home:/data -v $(pwd):/backup ubuntu tar czf /backup/wechat-home-backup.tar.gz -C /data .
# Back up agent data
docker run --rm -v agent-wechat-data:/data -v $(pwd):/backup ubuntu tar czf /backup/agent-data-backup.tar.gz -C /data .

Updates

To update to the latest image:

Terminal window
docker compose pull
docker compose up -d

Or with the CLI:

Terminal window
wx down
docker pull ghcr.io/thisnick/agent-wechat:latest
wx up

After updating, the WeChat session usually persists. Scan the QR code in WeChat if prompted.