Ubuntu - check open ports

When managing a server running Ubuntu It's essential to know how to check various aspects of your system, such as open ports and SSL certificates. Here’s a guide on how to perform these checks:

Ubuntu Check If Port Is Open

To check if a specific port is open on your Ubuntu server, you can use the `netstat` or `ss` command. For example, to check if port 80 is open, run:

sudo netstat -tuln | grep :80


sudo ss -tuln | grep :80

These commands will display information about open ports and listening services.

Ubuntu Check Open Port

If you need to check a particular open port, you can use the `nc` (netcat) command. To check if port 22 is open, use:

nc -zv localhost 22

This will tell you if the port is open and accepting connections.

Ubuntu Check Open Ports

To get a list of all open ports on your Ubuntu server, use the `netstat` or `ss` commands without specifying a port:

sudo netstat -tuln


sudo ss -tuln

These commands provide a comprehensive list of all open ports and their associated services.

Ubuntu Check Ports

Another useful tool to check ports on your Ubuntu server is `nmap`. Install `nmap` using:

sudo apt-get install nmap

Then, to scan for open ports, use:

nmap -sT localhost

This will scan and list all open TCP ports on your server.

Ubuntu Check LetsEncrypt Certificate

To check the status and details of your Let's Encrypt certificate on Ubuntu, use the `openssl` command. For example, to check the certificate for a domain, run:

openssl s_client -connect -servername

This command will provide details about the SSL certificate, including its validity period and issuer.

By using these commands and tools, you can effectively manage and troubleshoot your Ubuntu server, ensuring that your ports are correctly configured and your SSL certificates are valid.