Quick Fix: portrm (One Command)
The fastest approach on Windows. Install portrm and run:
> ptrm fix 3000
Port 3000 in use
node.exe (PID 15832) - Next.js dev server
SAFE - development server
Fix port 3000? [Y/n] Y
Killed PID 15832
Port 3000 is now free
Install via npm install -g portrm, scoop install portrm, or npx portrm fix 3000.
Method 1: netstat + taskkill (CMD)
Open Command Prompt (or run as Administrator for system processes):
REM Step 1: Find the PID using port 3000
> netstat -ano | findstr :3000
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 15832
TCP [::]:3000 [::]:0 LISTENING 15832
REM Step 2: Kill the process
> taskkill /PID 15832 /F
SUCCESS: The process with PID 15832 has been terminated.
The /F flag forces termination. The last column in netstat output is the PID.
Method 2: PowerShell
PowerShell provides more readable output:
# Find process on port 3000
PS> Get-NetTCPConnection -LocalPort 3000 | Select-Object OwningProcess
OwningProcess
-------------
15832
# See process name
PS> Get-Process -Id 15832
Handles NPM(K) PM(K) WS(K) CPU(s) Id ProcessName
------- ------ ----- ----- ------ -- -----------
380 28 65432 72104 2.34 15832 node
# Kill it
PS> Stop-Process -Id 15832 -Force
PowerShell one-liner
PS> Get-NetTCPConnection -LocalPort 3000 | ForEach-Object { Stop-Process -Id $_.OwningProcess -Force }
Method 3: Task Manager
- Press Ctrl+Shift+Esc to open Task Manager
- Click Details tab
- Click PID column header to sort
- Find the PID from your netstat output
- Right-click the process and select End task
Task Manager does not show which port a process uses, so you still need netstat first to get the PID.
Method 4: Resource Monitor
- Press Win+R, type
resmon, press Enter - Go to the Network tab
- Expand Listening Ports
- Find port 3000 in the list
- Note the process name and PID, then kill it via Task Manager
Common Applications Using Port 3000 on Windows
| Application | Reason |
|---|---|
| React (CRA) | Default npm start port |
| Next.js | Default next dev port |
| Express.js | Convention from tutorials |
| Grafana | Default dashboard port |
| NestJS | Default dev server port |
Prevent Port Conflicts on Windows
Use .ptrm.toml to assign dedicated ports per service:
> ptrm init
REM Creates .ptrm.toml with your services
> ptrm preflight 3000
REM Check availability before starting
> ptrm fix 3000 -y && npm run dev
REM Auto-fix then start
Windows Defender / Antivirus Note: Some antivirus software can lock ports. If netstat shows a system process (PID 4) on port 3000, check Windows Firewall settings or try running as Administrator.
One command. No PID hunting.
portrm finds the process, identifies the service, checks safety, and frees port 3000 on Windows instantly.