How to kill a process listening to a port say “8080”

Abhilog > Tech > How to kill a process listening to a port say “8080”

How to kill a process listening to a port say “8080”

I have often encountered this issue while trying to run tomcat or any server on a particular port like 8080. I get an error saying that the “port is already being used by another process“.

A simple solution to resolve this would be to use a different port but in many cases that might not be a comfortable solution. You can also try to close that particular process running on that port . In most cases, this process will be a background process like a server running in the background.

Below are the steps you can follow to kill those process

Step 1 : Find the process that is using this port.

Firstly, find the process that is using the port. Below is the command you can use to fin the process
netstat -ano | find "8080"

What is netstat ? You can click here to find out more wiki.

Step 2 : Kill the process
Now, since we found the process that was using the port (in the above case 22300) we can kill it with the below command.
  taskkill /PID 22300 /F

Happy coding.

3 thoughts on “How to kill a process listening to a port say “8080”

Leave a Reply

Your email address will not be published. Required fields are marked *