Errors / EADDRINUSE
Fix: Port Already in Use
Error: "EADDRINUSE: address already in use :::18789"
What It Means
Port 18789 (the default OpenClaw gateway port) is already being used by another process. Only one program can listen on a port at a time — like having only one chair at a desk.
Common Causes
- •OpenClaw gateway is already running
- •Previous OpenClaw process didn't shut down properly
- •Another application is using port 18789
- •Accidentally started multiple OpenClaw instances
Ask Your Agent to Fix This
Copy this prompt and send it to your OpenClaw agent:
Check what's using port 18789. If it's an old OpenClaw process,
kill it. Then start a fresh gateway instance and tell me what
was using the port.
How to Fix It
1. Check What's Using the Port
# macOS
lsof -i :18789
# Linux
sudo lsof -i :18789
# Windows (PowerShell)
netstat -ano | findstr :18789
2. Stop the Existing Process
# Kill by PID (replace 12345 with the PID)
kill 12345
# Or kill all processes using the port
kill $(lsof -t -i:18789)
# If running as a service (macOS)
launchctl stop openclaw
# If running as a service (Linux)
sudo systemctl stop openclaw
3. Use a Different Port
If you can't stop the other process:
openclaw gateway --port 18790
Or add to your config:
{ "gateway": { "port": 18790 } }
4. Restart the Service
openclaw gateway restart
How to Prevent This
- ✓Run
openclaw gateway startinstead of running manually each time - ✓Use the daemon/service (installed via
openclaw onboard --install-daemon) - ✓Check
openclaw gateway statusbefore starting
Related Errors
Related Guides
Still having trouble?
Ask on Discord