What is a port number?

If an IP address finds the server, the port finds the right program on it. The common ports, and how to see which ones are open.

1–2 minutes
Blue network cable with an RJ45 plug on a white background

An IP address gets data to the right machine. A port number gets it to the right program on that machine. A single server can run a website, SSH and a database at once, each listening on its own port.

Common ports

PortUsed by
22SSH and SFTP
25Email between mail servers (SMTP)
53DNS
80HTTP
443HTTPS
465, 587Email sent from mail apps (SMTP submission)
993IMAP over TLS (reading email)
3306MySQL and MariaDB
5432PostgreSQL
6379Redis

Ports run from 0 to 65535. Browsers assume port 80 for http:// and 443 for https://, which is why you rarely see them in addresses. You can name a port explicitly: http://example.com:8080.

Listening and open

A program listens on a port. A firewall decides whether outsiders may reach it. A database listening on 3306 should usually be reachable only from the server itself, not from the internet.

See what is listening

On a Linux server:

sudo ss -tlnp

This lists TCP ports that programs are listening on, with the program names. An address of 127.0.0.1 means local only; 0.0.0.0 or * means every network.

Test from outside

nc -zv 203.0.113.10 443

succeeded means the port is reachable. A timeout usually means a firewall; refused means nothing is listening. See ERR_CONNECTION_REFUSED.

Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.