Hi Friends đź‘‹,

Welcome To Infinitbility! ❤️

To kill process using port in windows, open your cmd as administrator and do

  1. run netstat -ano | findstr :<PORT> (replace <PORT> with your port number )
  2. copy PID number which you want kill in the list
  3. run taskkill /PID <PID> /F (replace <PID> with your pid number )

That’s it.

Sometime’s we want to run some application like node, react, golang, graphQL and etc but windows show this port already in used in my case i want to start start react application on 3000 port but i’m not able to start because something working on 3000 port.

So let’s how do i kill process using port in windows steps wise.

Step 1: Start CMD as a administrator

To start cmd as a administrator

  1. click on window start button
  2. search CMD in your search bar
  3. Right click on CMD and select Run as a administrator
Run CMD as a administrator
Run CMD as a administrator

Step 2: Find process based on port

To find process based on port we are going to use netstat command.

Just run the netstat -ano | findstr :<PORT> command in my case it’s was like netstat -ano | findstr :3000.

Find port using netstat in windows
Find port using netstat in windows

The box area in read shows the PID (process identifier). Locate the PID of the process that’s using the port you want.

Step 3: kill the process

To kill process, we are going to use taskkill command.

Just run the taskkill /PID <PID> /F command in my case it’s was like taskkill /PID 15767 /F.

Kill process using taskkill in windows
Kill process using taskkill in windows

If process kill successfully it will show SUCCESS: The process with PID 15676 has been terminated..

I hope it helps you, All the best đź‘Ť.