RelicRELIC
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 7 min read

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.

The three port ranges

IANA 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

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 RSA covers which key type to pick.

Databases

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

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

These are not IANA assignments, just habits that frameworks settled on. They are worth listing because they are the ports a developer types most in a day.

PortProtocolConvention
3000TCPNode dev serverNext.js, Create React App, Express default
5173TCPVite dev serverVite's default port
8000TCPPython dev serverDjango runserver, http.server, Uvicorn
None of the dev ports are reserved, 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.

Finding 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.

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·9 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
8 min

JSONPath examples

JSONPath is XPath for JSON. One small store document, threaded through wildcards, slices, filters and recursive descent, with the honest note on how implementations vary.

Read
8 min

jq cheat sheet

jq is sed for JSON. The filters you use most, built up against one API response so every command has a visible result, from map and select to group_by and raw output.

Read
developernetworkingreference