Computer Networking for Beginners series — Part 7. This post continues Part 6: Internet Protocol Explained, which showed how TCP, UDP, and port numbers deliver data to the right application. This part is a practical reference to the well-known port numbers you’ll see on firewalls, servers, and the CompTIA Network+ exam. You can start the series from Part 1: A Complete Guide to How Networks Work.

If you’ve ever configured a firewall, set up FTP to upload a website, or seen “port 443” mentioned in your hosting dashboard, you’ve already run into well-known port numbers — even if nobody explained what they actually were. For a beginner web designer, understanding what these port numbers do makes hosting setup, deployment, and troubleshooting far less mysterious.
A port number is a 16-bit numeric value between 0 and 65535, assigned and maintained by IANA (the Internet Assigned Numbers Authority) so that applications can communicate over a network using TCP or UDP. Ports fall into three categories: well-known ports, registered ports, and dynamic ports. This kind of knowledge is also directly relevant if you’re studying for a networking certification, like CompTIA Network+ or CCNA, where you’re expected to know the common ports by heart.
This guide covers how ports actually work, the three port ranges, a cheat sheet of common well-known port numbers organized by what they’re used for, how ports relate to firewalls and security, and which ones matter most for everyday web design work.
What Is a Port Number?
A port number identifies a specific application or service running on a device, so incoming network traffic knows exactly where to go once it reaches the right IP address. Think of an IP address as a building’s street address, and a port number as the specific apartment or suite inside it.
A server application listens on its port and waits for connections. For example, a web server listens on port 443, so when your browser connects to a website’s IP address on port 443, the connection reaches the web server and not the email server running on the same machine. The combination of an IP address, a protocol (TCP or UDP), and a port number is called a socket. To learn more about sockets and how clients pick their own temporary ports, see Internet Protocol Explained: How Data Travels Across Networks.
Physical Ports vs. Network Communication Ports
Computers actually use two different kinds of “ports,” and it’s easy to mix them up:
- Physical ports — the hardware jacks used to plug in peripherals, like a USB or Ethernet port.
- Network communication ports — logical, software-based ports that operate at the Transport layer using TCP or UDP, directing incoming traffic to the correct application or protocol.
This guide is about the second kind — the ports that make network communication possible.
TCP Ports and UDP Ports
Port numbers are used by two different transport protocols, and each one has its own full set of 65,536 ports:
- TCP is connection-oriented and reliable. It’s used by services where every byte must arrive correctly, like the web, email, and file transfers.
- UDP is connectionless and faster, with no delivery guarantees. It’s used by services that send small, quick messages, like DNS lookups, DHCP, and time synchronization.
That’s why the cheat sheet lists ports as TCP/443 or UDP/123: the protocol matters. A firewall rule that allows TCP port 53 doesn’t allow UDP port 53.
The Three Categories of Port Numbers
All 65,536 possible port numbers fall into three defined ranges:
- Well-known ports: 0–1023 — reserved for common, standardized services like HTTP, HTTPS, and FTP. On most operating systems, a program needs administrator rights to listen on one of these ports.
- Registered ports: 1024–49151 — assigned to specific applications and services, though less strictly controlled than well-known ports. Examples include Microsoft SQL Server (1433), MySQL (3306), RDP (3389), and SIP (5060).
- Dynamic/private ports: 49152–65535 — used temporarily by applications for short-lived connections, and not permanently assigned to any single service. These are also called ephemeral ports.
For the CompTIA Network+ exam, you’ll often see a simpler split: non-ephemeral ports (0–1023), used permanently by servers, and ephemeral ports (1024–65535), used temporarily by clients. In practice, each operating system picks its own ephemeral range — Windows and macOS use 49152–65535, while most Linux systems use 32768–60999.
Well-Known Port Numbers Cheat Sheet
Here are the most common ports you’ll encounter, organized by what they’re used for.
File Transfer
| Port | Service | Description |
|---|---|---|
| TCP/20, TCP/21 | File Transfer Protocol (FTP) | Sends and receives files between systems. Port 21 is the control channel (login and commands), and port 20 carries the data in active mode. Sends everything, including passwords, unencrypted. |
| TCP/22 | Secure FTP (SFTP) | Secure, encrypted file transfer that runs over SSH, using the same port. |
| UDP/69 | Trivial File Transfer Protocol (TFTP) | A very simple file transfer protocol with no authentication and no directory browsing. Used on local networks to load configuration files and firmware onto devices like phones and network equipment. |
FTP has a secure cousin, FTPS (FTP over TLS), which encrypts FTP traffic on the same control port or on ports 989 and 990. SFTP is a completely different protocol, despite the similar name — and it’s usually the easier and more secure choice. To set up your own, see How to Set Up an SFTP Server on Linux.
Remote Access and Management
| Port | Service | Description |
|---|---|---|
| TCP/22 | Secure Shell (SSH) | Encrypted terminal (console) login to servers and network devices. |
| TCP/23 | Telnet | Remote terminal login in clear text — anyone watching the network can read everything, including passwords. Replaced by SSH. |
| TCP/3389 | Remote Desktop Protocol (RDP) | Graphical remote access to a Windows desktop or server. |
For a beginner-friendly guide to secure remote logins, see What Is SSH?
| Port | Service | Description |
|---|---|---|
| TCP/25 | Simple Mail Transfer Protocol (SMTP) | Transfers email between mail servers. |
| TCP/587 | SMTP (submission) | Used by email clients and websites to send mail to their mail server, encrypted with STARTTLS. This is the port to use for a website’s contact form or app. |
| TCP/465 | SMTP over TLS (SMTPS) | Another encrypted port for sending mail, still widely supported. |
| TCP/110 | Post Office Protocol (POP3) | Downloads mail to a mail client, usually removing it from the server. |
| TCP/995 | POP3 over TLS (POP3S) | The encrypted version of POP3. |
| TCP/143 | Internet Message Access Protocol (IMAP4) | A newer mail client protocol that keeps mail on the server, so it stays in sync across devices. |
| TCP/993 | IMAP over TLS (IMAPS) | The encrypted version of IMAP. |
Many home internet providers block outgoing port 25 to stop infected computers from sending spam, which is another reason email clients and websites send mail through port 587 instead.
Network Infrastructure Services
| Port | Service | Description |
|---|---|---|
| UDP/53, TCP/53 | Domain Name System (DNS) | Converts domain names into IP addresses. Normal lookups use UDP; TCP is used for large responses and for zone transfers between DNS servers. |
| UDP/67, UDP/68 | Dynamic Host Configuration Protocol (DHCP) | Automated IP addressing and configuration. The DHCP server listens on port 67, and clients use port 68. |
| UDP/123 | Network Time Protocol (NTP) | Synchronizes device clocks. Accurate time matters more than it seems: logins, encryption certificates, and log files all depend on it. |
| UDP/161 | Simple Network Management Protocol (SNMP) | Gathers statistics and manages network devices: management software polls devices on port 161. |
| UDP/162 | SNMP traps | Devices send alerts (called traps) to the management software on port 162 without being asked — for example, when a link goes down. |
| TCP/389 | Lightweight Directory Access Protocol (LDAP) | Communicates with network directories, like Microsoft Active Directory, to look up users and groups and check logins. |
| TCP/636 | LDAP Secure (LDAPS) | LDAP encrypted with SSL/TLS. |
| UDP/514 | Syslog | Sends log messages from servers and network devices to a central log server, so administrators can monitor everything in one place. |
Web, File Sharing, and Databases
| Port | Service | Description |
|---|---|---|
| TCP/80 | HyperText Transfer Protocol (HTTP) | Web server communication, unencrypted. |
| TCP/443 | Hypertext Transfer Protocol Secure (HTTPS) | Web server communication with encryption. The newest version, HTTP/3, also uses UDP/443. |
| TCP/445 | Server Message Block (SMB) | Windows file transfers and printer sharing. (On Linux, Samba provides SMB — see Samba Server: How to Install and Configure on Ubuntu.) |
| TCP/1433 | Microsoft SQL Server | The default port for Microsoft’s SQL Server database. Other databases have their own, like MySQL on TCP/3306 and PostgreSQL on TCP/5432. |
Voice over IP (VoIP)
| Port | Service | Description |
|---|---|---|
| TCP/1720 | H.323 | An older ITU protocol suite for voice and video calls; port 1720 sets up the calls. |
| TCP/UDP 5060 | Session Initiation Protocol (SIP) | Sets up, manages, and ends VoIP calls, unencrypted. |
| TCP/5061 | SIP over TLS | The encrypted version of SIP. |
SIP and H.323 only set up calls; the voice and video themselves travel separately, over UDP, on a range of ports agreed on for each call.
Quick Reference: Ports in Numerical Order
For quick lookups and exam review, here are the same ports sorted by number:
| Port | Protocol | Service |
|---|---|---|
| 20, 21 | TCP | FTP (data, control) |
| 22 | TCP | SSH, SFTP |
| 23 | TCP | Telnet |
| 25 | TCP | SMTP (server to server) |
| 53 | UDP, TCP | DNS |
| 67, 68 | UDP | DHCP (server, client) |
| 69 | UDP | TFTP |
| 80 | TCP | HTTP |
| 110 | TCP | POP3 |
| 123 | UDP | NTP |
| 143 | TCP | IMAP |
| 161, 162 | UDP | SNMP (polling, traps) |
| 389 | TCP | LDAP |
| 443 | TCP (and UDP for HTTP/3) | HTTPS |
| 445 | TCP | SMB |
| 465 | TCP | SMTP over TLS |
| 514 | UDP | Syslog |
| 587 | TCP | SMTP submission |
| 636 | TCP | LDAPS |
| 993 | TCP | IMAP over TLS |
| 995 | TCP | POP3 over TLS |
| 1433 | TCP | Microsoft SQL Server |
| 1720 | TCP | H.323 |
| 3389 | TCP | RDP |
| 5060 | TCP, UDP | SIP |
| 5061 | TCP | SIP over TLS |
Ports and Firewalls
Port numbers are what make firewalls work. A firewall rule usually says which protocol, port, and source are allowed — for example, “allow TCP port 443 from anywhere” for a public website, or “allow TCP port 22 only from the office network” for remote administration. Everything that isn’t explicitly allowed is blocked.
On a Linux server using the ufw firewall, that looks like this:
sudo ufw allow 443/tcp # HTTPS from anywhere
sudo ufw allow 80/tcp # HTTP (often just redirects to HTTPS)
sudo ufw allow from 203.0.113.0/24 to any port 22 proto tcp # SSH only from one network
sudo ufw enable
A good rule of thumb is to open only the ports a server actually needs. Every open port is a door that someone on the internet can knock on. To learn more about firewalls and the other devices that filter traffic, see Networking Devices Explained.
Ports and Security
Many of the oldest protocols were designed before security was a concern, and they send everything — including usernames and passwords — in clear text. Whenever you can, use the secure replacement:
| Avoid (unencrypted) | Use instead (encrypted) |
|---|---|
| Telnet (23) | SSH (22) |
| FTP (20, 21) | SFTP (22) or FTPS |
| HTTP (80) | HTTPS (443) |
| POP3 (110) and IMAP (143) | POP3S (995) and IMAPS (993) |
| LDAP (389) | LDAPS (636) |
| SIP (5060) | SIP over TLS (5061) |
Some services should never be exposed directly to the internet, because attackers scan for them constantly: RDP (3389), SMB (445), Telnet (23), database ports like 1433 and 3306, and SNMP (161). Reach them through a VPN instead. Also remember that changing a service to a non-standard port doesn’t make it secure — it may reduce automated noise, but scanners can still find it.
How to Check Whether a Port Is Open
When a connection fails, one of the first questions is whether the port is reachable at all. You can test a TCP port with nc (netcat) on macOS and Linux:
nc -zv example.com 443
Connection to example.com port 443 [tcp/https] succeeded!
The connection succeeded, so something is listening on port 443. Now try a port that isn’t open to the public:
nc -zv -G 3 example.com 22 # on Linux, use -w 3 instead of -G 3
nc: connectx to example.com port 22 (tcp) failed: Operation timed out
A timeout usually means a firewall is silently dropping the connection. A “connection refused” message means the device is reachable but nothing is listening on that port.
On Windows, use PowerShell:
Test-NetConnection example.com -Port 443
Look for TcpTestSucceeded : True in the results. Only test ports on servers you own or have permission to test.
Ports Every Web Designer Should Know
You don’t need to memorize the entire cheat sheet, but a handful of these ports come up constantly in web design work:
- Port 80 (HTTP) and Port 443 (HTTPS) — the two ports every website runs on. If a site loads without “https,” it’s likely still using unencrypted port 80.
- Port 21 and Port 22 (FTP/SFTP) — used to upload website files to a server; SFTP on port 22 is the more secure option and generally preferred today.
- Port 22 (SSH) — used to securely log in to a server’s command line, common when managing hosting or a VPS.
- Port 587 (SMTP submission) — used when a website or contact form sends email through a mail server.
- Port 3306 (MySQL) — the database behind WordPress and many other sites. It should stay closed to the internet and only be reachable from the web server itself.
- Port 3389 (RDP) — used to remotely access a Windows server’s desktop, relevant if you ever manage a Windows-based hosting environment.
Knowing these alone will cover the vast majority of situations a beginner web designer runs into when deploying or troubleshooting a site.
Conclusion
Well-known port numbers are the standardized addresses that let common internet services — web traffic, email, file transfers, remote logins — find the right application on a server. Ports fall into three ranges (well-known, registered, and dynamic), and the well-known range from 0–1023 covers nearly every service a beginner web designer will run into. Each port belongs to TCP, UDP, or both, and firewalls use those port numbers to decide what traffic is allowed in and out.
You don’t need to memorize the entire list to get value from this guide. Recognizing a handful of key well-known port numbers — 80 and 443 for web traffic, 21/22 for file transfers, 22 for secure server access, and 587 for sending email — is enough to make hosting setup, firewall configuration, and deployment troubleshooting far less confusing. Bookmark the cheat sheet above, and you’ll have a quick reference ready the next time a port number shows up somewhere unexpected.
Next in the Computer Networking for Beginners series: Network Protocols for Troubleshooting, Tunneling, and Security, the protocols that don’t use ports at all: ICMP, GRE, and IPsec.
Computer Networking for Beginners series: Part 1: A Complete Guide to How Networks Work · Part 2: What Is the OSI Model? · Part 3: Networking Devices Explained · Part 4: CDNs, VPNs, QoS, and TTL · Part 5: Cloud Networking Explained · Part 6: Internet Protocol Explained · Part 7: Well-Known Port Numbers · Part 8: Protocols for Troubleshooting, Tunneling, and Security
