Relic
Get Relic free
Developer cheat sheets

Port numbers list

This is a common ports cheat sheet grouped the way you actually look them up: web, mail, file and shell, databases, infrastructure, and the local dev ports. Each row lists the number, the protocol that matters, and what runs there, so you can stop guessing whether Postgres is 5432 or 5433.

Jordan Gibbs July 10, 2026 5 min readUpdated September 12, 2026

What are the most common port numbers?

The short list: 80 and 443 for web, 22 for SSH, 25, 587 and 465 for mail out, 993 for IMAP over TLS, 53 for DNS, 3306 for MySQL, 5432 for PostgreSQL, 6379 for Redis, 27017 for MongoDB, 3389 for Remote Desktop and 445 for SMB. Everything below groups them by job.

A port number is a 16-bit label that lets one machine run many network services at once. An IP address gets a packet to the right host; the port gets it to the right program on that host. There are 65,536 of them (0 through 65535), and the numbers below are the small handful that people memorize, mistype, or search for over and over.

What are the three port ranges?

RFC 6335 splits the space into three bands, and knowing which band a number lives in tells you a lot about it.

  • Well-known ports, 0 to 1023. Assigned to core services (HTTP, SSH, DNS). On Unix-like systems, binding one usually requires root or an explicit capability.
  • Registered ports, 1024 to 49151. Assigned by IANA to specific applications on request (databases, app servers). No special privilege needed to bind them.
  • Dynamic or ephemeral ports, 49152 to 65535. Never assigned permanently. The operating system hands these out as the source port for outbound connections.

Ports also come in two flavours: TCP, which is connection-oriented and ordered, and UDP, which is fire-and-forget. Most services pick one, a few use both, and the tables below note the protocol wherever it is not obvious.

Web

PortProtocolService
80TCPHTTPUnencrypted web traffic
443TCPHTTPSTLS-encrypted web traffic
8080TCPHTTP altProxies, app servers, dev HTTP
8443TCPHTTPS altSecondary or admin HTTPS

Only the first three are what they look like in the IANA port registry: 80 is http, 443 is https, and 8080 is registered as http-alt. 8443 is registered to something else entirely (pcsync-https), so its use as a second HTTPS port is convention rather than an assignment.

Mail

Mail is the group people get wrong most, because sending and receiving each have an old plaintext port and a newer encrypted one.

PortProtocolService
25TCPSMTPServer-to-server mail relay
587TCPSMTP submissionSending mail from a client (STARTTLS)
465TCPSMTPSSending mail over implicit TLS
110TCPPOP3Downloading mail, plaintext
995TCPPOP3SDownloading mail over TLS
143TCPIMAPReading mail on the server, plaintext
993TCPIMAPSReading mail on the server over TLS
For sending mail from an app or client, use 587 with STARTTLS as the default, or 465 for implicit TLS. Port 25 is for server-to-server relay and is blocked outbound by most consumer ISPs and cloud providers to cut down on spam, so it is rarely the right choice from an application.

File transfer and remote shell

PortProtocolService
20 / 21TCPFTPData (20) and control (21) channels
22TCPSSH / SFTP / SCPEncrypted shell and file transfer
23TCPTelnetLegacy remote shell, unencrypted
69UDPTFTPTrivial FTP, PXE and network boot
445TCPSMBWindows file and printer sharing
3389TCPRDPWindows Remote Desktop

SSH on 22 is the workhorse here, and the same port carries SFTP and SCP. If you are generating the keys that log in over it, our comparison of Ed25519 vs RSAcovers which key type to pick. For the two Windows rows, Microsoft’s own network port requirements list SMB on TCP 445 and Remote Desktop on 3389.

Databases

PortProtocolService
1433TCPMicrosoft SQL ServerDefault MSSQL instance
3306TCPMySQL / MariaDBDefault MySQL server
5432TCPPostgreSQLDefault Postgres server
6379TCPRedisKey-value store
27017TCPMongoDBDefault mongod instance
1521TCPOracleDefault Oracle listener

These are defaults, and every one of them is a setting you can change. PostgreSQL, for example, documents 5432 as the default for its port option. Oracle is the odd one out in the IANA registry: 1521 is registered to an unrelated license manager, and Oracle simply adopted it as the listener default.

Infrastructure and directory

PortProtocolService
53TCP + UDPDNSName resolution (UDP for queries, TCP for large or zone transfers)
67 / 68UDPDHCPServer (67) and client (68)
123UDPNTPNetwork time synchronization
161 / 162UDPSNMPPolling (161) and traps (162)
389TCPLDAPDirectory queries, plaintext or STARTTLS
636TCPLDAPSDirectory queries over TLS
5060TCP + UDPSIPVoIP call signaling

DNS on 53 is the classic “uses both” case. Ordinary lookups go over UDP because they are small and a lost packet is cheap to retry, but responses larger than the UDP limit and full zone transfers fall back to TCP. NTP on 123 and SNMP on 161 stay on UDP, where the low overhead matters more than guaranteed delivery.

Local development conventions

None of these belong to the tools that use them. IANA has 3000 and 8000 registered to unrelated services, and 5173 is not assigned at all. Frameworks just picked them, and they are the ports a developer types most in a day.

PortProtocolConvention
3000TCPNode dev serverNext.js default, Create React App, most Express examples
5173TCPVite dev serverVite's default port
8000TCPPython dev serverDjango runserver, http.server, Uvicorn
Nothing enforces a dev port, so nothing stops two projects from both wanting 3000. When a tool reports that a port is already in use, another process is simply holding that socket; the number itself carries no special status. Stop the other process or pass a different port.

How do you find what is using a port?

When a service will not start because its port is taken, you need to find the process holding it. The command differs by operating system, but the idea is the same: list open sockets and match the port.

Check who holds a port
# macOS and Linux
lsof -i :3000

# Linux (modern)
ss -ltnp | grep :3000

# Windows
netstat -ano | findstr :3000

Each of these prints the process ID (PID) bound to the port. Once you have the PID you can stop that process, or start your own service on a different port. On Windows the PID from netstat maps to a process in Task Manager; on macOS and Linux you can pass it to kill. That is far quicker than restarting the whole machine to free the port.

Where to go from here

Ports sit one layer above IP addressing, so this pairs naturally with the subnet cheat sheet when you are reasoning about what can reach what. For the encrypted services in these tables, the plain-English background on what AES encryption is explains what the TLS ports are actually protecting. And when the thing you are looking up is a text pattern instead of a number, the regex cheat sheet is the sibling reference in this set of cheat sheets.

Sources

Written by
Jordan GibbsFounder, Relic

Jordan Gibbs is the founder of Relic, an end-to-end encrypted, permanent, searchable memory for everything you copy. He writes widely about AI, agents, and practical tooling on Medium, where he is read by tens of thousands, and builds privacy-first software. Here he covers how everyday tools like the clipboard actually work, and how to use them without handing your data to someone else.

MediumGitHubLinkedIn
Part of
Developer cheat sheets
Keep reading
Pillar·10 min

Regex cheat sheet

The regex pieces you actually reach for, character classes through lookarounds, with the flavor differences that bite you and a handful of patterns worth saving.

Read
9 min

How to copy and paste in Vim

y copies and p pastes, but only inside Vim. How registers work, how to reach the system clipboard when your build says -clipboard, and how to copy out over SSH and in tmux.

Read
8 min

How to copy to the clipboard from the command line

Pipe any command into the clipboard on Mac, Linux, Windows and WSL. The commands for each, plus the newline and encoding problems that break pasted text.

Read
developernetworkingreference