$cd ../troubleshooting/
Medium#Docker

Docker Port 18789 Conflict

// "Bind for 0.0.0.0:18789 failed: port is already allocated" β€” here's the fast fix.

error.log

πŸ” Error Message

Error response from daemon: driver failed programming external
connectivity on endpoint openclaw:
Bind for 0.0.0.0:18789 failed: port is already allocated
fix.sh

βœ… Step-by-Step Fix

1. Find what is using port 18789
$ lsof -i :18789 # macOS / Linux
$ netstat -ano | findstr 18789 # Windows
2. Option A β€” Kill the conflicting process
$ kill -9 <PID>
# Then restart OpenClaw
$ docker compose up -d
3. Option B β€” Change OpenClaw port
# docker-compose.yml
services:
openclaw:
ports:
- "18888:18789" # host:container

❓ FAQ

Q1. Can I use any port?

Yes. Change the left side of the port mapping in docker-compose.yml (e.g., '19000:18789'). The container port (right side) stays 18789.