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 repo supports “remote over SSH” by keeping a single Gateway (the master) running on a dedicated host (desktop/server) and connecting clients to it.
Think of the Gateway host as where the agent lives. It owns sessions, auth profiles, channels, and state. Your laptop, desktop, and nodes connect to that host.
Run the Gateway on a persistent host (VPS or home server) and reach it via Tailscale or SSH.
gateway.bind: "loopback"Ideal when your laptop sleeps often but you want the agent always-on.
The laptop does not run the agent. It connects remotely:
Runbook: macOS remote access.
Keep the Gateway local but expose it safely:
Guides: Tailscale and Web overview.
One gateway service owns state + channels. Nodes are peripherals.
Flow example (Telegram → node):
node.*Notes:
Create a local tunnel to the remote Gateway WS:
bashssh -N -L 18789:127.0.0.1:18789 user@host
With the tunnel up:
openclaw healthopenclaw status --deepws://127.0.0.1:18789openclaw gateway statusopenclaw gateway healthopenclaw gateway probeopenclaw gateway call--urlYou can persist a remote target so CLI commands use it by default:
json5{ gateway: { mode: "remote", remote: { url: "ws://127.0.0.1:18789", token: "your-token", }, }, }
When the gateway is loopback-only, keep the URL at
ws://127.0.0.1:18789gateway.remote.sshTargetgateway.remote.urlGateway credential resolution follows one shared contract across call/probe/status paths and Discord exec-approval monitoring. Node-host uses the same base contract with one local-mode exception (it intentionally ignores
gateway.remote.*--token--passwordgatewayToken--urlOPENCLAW_GATEWAY_URLOPENCLAW_GATEWAY_TOKENOPENCLAW_GATEWAY_PASSWORDOPENCLAW_GATEWAY_TOKENgateway.auth.tokengateway.remote.tokenOPENCLAW_GATEWAY_PASSWORDgateway.auth.passwordgateway.remote.passwordgateway.remote.tokenOPENCLAW_GATEWAY_TOKENgateway.auth.tokenOPENCLAW_GATEWAY_PASSWORDgateway.remote.passwordgateway.auth.passwordgateway.remote.tokengateway.remote.passwordgateway.remote.tokenOPENCLAW_GATEWAY_*WebChat no longer uses a separate HTTP port. The SwiftUI chat UI connects directly to the Gateway WebSocket.
18789ws://127.0.0.1:18789The macOS menu bar app can drive the same setup end-to-end (remote status checks, WebChat, and Voice Wake forwarding).
Runbook: macOS remote access.
Short version: keep the Gateway loopback-only unless you’re sure you need a bind.
ws://OPENCLAW_ALLOW_INSECURE_PRIVATE_WS=1openclaw.jsonlantailnetcustomautogateway.auth.mode: "trusted-proxy"gateway.remote.token.passwordgateway.remote.*gateway.auth.*gateway.auth.tokengateway.auth.passwordgateway.remote.tlsFingerprintwss://gateway.auth.allowTailscale: truefalsegateway.auth.trustedProxy.allowLoopback = trueDeep dive: Security.
For macOS clients connecting to a remote gateway, the easiest persistent setup uses an SSH
LocalForwardEdit
~/.ssh/configsshHost remote-gateway HostName <REMOTE_IP> User <REMOTE_USER> LocalForward 18789 127.0.0.1:18789 IdentityFile ~/.ssh/id_rsa
Replace
<REMOTE_IP><REMOTE_USER>bashssh-copy-id -i ~/.ssh/id_rsa <REMOTE_USER>@<REMOTE_IP>
Store the token in config so it persists across restarts:
bashopenclaw config set gateway.remote.token "<your-token>"
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 start automatically at login, restart on crash, and keep the forwarded port live.
Check if the 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
| Config entry | 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 (port-forwarding only) |
text KeepAlive | Automatically restarts the tunnel if it crashes |
text RunAtLoad | Starts the tunnel when the LaunchAgent loads at login |
© 2024 TaskFlow Mirror
Powered by TaskFlow Sync Engine