This content now lives in Remote Access. Use that page for the current guide; this page stays as a redirect target.
Running OpenClaw.app with a Remote Gateway
OpenClaw.app reaches a remote Gateway over an SSH tunnel: an SSHLocalForward maps a local port to the Gateway WebSocket port on the remote host.
Setup
- Add an SSH config entry with
LocalForward 18789 127.0.0.1:18789(see Remote Access for the full config block). - Copy your SSH key to the remote host with
ssh-copy-id. - Set
gateway.remote.token(orgateway.remote.password) viaopenclaw config set gateway.remote.token "<your-token>". - Start the tunnel:
ssh -N remote-gateway &. - Quit and reopen OpenClaw.app.
ssh -N.
How it works
| Component | What it does |
|---|---|
LocalForward 18789 127.0.0.1:18789 | Forwards local port 18789 to remote port 18789 |
ssh -N | SSH without executing remote commands (port forwarding only) |
KeepAlive | Restarts the tunnel automatically if it crashes (LaunchAgent) |
RunAtLoad | Starts the tunnel when the LaunchAgent loads (LaunchAgent) |
ws://127.0.0.1:18789 on the client. The tunnel forwards that connection to port 18789 on the remote host running the Gateway.