Engine Connection Modes
Run xCloud on your laptop, another PC, or a remote OpenClaw host.
xCloud can talk to different OpenClaw engines. The desktop app is always the control surface, but the engine can run locally, on another computer you own, or on a remote server.
Modes
| Mode | Best for | How xCloud connects |
|---|---|---|
| Local | Personal use, development, fast setup | Directly to the embedded local gateway |
| Mac mini / PC | Always-on home or office computer | Directly over LAN to ws://<host>:18789 |
| OpenClaw host / VPS | Cloud-hosted engine, remote uptime | Through an SSH tunnel to ws://127.0.0.1:<local-port> |
How It Works
xCloud Desktop
|
| WebSocket + token + device signature
v
OpenClaw Engine
|
| agents, tools, channels, workspaces
v
Local files / remote host / messaging platformsThe OpenClaw engine is the runtime. It owns agents, sessions, tools, channels, and workspace files. xCloud Desktop connects to it as the operator UI.
Choosing A Mode
Choose the machine based on where you want the agents to actually run.
| Choose | When |
|---|---|
| Local | You are testing xCloud, building agents, or running everything from your laptop |
| Mac mini / PC | You have a home server, office PC, Mac mini, old laptop, or mini PC that can stay online |
| OpenClaw host / VPS | You want the engine reachable from anywhere without depending on your home network |
The important rule: channels, agents, memories, workspaces, and connected providers belong to the active engine. If you switch engines, xCloud will show the agents and channels from that engine.
Local Engine
Use Local when you want everything on the same machine.
- xCloud starts and manages the OpenClaw sidecar.
- The gateway normally runs on port
18789. - No URL or token entry is needed in normal use.
- Agent workspaces live under
~/.openclaw/workspace.
In the app, go to Settings > Engine > Local and turn it on.
Mac mini / PC Engine
Use Mac mini / PC when you want any always-on computer running OpenClaw on your local network. It can be a Mac mini, Windows PC, Linux box, home server, old laptop, or mini PC.
Run this on that computer:
curl -fsSL https://xcloud.dev/setup-remote.sh | bash -s -- --lanThe command installs OpenClaw, installs the xCloud runtime helper, starts the gateway, and prints a connection block like:
URL: ws://192.168.1.50:18789
Token: <generated-token>
Paste this in xCloud:
xcloud://engine?mode=mac-mini&url=ws://192.168.1.50:18789&token=<generated-token>In xCloud, open Settings > Engine > Mac mini / PC, paste the whole block into Paste connection block, then click Paste & connect.
Mac mini / PC only needs URL and Token because xCloud connects directly to the gateway over your LAN.
Requirements
- The computer must stay awake while agents are running.
- Your laptop and the engine computer must be on the same network.
- Port
18789must be reachable from your laptop. - If the computer changes IP often, use a static DHCP lease or local DNS name.
When To Avoid This Mode
Avoid this mode if you need access from outside your network and you do not want to configure VPN, Tailscale, ZeroTier, or router rules. In that case, use OpenClaw host / VPS instead.
OpenClaw Host / VPS
Use OpenClaw host when the engine runs on a VPS or any remote server.
Run this on the server:
curl -fsSL https://xcloud.dev/setup-remote.sh | bash -s -- --sshThe command installs OpenClaw, keeps the gateway bound to the remote machine, and prints SSH tunnel details:
Host: 203.0.113.10
SSH user: root
SSH port: 22
Remote port: 18789
Local tunnel port: 18790
SSH tunnel: ssh -N -L 18790:127.0.0.1:18789 root@203.0.113.10
URL: ws://127.0.0.1:18790
Token: <generated-token>
Paste this in xCloud:
xcloud://engine?mode=vps&host=203.0.113.10&user=root&sshPort=22&remotePort=18789&localPort=18790&token=<generated-token>In xCloud, open Settings > Engine > OpenClaw host, paste the whole block, then click Paste & connect.
The app stores:
| Field | Meaning |
|---|---|
| SSH Host | Public IP or DNS name of the server |
| SSH User | User xCloud should use for the tunnel |
| SSH Port | SSH port, usually 22 |
| Local Tunnel | Local port opened on your laptop |
| Gateway URL | Local WebSocket URL, usually ws://127.0.0.1:18790 |
| Token | OpenClaw gateway token generated by setup |
For VPS mode, OpenClaw is not running on your laptop. xCloud opens a local SSH tunnel, then connects to 127.0.0.1 because that local port forwards traffic to the remote OpenClaw gateway.
Why VPS Uses A Tunnel
The gateway should not be exposed publicly unless you know what you are doing. In VPS mode, OpenClaw can stay bound to the server itself, and xCloud connects through SSH:
xCloud Desktop
-> ws://127.0.0.1:18790
-> SSH tunnel
-> VPS 127.0.0.1:18789
-> OpenClaw GatewayThis keeps the gateway private while still letting your local xCloud app control the remote engine.
Requirements
- SSH access from your laptop to the server.
curl,bash,openssl,node, andnpmavailable on the server. The setup script installs Node on common Linux hosts when possible.- Port
22or your custom SSH port reachable from your laptop. - Enough disk space for OpenClaw, agent workspaces, and npm packages.
Repair Or Update A Remote Engine
If a remote engine is already connected but tools, agents, or channels stop behaving correctly, run:
curl -fsSL https://xcloud.dev/setup-remote.sh | bash -s -- --update-onlyThis refreshes the xCloud runtime helper, repairs required plugins, restarts the gateway, and keeps the current token.
Use this when:
- xCloud connects, but agent tools are missing.
- Imported agents appear, but some engine helper actions fail.
- Channels used to work and then stopped after an OpenClaw update.
- The gateway is running, but xCloud-specific commands are unavailable.
Switching Engines
Each engine mode keeps its own saved connection values.
- Go to Settings > Engine.
- Open Local, Mac mini / PC, or OpenClaw host.
- Save the connection details.
- Turn on Active for the engine you want to use.
When the active engine changes, xCloud reconnects and loads the agents, channels, settings, and workspaces from that engine.
Error Handling
xCloud connection errors usually come from one of four layers:
| Layer | What can fail |
|---|---|
| Network | Wrong host, blocked port, machine asleep, no internet |
| Tunnel | SSH credentials, local port already used, tunnel process stopped |
| Gateway | OpenClaw not running, wrong bind mode, port conflict |
| Auth | Wrong token, device not approved, stale saved config |
Start from the outside and move inward: can you reach the machine, can you open the tunnel, is the gateway running, and is the token correct?
Quick Checks
Local
openclaw gateway statusIf the gateway is stopped, restart the app or run:
openclaw gateway restartMac mini / PC
From your laptop:
nc -vz 192.168.1.50 18789If that fails, the engine computer is unreachable, asleep, on another network, or blocking port 18789.
On the engine computer:
openclaw gateway statusVPS
First confirm SSH works:
ssh root@203.0.113.10Then test the tunnel manually:
ssh -N -L 18790:127.0.0.1:18789 root@203.0.113.10In another terminal:
nc -vz 127.0.0.1 18790If the local tunnel works, xCloud should use ws://127.0.0.1:18790.
Common Errors
| Problem | What to check |
|---|---|
| Mac mini / PC does not connect | Confirm both machines are on the same network and port 18789 is reachable |
| VPS does not connect | Confirm SSH works from your laptop before opening xCloud |
| Token rejected | Re-run setup or update the saved token in Settings |
| Channels show connected but do not reply | Check the active engine; channels belong to the engine where they were configured |
| Agents missing after switching | Agents are stored per engine, so switch back to the engine where they were created |
Connection timed out | The host or tunnel is not reachable |
ECONNREFUSED | The port is reachable, but OpenClaw is not listening there |
WebSocket closed | Gateway crashed, restarted, or rejected auth |
Permission denied (publickey) | SSH key or user is wrong |
Address already in use | Local tunnel port is already taken; choose another local tunnel port |
| Setup command fails at npm install | Check Node/npm installation and available disk space |
| Setup command prints no token | Re-run the setup command and check shell output for earlier errors |
Recovery Steps
Use this order when something is broken:
- Confirm the active engine in Settings > Engine.
- Re-paste the latest connection block from the engine setup command.
- Run
openclaw gateway statuson the machine where OpenClaw runs. - For VPS, verify SSH manually.
- Run the remote helper update command.
- Restart xCloud Desktop.
If a channel does not respond after reconnecting, disconnect and reconnect that channel on the same engine where it should run. Channels are not global across engines.