Caricamento in corso...
Caricamento in corso...
Last synced: Today, 22:00
Technical reference for the OpenClaw framework. Real-time synchronization with the official documentation engine.
Use this file to discover all available pages before exploring further.
This content has been merged into Remote Access. See that page for the current guide.
OpenClaw.app uses SSH tunneling to connect to a remote gateway. This guide shows you how to set it up.
mermaidflowchart TB subgraph Client["Client Machine"] direction TB A["OpenClaw.app"] B["ws://127.0.0.1:18789\n(local port)"] T["SSH Tunnel"] A --> B B --> T end subgraph Remote["Remote Machine"] direction TB C["Gateway WebSocket"] D["ws://127.0.0.1:18789"] C --> D end T --> C
Edit
~/.ssh/configsshHost remote-gateway HostName <REMOTE_IP> # e.g., 172.27.187.184 User <REMOTE_USER> # e.g., jefferson LocalForward 18789 127.0.0.1:18789 IdentityFile ~/.ssh/id_rsa
Replace
<REMOTE_IP><REMOTE_USER>Copy your public key to the remote machine (enter password once):
bashssh-copy-id -i ~/.ssh/id_rsa <REMOTE_USER>@<REMOTE_IP>
bashopenclaw config set gateway.remote.token "<your-token>"
Use
gateway.remote.passwordOPENCLAW_GATEWAY_TOKENgateway.remote.tokengateway.remote.passwordbashssh -N remote-gateway &
bash# Quit OpenClaw.app (⌘Q), then reopen: open /path/to/OpenClaw.app
The app will now connect to the remote gateway through the SSH tunnel.
To have the SSH tunnel start automatically when you log in, create a Launch Agent.
Save this as
~/Library/LaunchAgents/ai.openclaw.ssh-tunnel.plistxml<?xml version="1.0" encoding="UTF-8"?> <!DOCTYPE plist PUBLIC "-//Apple//DTD PLIST 1.0//EN" "http://www.apple.com/DTDs/PropertyList-1.0.dtd"> <plist version="1.0"> <dict> <key>Label</key> <string>ai.openclaw.ssh-tunnel</string> <key>ProgramArguments</key> <array> <string>/usr/bin/ssh</string> <string>-N</string> <string>remote-gateway</string> </array> <key>KeepAlive</key> <true/> <key>RunAtLoad</key> <true/> </dict> </plist>
bashlaunchctl bootstrap gui/$UID ~/Library/LaunchAgents/ai.openclaw.ssh-tunnel.plist
The tunnel will now:
Legacy note: remove any leftover
com.openclaw.ssh-tunnelCheck if tunnel is running:
bashps aux | grep "ssh -N remote-gateway" | grep -v grep lsof -i :18789
Restart the tunnel:
bashlaunchctl kickstart -k gui/$UID/ai.openclaw.ssh-tunnel
Stop the tunnel:
bashlaunchctl bootout gui/$UID/ai.openclaw.ssh-tunnel
| Component | What It Does |
|---|---|
text LocalForward 18789 127.0.0.1:18789 | Forwards local port 18789 to remote port 18789 |
text ssh -N | SSH without executing remote commands (just port forwarding) |
text KeepAlive | Automatically restarts tunnel if it crashes |
text RunAtLoad | Starts tunnel when the agent loads |
OpenClaw.app connects to
ws://127.0.0.1:18789© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine