Port already in use
Applies to: all
Symptom
Starting a service fails with one of:
Error: listen EADDRINUSE: address already in use 127.0.0.1:3001
Error: bind: address already in use (0.0.0.0:5433)
docker: Error response from daemon: driver failed programming external connectivity ... 0.0.0.0:9000 -> container: address already in useLikely cause
Another process is already bound to the port. For HiveCFM the usual suspects are:
| Port | Normally bound by |
|---|---|
| 3000 | pnpm --filter @hivecfm/web dev (native dev default) or an unrelated Ruby/Puma process on shared VMs |
| 3001 | hivecfm-core Docker container (HIVECFM_PORT=3001) |
| 3002 | Superset |
| 4100 | hivecfm-dev-hub (this site, next dev -p 4100) |
| 5433 | Postgres exposed by docker-compose.dev-ports.yml |
| 6380 | RedisRedisIn-memory key-value store used for caching, sessions, and rate limiting. Runs on port 6380 locally. exposed by docker-compose.dev-ports.yml |
| 9000 / 9001 | MinIOMinIOS3-compatible object storage for survey attachments and uploads. Runs locally; swaps for real S3 in prod. S3 API / MinIO console |
A leftover Docker container, a previous pnpm dev that did not exit cleanly, or a system service that was already using the port is almost always the culprit.
Fix
Find what is on the port
On Linux or macOS:
sudo lsof -i :3001
# or, without sudo:
ss -ltnp | grep :3001On Windows (PowerShell or cmd):
netstat -ano | findstr :3001
tasklist /FI "PID eq <pid-from-above>"Decide whether it is a HiveCFM container
docker ps --format "table {{.Names}}\t{{.Ports}}" | grep 3001If it is a HiveCFM container, stop it instead of killing the process:
docker compose stop hivecfm-coreKill the process if it is not a container
⚠️
fuser -k and kill -9 terminate the target process immediately with no chance to flush state. Save your work first.
# Linux / macOS
sudo fuser -k 3001/tcp
# or, targeted by PID:
kill -9 <pid># Windows
taskkill /PID <pid> /FRe-run the failing command
pnpm --filter @hivecfm/web dev # or docker compose up -dVerify
sudo lsof -i :3001 # no output = free
curl -s http://localhost:3001 # 200 once the app bootsPrevent
- Always stop services with their own command (
docker compose down,Ctrl+Cinpnpm dev) rather than closing the terminal. - If you change
HIVECFM_PORTin.env, also updateWEBAPP_URLandNEXTAUTH_URLso the app and the listener agree. - On shared dev VMs, keep the Run it locally port map pinned — port 3000 is commonly taken, which is exactly why HiveCFM uses 3001 in Docker.
Was this page helpful?