A port numberPort A numbered door on a server. Each service listens behind its own door: web pages on 443, email on others, remote login on 22. More about Port → tells a server which program should receive an incoming connection. This page is the quick reference: the ports you will actually meet when running a website or server, what each one does, and whether it should ever face the open internet. If you want the idea explained from scratch, start with what a port number is.
The ports most site owners need are 80 (HTTP), 443 (HTTPSHTTPS The secure version of the web, shown by the padlock. Everything sent between you and the site is scrambled so nobody in between can read or change it. More about HTTPS →), 22 (SSHSSH A secure way to type commands on a server from your own computer, as if you were sitting at it. More about SSH →), 25, 465 and 587 (email sending) and 993 (secure email reading). Databases such as MySQL (3306) and PostgreSQL (5432) should not be open to the internet; keep them on the local machine or behind a firewallFirewall A gatekeeper that decides which connections are allowed into a server and blocks the rest. More about Firewall →.
Web ports
| Port | Protocol | Used for | Open to the internet? |
|---|---|---|---|
| 80 | TCP | HTTP, plain unencrypted web traffic | Yes, usually only to redirect to HTTPS |
| 443 | TCP and UDP | HTTPS, encrypted web traffic (UDP carries HTTP/3) | Yes |
| 8080 | TCP | Alternative HTTP, often a proxy or a test server | Only if you chose to |
| 8443 | TCP | Alternative HTTPS | Only if you chose to |
Port 80 stays open even on HTTPS-only sites, because browsers and certificate checks still arrive there first. See how HTTPS works.
Remote access ports
| Port | Protocol | Used for | Open to the internet? |
|---|---|---|---|
| 22 | TCP | SSH and SFTP | Yes, but protect it with keys |
| 21 | TCP | FTP, an old and unencrypted file transfer method | Avoid; use SFTP instead |
| 3389 | TCP | Remote Desktop on Windows servers | Restrict to known addresses |
| 5900 | TCP | VNC remote screens | Never directly; tunnel it |
Bots scan port 22 constantly. Moving SSH to another port reduces log noise but is not real security; SSH keys and a firewall are what protect you.
Email ports
| Port | Used for | Notes |
|---|---|---|
| 25 | Server to server email delivery (SMTP) | Many hosts block it for outgoing mail from ordinary servers |
| 465 | SMTP over implicit TLS | Used by mail apps to send |
| 587 | SMTP submission with STARTTLS | The standard port for mail apps to send |
| 993 | IMAP over TLS | Reading mail while leaving it on the server |
| 995 | POP3 over TLS | Downloading mail to one device |
| 143 and 110 | IMAP and POP3 without encryption | Avoid; use 993 and 995 |
If you are setting up a mail app, pick 587 or 465 to send and 993 to receive. Mail that lands in spam is rarely a port problem; see why emails go to spam.
Name and network services
| Port | Protocol | Used for |
|---|---|---|
| 53 | UDP and TCP | DNS, answering questions about domain names. See how DNS works |
| 123 | UDP | NTP, keeping the server clock correct |
| 67 and 68 | UDP | DHCP, handing out addresses on a local network |
Only run your own DNSDNS The internet’s phone book. It turns a name people can remember, like example.com, into the number address computers use to find the server. More about DNS → server on port 53 if you mean to. Most sites use their registrar’s or host’s nameservers.
Database and cache ports
| Port | Service | Open to the internet? |
|---|---|---|
| 3306 | MySQL and MariaDB | No |
| 5432 | PostgreSQL | No |
| 6379 | Redis | Never |
| 11211 | Memcached | Never |
| 27017 | MongoDB | No |
These services were built to be reached by your own applications on the same server or private network. Exposing them is one of the most common causes of hacked servers. If an application on another machine needs the database, allow only that machine’s address in the firewall, or connect through an SSH tunnel.
Control panel ports
| Port | Service |
|---|---|
| 2082 and 2083 | cPanel, plain and secure |
| 2086 and 2087 | WHM, plain and secure |
| 2095 and 2096 | Webmail in cPanel, plain and secure |
| 8443 | Plesk |
| 10000 | Webmin |
Always use the secure variant, such as 2083 and 2087. The cPanel and WHM guides show what each panel does once you are inside.
How to check which ports are open
On the server, list what is listening:
sudo ss -tulpn
From another computer, test a single port:
nc -zv example.com 443
A line saying the connection succeeded means the port is reachable. If it times out, a firewall is probably blocking it; if it says connection refused, nothing is listening there. The difference matters when you are chasing ERR_CONNECTION_REFUSED.
Rules of thumb
- Open only what you use. Every open port is something a stranger can try.
- Prefer encrypted ports: 443 over 80, 22 over 21, 993 over 143.
- Never expose databases, Redis or Memcached directly.
- When a service will not connect, check the firewall rule, then whether the service is listening, then whether your host blocks the port upstream.
Official documentation
Related
- What a port number is, the idea behind this list.
- How to set up a firewall on Linux, to close what you do not need.
- How to connect to a server with SSH, for port 22 in practice.
Something out of date? Software changes. If a step no longer works, tell us and we will check it and update the page.


