sudo ss -tulpn. It lists every TCP and UDP port the server is listening on, the address it listens on and the program that owns it. To check one port, add a filter: sudo ss -tlnp 'sport = :80'. On older systems sudo netstat -tulpn gives the same list. A listening port is only reachable from outside if your firewall allows it.
Before you start
- Connect with SSH.
ssworks for any user, but only shows which program owns a port when run withsudo(root can leave it out). - A port is a numbered door a program uses for network traffic: SSH uses 22, websites 80 and 443. A port is listening when a program waits for connections on it.
How to list all listening ports with ss
How to read the Local Address column
In the example, MariaDB on
127.0.0.1:3306 is safe: nothing outside can reach it. A database on 0.0.0.0 is reachable by anyone your firewall lets through.
How to check one port
Which program is using a port?
How to use netstat (older systems)
netstat is part of the older net-tools package, which may not be installed. The options are the same:
- Ubuntu / Debian
- AlmaLinux / Rocky
ss: it is installed everywhere (package iproute2 / iproute) and is faster.
How to see active connections
ss -s prints totals, which helps when you suspect a flood of connections.
Is a listening port actually open to the internet?
A port inss is listening on the server. Whether the internet can reach it also depends on your firewall:
- Ubuntu / Debian (ufw)
- AlmaLinux / Rocky (firewalld)
How to check it worked
Start a test listener and look for it:LISTEN line on 0.0.0.0:8080 owned by python3. After kill %1 it is gone.
Frequently asked questions
What is the difference between ss and netstat?
Both list sockets.ss is the modern tool from iproute2, installed by default and faster on busy servers. netstat comes from the older net-tools package. The options -tulpn work in both.
Why don’t I see the process name?
Run the command withsudo. Without root rights, ss and netstat hide process names for other users’ programs.
How do I find which ports are open from the outside?
Run a scan from another machine you own, for examplenmap -Pn 203.0.113.10, or use the steps in check if a port is open from outside. Only scan servers you are responsible for.
Why does port 53 show on 127.0.0.53 or 127.0.0.54?
That issystemd-resolved, the local DNS cache on Ubuntu. It only listens on the loopback address, so it isn’t reachable from outside.
Related guides
VPS and dedicated server guides
Every server guide in one place.
Check if a port is open from outside
Test from the internet.
Set up a firewall with UFW
Open and close ports on Ubuntu.
Set up a firewall with firewalld
Open and close ports on AlmaLinux.
Kill a process
Free a port that is in use.
Checked against the ss(8) manual from iproute2 on 4 November 2026;
ss, netstat and lsof tested on Ubuntu 24.04 LTS. Commands can differ on other distributions or releases.Need Extra Help?
If you encounter any issues, our support team is ready to assist:- Live Chat: Quick assistance via our website.
- Support Ticket: Open a Ticket
- Discord: Join our Community
- Email: support@freakhosting.com
Last Updated: November 2026