#cant start gateway

1 messages · Page 1 of 1 (latest)

distant burrow
#

│ Port 18789 is already in use. │
│ - pid 601410 root: openclaw-gateway (*:18789) │
│ - Gateway already running locally. Stop it (openclaw gateway stop) or use a different │
│ port.

i tried so many openclaw doctor

opal duneBOT
#

To help others find answers, you can mark your question as solved via Right click solution message -> Apps -> ✅ Mark Solution

stoic steppeBOT
#

That error means doctor isn’t the real problem — a gateway is already running on port 18789 as root.

Please paste this first:

openclaw --version
openclaw gateway status

Then try stopping the root-owned gateway:

sudo openclaw gateway stop
openclaw gateway status

If it still says PID 601410 is holding the port, check what owns it:

#
ps -fp 601410
sudo lsof -nP -iTCP:18789 -sTCP:LISTEN

Most likely you accidentally started OpenClaw with sudo, or installed a root service. Don’t keep running openclaw doctor repeatedly — it won’t fix “port already in use” if another gateway process is already listening.

Docs: https://docs.openclaw.ai/help/troubleshooting 🦐

distant burrow
#

Service: systemd (enabled)
File logs: /tmp/openclaw/openclaw-2026-04-28.log
Command: /usr/bin/node /usr/lib/node_modules/openclaw/dist/index.js gateway --port 18789
Service file: ~/.config/systemd/user/openclaw-gateway.service
Service env: OPENCLAW_GATEWAY_PORT=18789

Config (cli): ~/.openclaw/openclaw.json
Config (service): ~/.openclaw/openclaw.json

Gateway: bind=lan (0.0.0.0), port=18789 (service args)
Probe target: ws://127.0.0.1:18789
Dashboard: http://78.47.56.201:18789/
Probe note: bind=lan listens on 0.0.0.0 (all interfaces); probing via 127.0.0.1.

Runtime: running (pid 601624, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable

Listening: *:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

stoic steppeBOT
#

Good news: this output means the gateway is started successfully now.

Key lines:

Runtime: running
Connectivity probe: ok
Capability: admin-capable
Listening: *:18789
Dashboard: http://78.47.56.201:18789/

So if you run openclaw gateway start again, it may complain because the port is already occupied by the already-running service. That’s expected.

Next:

#
openclaw status

If you just want to restart it:

openclaw gateway restart

If you want to run the gateway manually in the foreground, stop the systemd service first:

openclaw gateway stop

Also: you’re bound to 0.0.0.0 / LAN, so that dashboard may be reachable from the public internet on your VPS. Make sure you have gateway auth configured and/or firewall the port if you don’t intend that.

distant burrow
#

but Gateway not reachable. Is it running and accessible?
Gateway target: ws://127.0.0.1:18789
Source: local loopback
Config: /root/.openclaw/openclaw.json
Bind: lan
Hint: run openclaw doctor.

when im runing openclaw logs --follow

stoic steppeBOT
#

That message is from logs --follow trying to connect to the gateway, but the key clue is:

Config: /root/.openclaw/openclaw.json

So you’re probably mixing root/sudo and non-root OpenClaw commands. Pick one user and stay consistent — don’t alternate sudo openclaw ... and openclaw ....

First run:

openclaw --version
whoami
openclaw gateway status

If gateway status still says Runtime: running + Connectivity probe: ok, the gateway is fine and you can read logs directly with:

#
tail -n 200 -f "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

If gateway status now says unreachable, restart it:

openclaw gateway restart
openclaw gateway status --deep

Then paste the output of those 3 commands (version, whoami, gateway status). doctor won’t fix this if the issue is “wrong user/config talking to the wrong gateway.” 🦐

distant burrow
#

Runtime: running (pid 601813, state active, sub running, last exit 0, reason 0)
Connectivity probe: ok
Capability: admin-capable

Listening: *:18789
Troubles: run openclaw status
Troubleshooting: https://docs.openclaw.ai/troubleshooting

stoic steppeBOT
#

Yep — that confirms it’s running and reachable locally now.

So the original “port already in use” is not a startup failure anymore; it just means don’t start a second gateway on the same port.

Next check the actual problem with:

openclaw status --all

If only openclaw logs --follow is failing, use the file log fallback:

tail -n 200 -f "$(ls -t /tmp/openclaw/openclaw-*.log | head -1)"

If your goal is the web dashboard from outside the VPS, open: