How to stop port 8080 in windows

kill port 8080 windows cmd command

netstat -ano | findstr :3001
taskkill /PID <yourid> /F

                                    Steps to kill process running on port 8080 in Windows cmd/terminal,

#1 netstat -ano | findstr &lt; Port Number &gt;
#2 taskkill /F /PID &lt; Process Id &gt;

                                    netstat -ano | findstr :&lt;PORT&gt;
taskkill /PID &lt;PID&gt; /F

                                    netstat  -ano  |  findstr  &lt;Port Number&gt;
taskkill  /F  /PID  &lt;Process Id&gt;

                                    netstat -ano | findstr &quot;PORT_NUMBER&quot;

taskkill /PID PORT_NUMBER /f

New code examples in category Other

  • How to stop port 8080 in windows
    Other 2022-07-29 23:56:51

On Windows, different processes are executed on different ports of TCP and UDP. Sometimes we need to access a certain port but cannot do so because another process is already using it. As a result, we must kill the process on that particular port. To stop particular processes, you can utilize the PID or port number.

This article will elaborate on the method to kill processes currently using a port on localhost in Windows:

  • Using Command Prompt
  • Using PowerShell
  • Using CurrPorts

Let’s get started!

Method 1: Use Command Prompt to Kill the Windows Process Currently Using a Port on localhost

To kill the Windows process currently using the localhost port through Command Prompt, follow the below-listed steps.

Step 1: Open Command Prompt

First, press the “Window+R” key to open the Run box. Type “cmd” in the dropdown menu and hit the “OK” button to open a command prompt:

How to stop port 8080 in windows

Step 2: Check the localhost Port Running Process

Utilize the “netstat” command to find out the currently running process on the localhost port:

>netstat -ano | findstr :8000

How to stop port 8080 in windows

Step 3: Kill Process Using PID

Then, use the “taskkill” command and specify the PID of the process currently running on localhost and kill it:

How to stop port 8080 in windows

Step 4: Verify the Process State

Again run the “netstat” command to verify that the port on the localhost is running any process or not:

>netstat -ano | findstr :8000

As no output is shown, which indicates that the specified process is killed successfully:

How to stop port 8080 in windows

Step 5: Kill Process by Specifying localhost Port

You can kill a process by specifying a localhost port using the “npx kill-port <port no>” command:

We have successfully terminated the process that is running using a port on localhost:

How to stop port 8080 in windows

Let’s check out the method to kill the Windows process currently using a port on localhost through PowerShell.

Method 2: Use PowerShell to Kill the Windows Process Currently Using a Port on localhost

To kill the Windows process currently using the localhost port with the help of Powershell, utilize the below provided steps.

Step 1: Open Windows PowerShell

Use the “Window+X” key, then choose “Windows PowerShell” as admin from the list of options that appears to open Windows PowerShell:

How to stop port 8080 in windows

Step 2: Find localhost Port Running any Process

Firstly, find any process that is currently using a port on localhost by executing the provided command:

> netstat -ano | findstr :8000

How to stop port 8080 in windows

Step 3: Kill Process Using PID

To terminate a process utilizing a localhost port, issue the “stop-process” command with the PID number:

How to stop port 8080 in windows

Step 4: Kill Process by Specifying localhost Port

The localhost port number can also be used by the user to terminate the process. To do so, use the “Get-Process” command and pass its output to the “Stop-Process” command using the pipe operator “|”. This action will kill the process that is currently running on the specified port:

> Get-Process -Id (Get-NetTCPConnection -LocalPort "8000").OwningProcess | Stop-Process

How to stop port 8080 in windows

Run the “netstat” command once again to confirm that the specified process has killed:

> netstat -ano | findstr :8000

How to stop port 8080 in windows

Now, let’s head towards the next section!

To kill the process currently running on a port on localhost using the CurrPorts tool on Windows, follow the below-listed steps.

Step 1: Download CurrPorts

Visit the below-provided link and download the CurrPorts setup file:

https://www.nirsoft.net/utils/cports.html#DownloadLinks

How to stop port 8080 in windows

Step 2: Extract CurrPorts Setup Folder

Go to the “Downloads” directory and extract the zip folder. To do so, right-click on the file and choose the “Extract here” option:

How to stop port 8080 in windows

Step 3: Run CurrPorts Execution File

Double click on the file to run the “cports.exe” file:

How to stop port 8080 in windows

Step 4: Kill Process

Select the port, then choose the “Kill Processes Of Selected Port” option from the context menu to kill the processes:

How to stop port 8080 in windows

We have effectively demonstrated the methods to kill the process currently using a port on localhost in Windows.

Conclusion

To kill the Windows process currently using a port on localhost, use the “npx kill-port 8000” command on Command Prompt. On Windows PowerShell, the “Get -process” command and the “Stop-process” command to find out and end the specified processes. Lastly, the CurrPorts tools can also be utilized for the same purpose. In this blog post, we have shown how to stop Windows processes that are currently using a port on localhost.

About the author

How to stop port 8080 in windows

I am graduated in computer science. I am a junior technical author here and passionate about Programming and learning new technologies. I have worked in JAVA, HTML 5, CSS3, Bootstrap, and PHP.