The dashboard opens instantly on the Mac that runs OpenClaw. You try the same address on your phone, or on the laptop in the next room, and the browser spins for a few seconds and gives up. No login screen. No error from OpenClaw. Nothing.
That is almost never a firewall and almost never a broken install. The gateway is bound to loopback, which means the process only accepts connections addressed to 127.0.0.1. Your phone is not 127.0.0.1. One config value controls this, and three other checks decide whether the page actually works once it loads.
I run OpenClaw on a Mac mini at 192.168.1.72 and hit every one of these failures while setting up remote access. Here is the ladder, from proving the gateway is alive to reaching it from outside your network.

Why the page dies before OpenClaw sees the request
A listening socket is bound to a specific address. When the bind address is 127.0.0.1, the kernel only accepts packets that arrive on the loopback interface. A packet from your phone arrives on en0 with a destination of 192.168.1.72, and there is no socket there. The kernel sends a reset. The gateway never logs it, because the gateway was never asked.
That distinction matters when you are debugging. A firewall drops packets silently. This refuses them immediately, which is why the browser fails fast instead of hanging.
$ curl -s -o /dev/null -w "%{http_code}\n" http://127.0.0.1:19999/
200
$ curl -s -o /dev/null -w "%{http_code}\n" http://192.168.1.72:19999/
000
$ netstat -an | grep 19999 | head -3
tcp4 0 0 127.0.0.1.19999 127.0.0.1.52610 ESTABLISHED
tcp4 0 0 127.0.0.1.19999 127.0.0.1.52611 ESTABLISHED
HTTP 200 on loopback, HTTP 000 on the LAN address, and every socket in the table owned by 127.0.0.1. That is the whole diagnosis in three commands.
One thing that misleads people here: discovery still works. openclaw gateway discover announces the machine over Bonjour and prints ws://Fungs-Mac-mini.local:19999. That is a broadcast, not a connection. Finding the gateway and being allowed to talk to it are different problems.
Level 1: confirm the gateway is alive before you touch config
If the service is dead, binding changes nothing. Check the service first, then the probe, then health.
That Probe note line is the giveaway. It tells you the service is healthy and the network surface is closed at the same time. Most people read “running, probe ok” and assume the network is fine.
openclaw gateway probe adds one useful detail. It prints the gateway host as Fungs-Mac-mini.local (192.168.1.72). The machine knows its LAN address; it just is not listening there. If the service is not running at all, fix that first with our guide to starting a gateway that crashes or refuses to boot, then come back.
Level 2: bind to the LAN without leaving the door open
The bind setting accepts loopback, lan, tailnet, auto, or custom with customBindHost. For a trusted home network, lan is the right level. Three things have to be true at once, and people usually set only the first.
1. Move the listener
Use a patch instead of three separate config set calls, because the array value is easier to get right in one write:
openclaw config patch --stdin <<'EOF'
{
gateway: {
bind: "lan",
controlUi: {
allowedOrigins: ["http://192.168.1.72:19999"]
}
}
}
EOF
openclaw gateway restart
Restart is required. gateway.bind has a reload kind of restart, so a running gateway will not pick it up live.
2. Make sure a token exists
A token is required for any non-loopback bind. My config reads it from the environment:
{
"auth": {
"mode": "token",
"token": { "source": "env", "provider": "default", "id": "OPENCLAW_GATEWAY_TOKEN" }
}
}
If gateway.auth.mode is none and you bind to the LAN, you have published an admin-capable API to every device on the network, including guests and whatever IoT gadget is on the same subnet. Do not do that as a shortcut. Token mode is the minimum.
3. Add the exact browser origin
This is the step that produces the most confused support threads. The Control UI is static HTML served over HTTP. The actual session runs over a WebSocket, and the WebSocket handshake checks the browser origin against gateway.controlUi.allowedOrigins. For any non-loopback deployment that list is required unless you enable the dangerously named Host-header fallback, which you should not.
So the page can load perfectly and still do nothing. Tabs render, the chat box appears, and every action fails, because the HTTP request passed and the WebSocket did not. If the UI loads but never connects, look at the origin list before you look at anything else.
Format rules I have tripped over: full origins only, with scheme and port, no trailing path. http://192.168.1.72:19999 works. 192.168.1.72:19999 does not, and neither does http://192.168.1.72:19999/ with a slash. Setting ["*"] also “works” and hands any website you visit the ability to open a socket to your agent. Skip it.
4. Approve the device
The first browser that connects from a new origin is treated as a new device. Expect a prompt or a blocked session until you approve it. There is a config switch called dangerouslyDisableDeviceAuth, and the name is accurate. Use it for a five minute test on a network you control, then turn it back off.
One honest note about my own setup: my config has controlUi.allowInsecureAuth set to true. That was harmless while the gateway only listened on loopback. The moment you bind to lan it stops being harmless, because it loosens the browser auth checks for everyone who can reach the port. If you copied a config from a tutorial, audit that key before you expose the port.
Level 3: leave the house with a tailnet
There are two different Tailscale paths and they are not interchangeable.
Bind to the tailnet interface. Set gateway.bind to tailnet. The gateway listens on the Tailscale address, and only devices in your tailnet can route to it. Simple, and no proxy in the middle.
Publish through Tailscale Serve. Keep the listener on loopback and let Tailscale proxy to it. Set gateway.tailscale.mode to serve, leave resetOnExit on so you do not leave a stale route behind, and optionally set serviceName to something like svc:openclaw. To test it in the foreground before you commit:
openclaw gateway --tailscale serve
Serve is the better option for most people because it gives you HTTPS on a stable MagicDNS name. That kills two problems at once: the origin check gets a real, constant HTTPS origin, and you are not sending a token over plain HTTP on a coffee shop network.
If you enable gateway.auth.allowTailscale, Tailscale identity can satisfy the gateway auth check, which is convenient when the tailnet is your security boundary. Do not combine that with a wide open proxy in front of the same port.
funnel is the public internet mode. It requires a password, it exposes the gateway to anyone with the URL, and it is the wrong default. Use it only if you genuinely need public reachability and you have thought about what an admin-capable agent means in that position.
Level 4: put it behind your own domain
If you already run a reverse proxy, keep the gateway on loopback and terminate TLS at the proxy. The nginx block needs the WebSocket upgrade headers, or the UI will load and then silently fail to connect:
location / {
proxy_pass http://127.0.0.1:19999;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Host $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
Then set gateway.trustedProxies to the proxy address only, for example ["127.0.0.1/32"], so forwarded identity headers from anywhere else are ignored. Add the public HTTPS origin, with no path, to allowedOrigins. If you serve the UI under a subpath, set gateway.controlUi.basePath to match, otherwise the assets 404 while the root document loads.
The failure mode here is a mismatch: HTTPS page, but allowedOrigins still lists the old http:// origin. The scheme is part of the origin. Rebuild the entry whenever the URL changes.
The service argument that overrides your config
This one cost me a full hour. I changed gateway.port in the config, restarted, and the gateway came back on the old port. The reason is in the service definition:
Command: /usr/local/bin/node .../index.js gateway --port 19999 Service env: OPENCLAW_GATEWAY_PORT=19999
The port is baked into the launchd arguments and the service environment. Editing the config does not rewrite the service. To actually move it, reinstall the service with the new port:
openclaw gateway install --force --port 18790 openclaw gateway status
Then update allowedOrigins to the new port, because the origin includes it. If you skip that, you get the load but no connect failure again, on a brand new port.

Common mistakes
- Binding to LAN and stopping there. No token, no origin, and an admin API open to the whole subnet.
- Putting a path in allowedOrigins. Origins are scheme, host, and port. Nothing after the port.
- Blaming the firewall. A refused connection means nothing is listening. A firewall gives you a timeout, not an instant reset.
- Changing the port in config only. The service arguments win until you reinstall.
- Using
["*"]to “fix” the origin error. It removes the check that protects your agent from any page you happen to visit. - Leaving
allowInsecureAuthon after going non-loopback. Fine on loopback, careless on a LAN. - Port forwarding on the router for a tailnet setup. Tailscale does not need it, and opening the port exposes the gateway directly.
A refused connection and a crashed service look similar from a browser but need different fixes. Our startup guide walks the six reasons a gateway will not stay up, with the exact log lines to check.
Fix the gateway startupNo, not for LAN or tailnet access. On your home network the router already forwards traffic between devices. Port forwarding is only needed for direct internet exposure, which is the riskiest option and rarely the right one. If you use Tailscale, nothing is forwarded at all.
Almost always the origin allowlist. The HTML is served over HTTP, but the session runs over a WebSocket, and that handshake checks the browser origin against gateway.controlUi.allowedOrigins. Add the exact origin, with scheme and port and no path, then restart the gateway.
The probe reports the host addresses it can discover for the machine, not the address the socket is bound to. It is telling you where the gateway could be reached if it were listening there. Check the bind line in gateway status to see the actual listener.
Yes, but changing gateway.port in the config is not enough when OpenClaw runs as a service. The port is baked into the service arguments and environment. Reinstall with openclaw gateway install –force –port YOUR_PORT, then update allowedOrigins because the origin includes the port.
It is acceptable on a network you control, with token auth on and the origin list tight. It is not safe on shared Wi-Fi, and it is not safe with auth mode none. Every device on the subnet can reach an admin-capable API, so treat the LAN bind as a trusted-network setting, not a default.
Final Thoughts
Remote access to OpenClaw is four gates in a row: a listener on the address you dial, a token the client can present, an origin the WebSocket accepts, and a device you approved. Each gate fails differently, and the symptoms tell you which one you are stuck on. A refused connection is the bind. A page that loads but never connects is the origin. A login loop is the token. Nothing at all, on a device that used to work, is usually the device approval.
Start at Level 1, change one layer at a time, and verify with curl before you open a browser. If you still need the base install, the 30 minute setup walkthrough covers the config file from scratch. And once remote access works, the next problem is keeping the machine awake, which is what running your agent 24/7 is about.

