Port Already in Use
Fix "address already in use" errors when starting Moltbot.
Port Already in Use
Getting "address already in use" or "EADDRINUSE" errors? Another process is using the port Moltbot needs.
Symptoms
Error: listen EADDRINUSE: address already in use :::3000or
Error starting server: port 3000 is already in useLikely Causes
- Another Moltbot instance is running
- Different application using the same port
- Previous process didn't shut down cleanly
- Development server (Next.js, Vite, etc.) is running
Fix Steps
1. Find What's Using the Port
On Linux/macOS:
lsof -i :3000On Windows:
netstat -ano | findstr :30002. Stop the Conflicting Process
If it's another Moltbot instance:
docker stop moltbot
docker rm moltbotIf it's another process (by PID):
kill -9 <PID>3. Or Change Moltbot's Port
In your .env file:
PORT=3001 # Use a different portIn Docker:
docker run -p 3001:3000 moltbot/moltbotIn docker-compose.yml:
ports:
- "3001:3000"Verify
After fixing, verify nothing is using the port:
lsof -i :3000 # Should return nothingThen start Moltbot:
docker-compose up -d
docker logs moltbot # Check for successful startupPrevent
- Use unique ports for each service
- Always stop containers before restarting:
docker-compose down - Use
docker-compose restartinstead ofupfor restarts