Korean

Port Already In Use — Fixing EADDRINUSE

Troubleshooting / port-already-in-use.html

troubleshootingEnv: macOS / Linux / WindowsVerified: 2026-10-19

Why the server dies with 'address already in use', and how to find and clear the process holding the port.

💬 Symptom: Error: listen EADDRINUSE :::3000

A previously started server still holds the port, or another program is already using it.

Cause

  • A previous process never exited.
  • Another service (DB, other app) uses the same port.

Diagnose

# macOS / Linux
lsof -i :3000

# PID only
lsof -ti :3000

Fix

# kill the process
kill -9 $(lsof -ti :3000)

# or run on another port
PORT=3001 npm run dev

Verify the fix

  • Running lsof -i :3000 again and getting nothing means it's clear.
  • Restart the server and confirm it boots.

Sources

Verified date indicates freshness. Check applicability conditions for older material.