Kill what ever is running on port 8080

I am trying to run a GAE app on localhost:8080, but it was apparently occupied, even after shutting down and restarting my computer. I ran sudo lsof -i :8080. Lo and behold there is something sill running with PID 66. What can I do to kill that process and free up 8080 again?

5 Answers

  1. Find out what Process ID (pid) is using the required port (e.g port 5434).

    ps aux | grep 5434
  2. Kill that process:

    kill -9 <pid>
2

lsof -i @localhost:8080

kill -9 <<PID>>

3

Turns out it's just kill -9 PID, you might need sudo. Found the answer on maclife.com in the article Terminal 101: Track and Kill Processes.

Merging answers from above in one line: kill $(lsof -t -i:8080)

lsof -t returns the PID and passes that to kill.

1

Use the following command to find the process ID of the process running on the desired port:

$ netstat -ano | findstr :8080

The result will be displayed as:

$ netstat -ano | findstr :5000 TCP 0.0.0.0:5000 0.0.0.0:0 LISTENING 18024

Here, 18024 is the PID or Process ID.

Then use the following command to kill the process on the post 8080:

$ taskkill /PID 18024 /F

or:

$ taskkill //PID 18024 //F

Result will be displayed as:

$ taskkill //PID 18024 //F
SUCCESS: The process with PID 18024 has been terminated.

Your Answer

Sign up or log in

Sign up using Google Sign up using Facebook Sign up using Email and Password

Post as a guest

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

You Might Also Like