← All errors · ReplitNode & Python runtime errors

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

How to fix it

  1. Stop the previous process (in Replit, stop and re-run; locally find it):

    lsof -i :3000
    kill <PID>
  2. 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));

Prevent this next time

Guide: catch outages before your users do.

FAQ

What does "Error: listen EADDRINUSE: address already in use" mean?

Another process is already listening on the port your server is trying to use.

What usually causes it?

A previous run of the server is still running. Two servers (e.g. API and frontend) configured for the same port.

How do I fix it?

1. Stop the previous process (in Replit, stop and re-run; locally find it): 2. Read the port from the environment with a fallback, and bind to 0.0.0.0 so hosted environments can reach it:

Related errors

Get new fixes weekly

No spam. Unsubscribe anytime. Privacy