TL;DR — Quick Summary
Find which Windows application is using a specific port using netstat, PowerShell Get-NetTCPConnection, Resource Monitor, and TCPView. Resolve port conflicts and free up ports for your services.
Finding Which Application Uses a Specific Port on Windows
Port conflicts are one of the most common issues when running multiple services on Windows. When you get “port already in use” or a service fails to start, you need to identify which process is occupying the port.
Method 1: netstat (Command Prompt)
Open an elevated Command Prompt (Run as Administrator):
netstat -ano | findstr :80
Output example:
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 4
TCP 0.0.0.0:443 0.0.0.0:0 LISTENING 4
The last column is the PID (Process ID). Find the process name:
tasklist | findstr 4
Useful netstat Flags
| Flag | Description |
|---|---|
-a | Show all connections and listening ports |
-n | Show addresses and port numbers numerically |
-o | Show the owning process PID |
-b | Show the executable name (requires admin) |
-p TCP | Show only TCP connections |
:: Show all listening ports with process names
netstat -anob | findstr LISTENING
:: Show only TCP connections on a specific port
netstat -ano -p TCP | findstr :8080
:: Show all established connections
netstat -ano | findstr ESTABLISHED
Method 2: PowerShell (Recommended)
PowerShell provides a cleaner one-liner:
# Find which process uses port 80
Get-Process -Id (Get-NetTCPConnection -LocalPort 80).OwningProcess
# Show details with port state
Get-NetTCPConnection -LocalPort 80 | Select-Object LocalPort, State, OwningProcess, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}}
# Find all listening ports
Get-NetTCPConnection -State Listen | Select-Object LocalPort, OwningProcess, @{Name="Process";Expression={(Get-Process -Id $_.OwningProcess).ProcessName}} | Sort-Object LocalPort
# Check UDP ports
Get-NetUDPEndpoint -LocalPort 53 | Select-Object LocalPort, OwningProcess
Method 3: Resource Monitor (GUI)
- Press Win+R, type
resmon, press Enter. - Click the Network tab.
- Expand Listening Ports.
- Sort by Port to find the process using your port.
Method 4: TCPView (Sysinternals)
Download TCPView from Sysinternals. It provides a real-time GUI showing all TCP/UDP connections, their state, and the process using them. You can right-click to kill a process directly.
Commonly Conflicting Ports
| Port | Common Services |
|---|---|
| 80 | IIS, Apache, Nginx, Skype (legacy) |
| 443 | IIS, Apache, Nginx (HTTPS) |
| 3306 | MySQL, MariaDB |
| 5432 | PostgreSQL |
| 1433 | SQL Server |
| 8080 | Tomcat, development servers, proxies |
| 3000 | Node.js (Express, React dev) |
| 5000 | Python (Flask), Docker Registry |
| 3389 | Remote Desktop (RDP) |
| 53 | DNS (Windows DNS Server, Pi-hole) |
Freeing Up a Port
Stop the Process
:: Force kill by PID
taskkill /PID 1234 /F
:: Kill by process name
taskkill /IM httpd.exe /F
Stop a Windows Service
:: Stop IIS
net stop w3svc
:: Stop a specific service
net stop "Service Name"
Or use services.msc to stop the service graphically.
Check from Outside (Remote Port Test)
# PowerShell
Test-NetConnection -ComputerName 192.168.1.100 -Port 80
# CMD
telnet 192.168.1.100 80