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
| Port | Used by |
|---|---|
| 22 | SSH and SFTP |
| 25 | Email between mail servers (SMTP) |
| 53 | DNS |
| 80 | HTTP |
| 443 | HTTPS |
| 465, 587 | Email sent from mail apps (SMTP submission) |
| 993 | IMAP over TLS (reading email) |
| 3306 | MySQL and MariaDB |
| 5432 | PostgreSQL |
| 6379 | Redis |
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.



