Node.js

Error: listen EADDRINUSE — address already in use

Node.js

Error: listen EADDRINUSE: address already in use :::3000 (or another port).

What it means (root cause)

Another process is already bound to the port your server is trying to listen on — a previous instance that did not exit, or a different app on the same port.

The symptom developers actually see: Error: listen EADDRINUSE: address already in use :::3000 (or another port).

How to avoid it: Bind to process.env.PORT and let the platform pick the port; add a graceful shutdown handler that closes the server on SIGTERM.

Step-by-step fix

Concrete, ordered steps from the dataset. Apply them in order; each line is a verified action, not generic advice.

  1. 1Find and stop the occupying process: lsof -i :3000 (macOS/Linux) or (Get-NetTCPConnection -LocalPort 3000).OwningProcess via Get-Process on Windows, then kill it.
  2. 2Use a different port, or read process.env.PORT so the host assigns a free one.
  3. 3In dev, ensure the process manager (nodemon) restarts cleanly; a zombie worker often holds the port.

Where this error appears

Languages, frameworks, and runtimes where this error is observed (from the 2026 DevFixPro error dataset, retrieved 2026-08-29):

Node.js

Node.js http/https servers on any OS. Port numbers are per-host; the fix is process/port management, not application code.

How to prevent it & common questions

Practical prevention plus the questions developers ask most about this error.

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

Another process is already bound to the port your server is trying to listen on — a previous instance that did not exit, or a different app on the same port.

Which environments are affected by Error: listen EADDRINUSE — address already in use?

Node.js

How do I fix Error: listen EADDRINUSE — address already in use?

Find and stop the occupying process: lsof -i :3000 (macOS/Linux) or (Get-NetTCPConnection -LocalPort 3000).OwningProcess via Get-Process on Windows, then kill it. Use a different port, or read process.env.PORT so the host assigns a free one. In dev, ensure the process manager (nodemon) restarts cleanly; a zombie worker often holds the port.

How do I prevent Error: listen EADDRINUSE — address already in use?

Bind to process.env.PORT and let the platform pick the port; add a graceful shutdown handler that closes the server on SIGTERM.

How do I kill the process on the port?

On Linux/macOS: lsof -ti :3000 | xargs kill -9. On Windows: stop the PID from Get-NetTCPConnection -LocalPort 3000.

Should I just pick a random port?

Prefer process.env.PORT so hosts (Render/Heroku/etc.) assign one. Hard-coding a port invites EADDRINUSE in shared environments.

Related DevFixPro tools

Real, browser-only utilities on DevFixPro that help while you work through this issue. These are navigation aids, not a substitute for the fix above.

● Data updated 2026-08-29

Sources & attribution

  • Error records aggregated from Google Search Console query gaps (2026-05-21~2026-08-18) for devfixpro.com, plus official framework docs (MDN, Node.js docs, Python docs, Go.dev, Rust book, Oracle Java docs, Docker docs, npm docs). Source dataset retrieved 2026-08-29. License: CC BY 4.0 — attribute DevFixPro (devfixpro.com).
  • Official reference: https://nodejs.org/api/net.html
  • All cause, environment, fix and prevention text on this page is taken verbatim from the DevFixPro 2026 error dataset. DevFixPro does not invent root causes or fixes.
How this Error: listen EADDRINUSE — address already in use page is built

Each error page is generated from a single record in the DevFixPro 2026 error dataset. The meaning, root cause, environments, fix steps, prevention, and official references are copied verbatim from that dataset and its official-doc sources; related-error links are computed from the error's category and explicit peer list. No root cause or fix is invented. The retrieval date for this dataset is 2026-08-29.

← Back to all errors