Reach it from other machines
You have a daemon on a server (Run on a server) and want the CLI, the desktop app or OpenClaw on another machine to use it. This page keeps the daemon off the public internet by putting both machines on a Tailscale network (a tailnet).
Why the daemon needs HTTPS
The daemon only accepts plain HTTP on localhost: --listen must be a loopback address, and the CLI refuses an http:// URL for any other host. To be reachable from another machine, the daemon needs an HTTPS address. There are two ways to get one:
| Way | How | Good when |
|---|---|---|
| Tailscale Serve | Serve the daemon’s localhost port over HTTPS on your tailnet name. The daemon config doesn’t change. | You want the least setup. |
| Daemon’s own HTTPS listener | Set networkListen, tlsCertFile and tlsKeyFile in the daemon config (or pass --network-listen, --tls-cert-file and --tls-key-file to wx serve). All three are required, and the port must differ from listen. See Configuration. | You already have a certificate for the server’s name. |
Tailscale’s own commands are documented by Tailscale. Follow its guide for Serve to publish http://127.0.0.1:6174 on your tailnet, and note the https:// address it gives you. Use that address as URL below.
1. Create a token for the client
Run this on the server (with Docker, prefix it with docker compose exec agent-wechat-native and add --token-file /run/secrets/wechat-api-token). Give each client its own token, limited to one account and the scopes it needs. See API tokens for the scope list.
wx tokens create laptop --accounts ACCOUNT_ID --scopes read --scopes sendThe token is printed once, in the token field. On the client machine, save it in a file only you can read:
umask 077mkdir -p ~/.config/agent-wechatprintf '%s\n' 'PASTE_TOKEN_HERE' > ~/.config/agent-wechat/box-token2. Connect a client
- Open AgentWechat and choose Connect to another hub.
- Enter the hub’s
https://address and the token as the access key. - If the hub uses a private certificate, paste it under Advanced → Private certificate (optional). A publicly trusted address, such as a Tailscale Serve address, needs no certificate.
wx config servers add box --url https://URL --token-file ~/.config/agent-wechat/box-tokenwx config servers select boxwx statuswx status shows the server’s health and identity. If the server uses a private certificate, add --ca-cert-file /path/to/certificate.pem to a command to trust it for that run.
Use external mode: the Gateway connects to a daemon you run yourself. Set native.mode to external and native.endpoint to the daemon’s https:// address. Pass the token as a secret reference in native.token, for example an environment variable. The token needs read, media, send and login, plus read-state unless readPolicy is never. See OpenClaw settings.
3. Check it works
wx accounts listYou should see the accounts your token can use. If you get a connection error, confirm that both machines are online in Tailscale and that the address is the https:// one.