Common network ports and what they are used for

The network ports you will meet most, from 22 for SSH to 3306 for MySQL: what each one is for and whether it should be open to the internet.

3–4 minutes
Network switch with many blue patch cables

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

PortProtocolUsed forOpen to the internet?
80TCPHTTP, plain unencrypted web trafficYes, usually only to redirect to HTTPS
443TCP and UDPHTTPS, encrypted web traffic (UDP carries HTTP/3)Yes
8080TCPAlternative HTTP, often a proxy or a test serverOnly if you chose to
8443TCPAlternative HTTPSOnly 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

PortProtocolUsed forOpen to the internet?
22TCPSSH and SFTPYes, but protect it with keys
21TCPFTP, an old and unencrypted file transfer methodAvoid; use SFTP instead
3389TCPRemote Desktop on Windows serversRestrict to known addresses
5900TCPVNC remote screensNever 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

PortUsed forNotes
25Server to server email delivery (SMTP)Many hosts block it for outgoing mail from ordinary servers
465SMTP over implicit TLSUsed by mail apps to send
587SMTP submission with STARTTLSThe standard port for mail apps to send
993IMAP over TLSReading mail while leaving it on the server
995POP3 over TLSDownloading mail to one device
143 and 110IMAP and POP3 without encryptionAvoid; 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

PortProtocolUsed for
53UDP and TCPDNS, answering questions about domain names. See how DNS works
123UDPNTP, keeping the server clock correct
67 and 68UDPDHCP, 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

PortServiceOpen to the internet?
3306MySQL and MariaDBNo
5432PostgreSQLNo
6379RedisNever
11211MemcachedNever
27017MongoDBNo

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

PortService
2082 and 2083cPanel, plain and secure
2086 and 2087WHM, plain and secure
2095 and 2096Webmail in cPanel, plain and secure
8443Plesk
10000Webmin

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

Get the next guide

One email when there is something worth reading: new guides, errors going around, and hosting changes that affect your site.

No tracking pixels, and one click to leave.

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