How to check listening ports on a Linux VPS

Print
  • 0

Checking listening ports tells you whether software is actually waiting for connections. This is useful for game servers, web servers, databases, bots, and RCON tools.

If the service is not listening locally, no firewall rule will make it reachable from outside. Start the application first, then check the port.

  1. Connect to the VPS with SSH.
  2. Use ss to list listening TCP and UDP ports:
    sudo ss -tulpn

    Linux VPS terminal showing listening TCP and UDP ports with processes

  3. If netstat is installed, use the memorable -peanut command:
    sudo netstat -peanut
  4. If netstat is missing on Ubuntu or Debian, install it with:
    sudo apt install net-tools
  5. If netstat is missing on AlmaLinux, Rocky Linux, Oracle Linux, or CentOS, install it with:
    sudo dnf install net-tools

 

What to check

CheckWhy it matters
TCP or UDPThe firewall rule must match the protocol the service uses.
Local address127.0.0.1 means local-only; 0.0.0.0 usually means all IPv4 addresses.
Process nameConfirms the expected service owns the port.
FirewallThe service can listen locally but still be blocked from the internet.

For firewall rules, use How to open firewall ports on a Linux VPS.


Was this answer helpful?

Related Articles

« Back

Follow us on Social Media

Stay in the loop! Follow our social media accounts and stay up-to-date with the latest news, announcements, tips & tricks and behind-the-scenes insights!