Guide

What Port Does OpenClaw Use?

OpenClaw gateway listens on port 18789 by default. Here's how to check it, change it, and fix common port issues.

Quick Answer

OpenClaw's default port is 18789. Change it with openclaw config set gateway.port 9999. Or use ClawSquire which handles port forwarding automatically via SSH tunnel โ€” users don't need to worry about ports.

Recommended

๐Ÿ–ฑ๏ธ Use ClawSquire

ClawSquire handles port forwarding automatically. When connecting to a remote server, it creates an SSH tunnel to port 18789 (or your custom port) and opens the Dashboard locally โ€” no firewall or port forwarding needed. You don't need to worry about ports.

ClawSquire Dashboard showing OpenClaw version, Quick Actions, and Config โ€” connects to remote OpenClaw via SSH tunnel so port 18789 is handled automatically

CLI Reference

Default Port

OpenClaw gateway listens on port 18789 by default. This port is used for:

  • The web Dashboard (Control UI)
  • WebSocket connections from clients
  • API endpoints

How to Check

openclaw gateway status

Or:

lsof -i :18789

How to Change the Port

openclaw config set gateway.port 19000
openclaw gateway restart

Then access the Dashboard at http://localhost:19000

โŸฉCommon Port Issues

EADDRINUSE: port 18789 already in use+
Another process is using the port. Kill it: kill $(lsof -t -i :18789) or use a different port via openclaw config set gateway.port 19000
Connection refused on port 18789+
Gateway not running. Start it: openclaw gateway
Can't access from another device+
The gateway binds to localhost by default. Use SSH tunnel or reverse proxy for remote access โ€” see Remote access guide

Port Forwarding for Docker

docker run -p 19000:18789 openclawai/openclaw:latest

Maps container port 18789 to host port 19000.

Firewall Rules

If exposing directly (NOT recommended):

sudo ufw allow 18789/tcp

Warning: Only do this behind a reverse proxy with HTTPS. Never expose the raw gateway port to the public internet.

Next Steps