Skip to main content

Running OpenClaw.app with a Remote Gateway

OpenClaw.app uses SSH tunneling to connect to a remote gateway. This guide shows you how to set it up.

Overview

Quick Setup

Step 1: Add SSH Config

Edit ~/.ssh/config and add:
Replace <REMOTE_IP> and <REMOTE_USER> with your values.

Step 2: Copy SSH Key

Copy your public key to the remote machine (enter password once):

Step 3: Set Gateway Token

Step 4: Start SSH Tunnel

Step 5: Restart OpenClaw.app

The app will now connect to the remote gateway through the SSH tunnel.

Auto-Start Tunnel on Login

To have the SSH tunnel start automatically when you log in, create a Launch Agent.

Create the PLIST file

Save this as ~/Library/LaunchAgents/ai.openclaw.ssh-tunnel.plist:

Load the Launch Agent

The tunnel will now:
  • Start automatically when you log in
  • Restart if it crashes
  • Keep running in the background
Legacy note: remove any leftover com.openclaw.ssh-tunnel LaunchAgent if present.

Troubleshooting

Check if tunnel is running:
Restart the tunnel:
Stop the tunnel:

How It Works

OpenClaw.app connects to ws://127.0.0.1:18789 on your client machine. The SSH tunnel forwards that connection to port 18789 on the remote machine where the Gateway is running.