How to Check If a Port Is in Use on Windows
Windows 11; Windows 10 differences noted where they exist · Last checked · Suggest an edit
https://instructions.wiki/windows/check-if-a-port-is-in-use-on-windows
You start a server and get "address already in use", or an app refuses to bind to its port. Here is how to find out what is on the port and free it.
Run netstat for the port
Open Command Prompt or PowerShell as an administrator (right-click Start, then choose the Terminal or Command Prompt option marked Admin). Run this, replacing 3000 with your port:
netstat -ano | findstr :3000
-a lists all connections, -n shows numbers instead of names, and -o adds the process ID. findstr filters to your port.
If nothing prints, the port is free.
Read the process ID
A hit looks like this:
TCP 0.0.0.0:3000 0.0.0.0:0 LISTENING 14832
The last number is the PID. LISTENING means a process is actively holding the port.
Find out what the process is
Look the PID up:
tasklist | findstr 14832
This prints the executable name, like node.exe or java.exe, so you know what you are about to stop.
Stop the process
taskkill /PID 14832 /F
/F forces it to close. Run the netstat command again to confirm the port is gone.
Ports that come back. If the same port is taken again after a reboot, a service is starting it automatically. Open Services (search "services" in Start), find the one matching the executable name, and set its startup type to Manual.