Linux – How Do You Check Which Programs Are Using Network Ports?

Unison

Well-known member
VIP

Linux – How Do You Check Which Programs Are Using Network Ports?​

If you're running things like web servers, media servers, Docker containers or other services on Linux, eventually you can run into a situation where a program refuses to start because the port it needs is already in use.

One useful command for checking listening ports is:

sudo ss -tulpn

You can also check a particular port, for example port 9000:

sudo ss -tulpn | grep :9000
This can quickly show whether something is already listening on that port and which process is responsible.

I've found this particularly useful when dealing with several services running on the same machine.

What do you normally use for checking ports on Linux?

Do you use ss, lsof, netstat, or something else?

Any other useful networking commands worth knowing?
 
ifconfig
netstat

Im not a build linux user, I know my way around, but don't use it personally. Only for work purposes, and they're normally servers, and I have limited permissions.
 
ifconfig
netstat

Im not a build linux user, I know my way around, but don't use it personally. Only for work purposes, and they're normally servers, and I have limited permissions.
Yeah, that makes sense 👍 I’m still learning my way around Linux myself. I’m using Manjaro as a desktop at the moment and finding there’s always something new to learn. 😁
 
Back
Top