Whether you are starting Apache in XAMPP, running a Node.js / Next.js / Vite server on port 3000, or spinning up a Docker container on port 8080, nothing halts productivity faster than this error:
Why Does Windows Lock Port 80 with PID 4?
PID 4 is the Windows NT kernel process. The kernel itself doesn't serve websites, but kernel-mode network drivers run under its ID. The most common culprit is HTTP.sys, the Windows HTTP protocol stack used by:
- World Wide Web Publishing Service (W3SVC / IIS): Pre-installed with Windows features.
- Windows Remote Management (WinRM): Listens on port 80/5985.
- SQL Server Reporting Services: Frequently binds to port 80 on developer laptops.
- BranchCache: Windows corporate caching service.
Method 1: The Native Windows CMD Method
Here is how to locate the blocking process and terminate it using Windows native command-line tools:
Step 1: Locate the PID
Open Command Prompt as Administrator and run:
Look at the last column on the right. That number is the Process ID (PID) holding the socket open.
Step 2: Terminate the Process (If PID != 4)
If the PID belongs to an orphaned Node.js, Python, or Java process, kill it forcefully:
Step 3: Handle PID 4 (HTTP.sys / IIS)
If the PID is 4, you cannot run taskkill on the kernel. Instead, disable the services reserving HTTP:
⚡ Prefer a 1-Click GUI Solution?
Avoid hunting down obscure PIDs and running terminal commands every time a rogue process locks your ports. Pexoris PortKiller is a 78 KB standalone tool that displays every listening socket, pinpoints the executable path, and frees the port with one click.
Download Pexoris PortKiller Free (58 KB)Method 2: 1-Click Port Freeing with Pexoris PortKiller
- Download and run PexorisPortKiller.exe (requires zero installation).
- Type the port number (e.g.
80,3000,8080) or pick from the Quick Action presets. - The process name, PID, socket address, and process path appear instantly highlighted in red.
- Click ⚡ Kill Process & Free Port to immediately unlock the socket!
Frequently Asked Questions
Why does port 3000 get stuck after stopping Node.js with Ctrl+C?
When you terminate a Node process with Ctrl + C, child processes spawned by tools like nodemon, Vite, or Webpack often stay alive as orphaned background tasks holding onto the TCP socket. PortKiller terminates these hidden zombie processes instantly.
Does PortKiller require an internet connection?
No. Pexoris PortKiller is completely standalone and works 100% offline. It communicates directly with the Windows Win32 IP Helper API (iphlpapi.dll) and contains zero telemetry.