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?

  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>
| improve this answer | |

lsof -i @localhost:8080

kill -9 <<PID>>

| improve this answer | |
  • While this may work, it repeats what the OP posted and could use an explanation. – bertieb Sep 24 '15 at 14:30
  • This answer is the most clear and has best feedback in terminal! ps aux | grep 5434 doesn't say at all which is the PID!! – mesqueeb Oct 4 '18 at 8:03
  • Nothing happens when I enter lsof -i @localhost:8080 – shim Oct 17 '19 at 15:03

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.

| improve this answer | |

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

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

| improve this answer | |

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.