Kill process running on certain port in windows



"Starting of Tomcat failed, the server port 8080 is already in" or
"other process that is running on port 8080" or
"Port 8080 already in use"

Many new developers facing this error while they try to run a program on a local server.  this error occur because another instance is listening to same port but many users don’t know what is the process, and how to stop it from the Services manger in Windows.
here is a small tutorial to free up the particular port immediately.

we use following two DOS commands:-
1) Netstat
Displays protocol statistics and current TCP/IP network connections.
2) Taskkill
This command line tool can be used to end one or more processes. Processes can be killed by the process id or image name.

we use following code :-
C:\WINDOWS\system32>netstat -o -n -a | findstr 8080
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       4184


C:\WINDOWS\system32> taskkill /F /PID 4184
SUCCESS: Sent termination signal to the process with PID 4184.



Or We can kill any process from task manager also

Steps are as follows:
1)    Open Task manager
Press ALT + CTRL + DELETE
2)    Open “Processes” tab
3)    Click on “ View-> Select Columns ” Menu
4)    Click  check box  “PID- Process Identifier
this will show Process ID column which helps us in identifying running process
5)    Now Right Click on particular process
n click on End Process
Note:- Never kill system processes otherwise it results in immediate shutdown of windows.

To find more details about these commands use dos help utility “ /?”
Netstat /? Or Taskkill /?

Note:-  Sometimes we face error as
“  'netstat' is not recognized as an internal or external command, operable program or batch file.”
to use netstat command we have to relocate promt to “c:\windows\system32” folder
use following command

c:\> cd c:\windows\system32

3 comments :

  1. 8080 port PID showing in command prompt but throwing access denied error and I tried in task manager but it has no that PID can you please help me?

    ReplyDelete