← All errors · Replit
Error: listen EADDRINUSE: address already in use
Exact error
Error: listen EADDRINUSE: address already in use :::3000
What it means
Another process is already listening on the port your server is trying to use.
Likely causes
- A previous run of the server is still running.
- Two servers (e.g. API and frontend) configured for the same port.
How to fix it
Stop the previous process (in Replit, stop and re-run; locally find it):
lsof -i :3000 kill <PID>Read the port from the environment with a fallback, and bind to 0.0.0.0 so hosted environments can reach it:
const port = process.env.PORT || 3000; app.listen(port, '0.0.0.0', () => console.log('listening on', port));
Related errors
Get new fixes weekly
No spam. Unsubscribe anytime. Privacy