To find which process is using a port on Windows, run netstat -ano | findstr :3000 (replace 3000 with your port) in a terminal, read the process ID (PID) in the last column, and look that PID up in Task Manager’s Details tab or with Get-Process -Id <PID> in PowerShell. Before you stop it, check what the process actually is: if it is your own leftover dev server, end it; if it is System (PID 4), a Windows service or something you do not recognise, find the real owner first or move your app to another port. If nothing is using the port and binding still fails, the port is probably inside a range Windows has reserved.
This guide explains what the error means, how to find and stop the owner safely, why System owns port 80, what excluded port ranges are, how TIME_WAIT and port exhaustion work, which default ports common tools use, and how the tools compare. Each section links to a deeper guide on this site.
What does “port already in use” (EADDRINUSE, error 10048) mean?
A TCP or UDP port can have only one listener for a given address at a time. When a program asks Windows to listen on a port that another socket already holds, the request fails. Different tools word that failure differently:
| Where you see it | Message |
|---|---|
| Node.js | Error: listen EADDRINUSE: address already in use :::3000 |
| Windows sockets (Winsock) | Error 10048, WSAEADDRINUSE: “Only one usage of each socket address is normally permitted” |
| Python | OSError: [WinError 10048] |
| Docker | ”Bind for 0.0.0.0:8080 failed: port is already allocated” |
| App frameworks | ”Port 5000 is in use”, “Cannot find empty port” |
They all mean the same thing: something else got there first. The fix is to find out what. Fix EADDRINUSE on Windows covers the Node.js case, and fix Windows socket error 10048 covers the Winsock wording.
A related but different symptom is “localhost refused to connect”, which usually means nothing is listening at all. See fix “localhost refused to connect” on Windows.
How do I find which process is using a port?
Windows has several built-in ways, and each shows a slightly different slice.
- Open a terminal. Some processes only show their details to an elevated terminal, so if results look incomplete, see run CMD as administrator.
- Run netstat.
netstat -ano | findstr :3000lists connections on port 3000 with their state and PID. A line in theLISTENINGstate is the one holding the port. - Or use PowerShell.
Get-NetTCPConnection -LocalPort 3000 | Select-Object LocalAddress, State, OwningProcessgives the same information as objects you can filter. For UDP, useGet-NetUDPEndpoint -LocalPort 3000. - Turn the PID into a name.
Get-Process -Id 14532ortasklist /FI "PID eq 14532"shows the process name. Task Manager’s Details tab shows it too, with a PID column you can sort. - Check the path. A process called
node.execould be any of several projects.Get-Process -Id 14532 | Select-Object Pathshows which executable it is.
The full walkthrough is in what process is using a port on Windows?, and how to find and fix port conflicts on Windows covers the common fixes. For a deeper reference on the command itself, see the netstat guide for Windows developers. If you need the list as a file, see export listening ports to CSV on Windows.
Resource Monitor (run resmon, then the Network tab, Listening Ports) shows the same information in a window. Task Manager vs Resource Monitor for port conflicts compares the two.
How do I stop that process safely?
Stopping the wrong process is the real risk here, not the port itself.
- Know what it is before you end it. Your own dev server, a stale
node.exeor a crashed Python process is usually safe to end. A database service, a Windows service or anything running as SYSTEM may not be. - Prefer a clean shutdown. Stop the server in its own terminal, stop the service with
Stop-Service, or quit the app. Forced termination skips cleanup. - If you must force it,
taskkill /PID 14532 /ForStop-Process -Id 14532 -Forceends it. - Check the PID again just before you act. Windows reuses PIDs. If the process exits on its own and a new one takes its PID a moment later, a command typed from an old reading can end the wrong program. Windows PID race conditions when killing processes explains how this happens.
- Or change your port. If the owner is something you need, moving your app to a free port is often the quickest fix.
Command-line helpers such as npx kill-port exist for developers; see npx kill-port vs portrm vs Port Detective for a fair comparison. If background apps keep reclaiming a port after restarts, see stop background apps on Windows 11 and 10.
Why does System (PID 4) own port 80?
If netstat shows PID 4 on port 80 or 443, the listener is HTTP.sys, the kernel-mode HTTP server built into Windows. Many services use it to listen on web ports without owning the port directly, so the PID tells you nothing about which service it is. Common candidates include IIS, Windows Remote Management, print and media sharing services, and some third-party apps.
To find the real owner, run netsh http show servicestate view=requestq in an elevated terminal. It lists the URLs each service has registered with HTTP.sys and the processes behind them. Stop or reconfigure that service rather than trying to end System, which you should never do. Port 80 in use by System PID 4: find the real owner walks through it.
Some well-known ports are always held by Windows itself, such as 135, 445 and, when Remote Desktop is on, 3389. Windows listening ports explained covers what each one is and whether it should be open.
What are excluded port ranges, and why can’t I bind a port nothing is using?
Sometimes netstat shows nothing on a port, yet binding still fails with an access or permission error. The usual cause is an excluded port range: a block of ports Windows has reserved. It is often reported on PCs that use Hyper-V based features such as WSL 2, Docker Desktop or Windows NAT (WinNAT). No process appears to own them, but applications cannot bind them.
To see the reserved ranges, run:
netsh interface ipv4 show excludedportrange protocol=tcp
If your port falls inside one of the listed ranges, that is the reason. Fixes include choosing a port outside the ranges, or, as an administrator, restarting the service that reserved them or adding your own reservation for the port you need before the range is reserved. Be careful with changes here, since they affect the services that depend on those reservations. AI and data tools that scan for a free port are a common place to meet this; see Gradio cannot find empty port 7860 on Windows and Ollama port 11434 already in use on Windows.
TIME_WAIT, CLOSE_WAIT and port exhaustion
Not every line in netstat is a listener.
- TIME_WAIT is a normal state after a connection closes. The side that closed first keeps the connection’s address pair reserved for a few minutes so late packets are not confused with a new connection. TIME_WAIT entries do not usually block a server from listening.
- CLOSE_WAIT means the other side closed the connection but the local program has not closed its end. Many CLOSE_WAIT entries for one process usually point to a bug in that program.
- Port exhaustion happens when a machine runs out of ephemeral ports for outgoing connections. Windows uses a dynamic range, by default starting at 49152 and ending at 65535. A program that opens connections faster than they clear can use them all up, and new connections start failing.
netsh int ipv4 show dynamicport tcp shows the current range. TIME_WAIT, CLOSE_WAIT and port exhaustion on Windows covers diagnosis and fixes.
Default ports for common dev tools
Knowing the usual ports makes a conflict easier to place.
| Port | Common user |
|---|---|
| 3000 | Node.js dev servers, React and Next.js tooling |
| 5000 | Flask, ASP.NET Core (older templates) |
| 5173 | Vite |
| 5432 | PostgreSQL |
| 3306 | MySQL |
| 1433 | Microsoft SQL Server |
| 6379 | Redis |
| 8080 | Alternative HTTP, many Java and proxy tools |
| 7860 | Gradio |
| 11434 | Ollama |
Defaults change between versions and many tools let you choose, so treat this as a starting point. To check whether a port is reachable on another machine, rather than in use on yours, see check if a port is open on a remote server. For general network settings, see ncpa.cpl and ipconfig.
Tools compared: netstat, PowerShell, Resource Monitor, TCPView and Port Detective
| Tool | Cost | Good for | Limits |
|---|---|---|---|
| netstat | Built in | Quick answer, works everywhere | Text output; PID only, no names without another command |
| PowerShell cmdlets | Built in | Scripting and filtering | You write the commands |
| Resource Monitor | Built in | A visual list of listening ports | No search by port, no actions |
| TCPView (Sysinternals) | Free | Live view of every connection with process names | A general network viewer |
| Port Detective | Free | Live view, instant lookup by port, 5 free guarded kills and 3 free remote scans | Kills capped at 5, remote scans at 3 |
| Port Detective Pro | One-time purchase, with a free trial | Unlimited guarded kills, Port Guard, command copy, Docker mapping | Paid edition |
The built-in tools are enough for many people, and TCPView is a long-standing free choice. TCPView and CurrPorts alternatives for Windows 11 compares more options fairly. For why Port Detective is a native app rather than a web wrapper, see Electron vs Tauri for background Windows tools.
How Port Detective fixes this
Port Detective comes in two Microsoft Store editions.
Port Detective is free. Its listing describes:
- Live socket tracking of every active TCP and UDP connection.
- Instant lookup: type a port such as 5432 and see the process name, PID and connection state.
- Pinned ports: keep your usual dev ports at the top of the dashboard.
The free edition also includes 5 free kills, with the same process token check as Pro, so you can end the process holding a port, and 3 free remote scans; the Power User upgrade unlocks unlimited scans. Pro makes kills and remote scans unlimited.
Get Port Detective from the Microsoft Store
Port Detective Pro is the complete edition, with every feature unlocked on install. Its listing adds:
- One-click kill with a process token check before it acts, so a recycled PID is not ended by mistake, and a privilege-aware view for processes protected by the OS.
- Copy any row as a ready-to-run netstat, taskkill or PowerShell command, plus a Ctrl+K command palette, grouping and saved filter presets.
- Port Guard: pin ports such as 3000 or 8080 and get a Windows notification when something else grabs one, with optional rules to stop the intruder and relaunch the expected owner.
- Docker mapping of host ports to the container and image, unlimited scans of remote hosts by preset or range, a timeline of port changes, notes on ports, and CSV or JSON export.
- Offline: core features make no external network calls.
Port Detective Pro has a free trial on the Microsoft Store, then a one-time purchase.
Get Port Detective Pro from the Microsoft Store
Frequently asked questions
How do I see what is using port 3000 on Windows?
Run netstat -ano | findstr :3000, note the PID in the LISTENING line, then run Get-Process -Id <PID> or check Task Manager’s Details tab.
Is it safe to kill the process using a port?
Only once you know what it is. Your own dev server is usually fine to end. Never end System (PID 4); find the service behind it instead.
Why can’t I use a port when nothing is listening on it?
It may be in an excluded port range, which is often reported on PCs that use Hyper-V, WSL 2, Docker Desktop or WinNAT. Check with netsh interface ipv4 show excludedportrange protocol=tcp.
What is the difference between Port Detective and Port Detective Pro?
Port Detective is free and shows live connections and lookups by port, with 5 free guarded kills and 3 free remote scans; the Power User upgrade unlocks unlimited scans. Pro is a separate paid edition with every feature unlocked, including unlimited guarded kills, unlimited remote scans and Port Guard.
More guides in this topic
- What process is using a port on Windows?
- How to find and fix port conflicts on Windows
- Fix EADDRINUSE on Windows
- Fix Windows socket error 10048 (WSAEADDRINUSE)
- The netstat guide for Windows developers
- Port 80 in use by System PID 4: find the real owner
- TIME_WAIT, CLOSE_WAIT and port exhaustion on Windows
- Windows listening ports explained: 135, 445, 3389 and more
- Windows PID race conditions when killing processes
- Task Manager vs Resource Monitor for port conflicts
- Export listening ports to CSV on Windows, with process names
- Check if a port is open on a remote server (Windows)
- Fix “localhost refused to connect” on Windows
- Gradio cannot find empty port 7860 on Windows
- Ollama port 11434 already in use on Windows
- npx kill-port vs portrm vs Port Detective
- TCPView and CurrPorts alternatives for Windows 11
- Run CMD as administrator in Windows 11 and 10
- Stop background apps on Windows 11 and 10
- ncpa.cpl and ipconfig: open network connections
- Electron vs Tauri for background Windows tools
- All Port Detective topics