Skip to content

Welcome to Tech by Example

Menu
  • Home
  • Posts
  • System Design Questions
Menu

Check which process is using port 8080 on your localhost on MAC or Linux

Posted on July 10, 2021July 10, 2021 by admin

lsof command can be used to check which process is occupying port 8080. lsof command stands for List Of Open File.

It provides a -i option that can be used to check the files that might have been opened by some network connection in the system. It lists all UDP and TCP connections.

Type the below command

lsof -i tcp:8080

It will tell you which process is occupying port 8080. Below is the output on my system.

COMMAND   PID   USER   FD   TYPE             DEVICE SIZE/OFF NODE NAME
main    35631 <user>    3u  IPv6 0x5a460c6a5bab1b15      0t0  TCP *:http-alt (LISTEN)

The output also has the PID of the process which I can then use to kill the process. Below is the command to kill the process

kill -9 <pid_of_process>
  • 8080
  • linux
  • mac
  • port
  • ©2025 Welcome to Tech by Example | Design: Newspaperly WordPress Theme