Ondřej Chrastina
Menu

Kill the process occupying your port

Have you encounter with exception like "Address already in use: bind"? If you have been doing web development I have no doubt you have! Now you need to find the bas**rd and kill the process. But how to do that quickly on Windows?

Back to journal

The solution is quite easy - use PowerShell!
First list all processes with their PIDs (in example with port 8080)

netstat -ano | Select-String "8080"

You will get something like that:

TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       14736
TCP    [::]:8080              [::]:0                 LISTENING       14736


Then use the PID (last column) and kill the process with fire using taskkill:

 taskkill /F /pid 14736
  • Twitter
  • GitHub
  • LinkedIn
  • Facebook
  • Instagram
  • Medium
  • dev.to
  • Discord
    • © Ondřej Chrastina 2020
    • Design: HTML5 UP
    • 💾 Source code
  • Home
  • Journal
  • Projects
  • PWA series
  • GitHub
Close