Find and kill whatever is using port 3000

Terminal

A local dev server failed because port 3000 is occupied.

  1. Find process (macOS/Linux)

    lsof -i :3000
    macOS/Linux
  2. Kill by PID

    kill -9 <PID>
    macOS/Linux Destructive
  3. Alternative one-liner

    lsof -ti :3000 | xargs kill -9
    macOS/Linux Destructive

Notes

  • Use a normal kill before SIGKILL when possible.
  • Verify the port is free with a second lsof check.

Related commands: lsof, kill, ps

Related workflows: Find which process is using a port