The Fastest Way: portrm
$ ptrm fix 3000
Port 3000 in use
Node.js (PID 12345) - React dev server
SAFE - dev server, safe to kill
Fix port 3000? [Y/n] Y
Killed PID 12345
Port 3000 is now free
Or without any prompts: ptrm fix 3000 -y
Install: npm install -g portrm | brew install abhishekayu/tap/portrm | npx portrm fix 3000
Check What is Using Port 3000
Before killing anything, see what is running:
$ ptrm 3000
Port 3000
Process: node (PID 12345)
Service: React dev server (90% confidence)
Memory: 14.2 MB
Uptime: 2h 30m
Safety: SAFE - dev server
Free Port 3000 on macOS
# Find the process
$ lsof -i :3000
COMMAND PID USER FD TYPE DEVICE SIZE/OFF NODE NAME
node 12345 user 23u IPv6 ... 0t0 TCP *:3000
# Kill it
$ kill -9 12345
# Or one-liner
$ kill -9 $(lsof -ti :3000)
Free Port 3000 on Linux
# Using lsof
$ lsof -ti :3000 | xargs kill -9
# Using fuser
$ fuser -k 3000/tcp
# Using ss
$ ss -tlnp | grep :3000
$ kill -9 <PID>
Free Port 3000 on Windows
# Find the process
> netstat -ano | findstr :3000
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 12345
# Kill it
> taskkill /PID 12345 /F
What Usually Uses Port 3000?
| Application | Why Port 3000 |
|---|---|
| React (Create React App) | Default dev server port |
| Next.js | Default dev server port |
| Express.js | Common convention |
| Ruby on Rails | Default dev server (Puma) |
| Grafana | Default dashboard port |
| Node.js HTTP server | Common in tutorials |
Use a Different Port Instead
If you do not want to kill the existing process, use another port:
$ PORT=3001 npm start # React / Express
$ npx next dev --port 3001 # Next.js
$ npx vite --port 3001 # Vite
Prevent Port 3000 Conflicts
Use a .ptrm.toml config to assign dedicated ports to each service in your project:
$ ptrm init
# Creates .ptrm.toml with your services and ports
$ ptrm up
# Starts all services, auto-resolves conflicts
$ ptrm preflight 3000
# Check if port 3000 is free before starting
Never fight for port 3000 again
portrm identifies what is using the port and frees it safely in one command.