How to check which ports are open on your server
Updated 11/29/2026
Every open port is a possible entry door. Regularly check what is listening on the server and close what you do not use.
1. See open ports locally
ss -tulnp
Shows all services listening for connections, with the port and process.
2. Scan from the outside
From another computer, see what is visible from the internet:
nmap SERVER_IP
3. Close what you do not need
Stop unnecessary services:
systemctl disable --now service-name
Or block the port with a firewall, see How to set up a firewall with UFW.
4. Good rules
- Publicly expose only 80 and 443 for sites, plus the SSH port.
- Databases stay accessible only locally or through a firewall restricted to an IP.
- Run this check after every new install, some packages open ports by default.
A full check is part of the first steps of securing your VPS.
Put this guide into practice on your own VPS
EU cloud servers, billed hourly, ready in minutes, with one-click installs for dozens of apps.
See pricingRelated tutorials
Single sign-on for your applications with authentik
One account for all your team's apps: first sign-in, users, an OpenID Connect application and two-factor authentication.
Updated 11/29/2026SecurityPasswordless sign-in with Pocket ID
Passkeys for your applications over OpenID Connect: first sign-in, colleagues and connecting an application.
Updated 11/29/2026SecurityHow to protect your server from brute-force attacks with fail2ban
fail2ban automatically bans IPs that repeatedly try wrong passwords. Here is how to install and configure it.
Updated 11/29/2026