Configure OpenClaw Gateway Ports & Remote Access
Ever tried to manage a service remotely only to find yourself fighting with port conflicts or firewall rules? It’s a classic headache that every developer faces when moving from local development to a real-world setup.
When you start working with the OpenClaw Gateway ports, knowing which ports to open is the first step to a smooth connection. These ports handle your main traffic and internal communication.
Check Default OpenClaw Gateway Ports
Section titled “Check Default OpenClaw Gateway Ports”When you start working with the OpenClaw Gateway, knowing which ports to open is the first step to a smooth connection. These ports handle your main traffic and internal communication.
| Port | Use |
|---|---|
| 18789 | HTTP/WS (main port) |
| 18790 | gRPC (internal RPC) |
In remote mode, you use port 18789 (or your override) for both the Control UI and the Gateway WebSocket.
Resolve Gateway Port Conflict Errors
Section titled “Resolve Gateway Port Conflict Errors”If you see an error saying the Gateway is already running, it usually means a previous instance didn’t shut down properly or another app is squatting on your port. You can quickly clear this up by checking the process status or manually clearing the port.
- Check if the daemon is alive.
- Stop the service.
- Find the process ID using the port.
- Kill the process manually.
# Check if the daemon is aliveopenclaw gateway status
# Stop the serviceopenclaw gateway stop
# If you forcibly need the portlsof -i :18789kill -9 <pid>Use the OpenClaw CLI in Remote Mode
Section titled “Use the OpenClaw CLI in Remote Mode”You can control your OpenClaw instance from anywhere by pointing the CLI to a remote URL instead of your local machine. This is perfect for managing a Gateway running on a VPS or a home server.
- Add the
--remote <gateway-url>flag to your commands. - Set the
OPENCLAW_GATEWAY_URLenvironment variable to save time.
openclaw status --remote http://my-vps-tailnet:18789If the Gateway uses token auth, you must also set OPENCLAW_GATEWAY_TOKEN or use the --token flag.
Bind the Gateway to a Tailnet Address
Section titled “Bind the Gateway to a Tailnet Address”For those who love private networking, you can bind the OpenClaw Gateway directly to your Tailscale address for secure access without exposing it to the public internet. This setup ensures that only devices on your private network can talk to the service.
- Set
gateway.bind: "tailnet"in your configuration. - Ensure Tailscale is running on the host so it has a 100.x address.
If Tailscale isn’t running or has no IP, the Gateway won’t start. The error usually says something like:
Failed to bind to tailnet: no Tailscale IP
{ gateway: { bind: "lan", // or "tailnet" for Tailscale-only port: 18789, auth: { mode: "token", token: "replace-me-with-a-strong-token" } }}openclaw gateway --tailscale servecurl http://localhost:18789/healthOpenClaw Expert
Still stuck?
If this page didn't answer your case, ask OpenClaw Expert for step-by-step guidance.