How to check port 8080 usage?

QuestionsQuestions8 SkillsProDec, 16 2025
0421

Great question! Knowing how to check port usage is very helpful, especially when you encounter an "Address already in use" error.

You can check which process is using port 8080 by using the lsof command. lsof stands for "list open files" and can show you a lot of information about what the system is doing.

Here's how you can use it:

sudo lsof -i :8080

Let's break down this command:

  • sudo: We use sudo because lsof often needs administrator privileges to show all network connections.
  • lsof: The command to list open files.
  • -i :8080: This option tells lsof to list network files (sockets) that are using port 8080.

After running this command, you should see output similar to this if a process is using port 8080:

COMMAND   PID  USER   FD   TYPE DEVICE SIZE/OFF NODE NAME
python3 12345 labex    3u  IPv4  67890      0t0  TCP localhost:8080 (LISTEN)

In this example:

  • COMMAND: Shows the name of the process (e.g., python3).
  • PID: This is the Process ID of the program listening on port 8080. You'll need this to stop the process if necessary.
  • USER: The user who owns the process.

Once you identify the process, you can then decide if you want to stop it (using kill <PID>) or choose a different port for your web server.

Give it a try and let me know what you find!

0 Comments

no data
Be the first to share your comment!