$cd ../troubleshooting/
Medium#Docker

Docker ポート 18789 競合

// "Bind for 0.0.0.0:18789 failed: port is already allocated" — 素早い修正方法。

error.log

🔍 エラーメッセージ

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

✅ ステップバイステップの修正

1. ポート 18789 を使用しているプロセスを見つける
$ lsof -i :18789 # macOS / Linux
$ netstat -ano | findstr 18789 # Windows
2. オプション A — 競合プロセスを終了する
$ kill -9 <PID>
# Then restart OpenClaw
$ docker compose up -d
3. オプション B — OpenClaw のポートを変更する
# docker-compose.yml
services:
openclaw:
ports:
- "18888:18789" # host:container

❓ FAQ

Q1. 任意のポートが使える?

はい。docker-compose.ymlのマッピング左側を変更。