OpenClaw gateway port 18789 already in use
A previous gateway instance crashed without releasing port 18789, or an old Clawdbot service from before your upgrade still holds it, so the new gateway hits the port and restart-loops. Find the process with lsof -i :18789 and kill it; if you migrated from Clawdbot, stop and disable clawdbot-gateway, then start the OpenClaw gateway again.
Likely cause
A previous gateway instance crashed without releasing port 18789. After upgrading from Clawdbot, the old service may still hold the port, causing restart loops.
The fix
- 1 Find and kill the stale process: lsof -i :18789, then kill that PID.
- 2 If migrating from Clawdbot, stop and disable its service: systemctl --user stop clawdbot-gateway && systemctl --user disable clawdbot-gateway.
- 3 Start the OpenClaw gateway again.
lsof -i :18789Hit a different error?
Paste any agent error and get the cause and fix in seconds.
Frequently asked questions
Nothing should be using 18789, but it says address already in use.
A previous gateway crashed without releasing the port, so a zombie process still holds it. Run lsof -i :18789 to find the PID and kill it before restarting.
I just upgraded from Clawdbot and it won't start. Why?
The old Clawdbot gateway service can still own port 18789. Stop and disable it (systemctl --user stop/disable clawdbot-gateway) so OpenClaw can bind the port.
How do I stop the restart loop for good?
Make sure only one gateway service is enabled. Disable any leftover Clawdbot unit, confirm the port is free with lsof, then start the OpenClaw gateway as the single owner of 18789.
Stop firefighting agent errors
Decoding errors one at a time is the manual version of what BetterClaw automates. Run your OpenClaw agents hosted with managed models, retries and config validation built in.
$19/month per agent · BYOK · 7-day money-back guarantee
