Port numbers are defined in the range of 0 ~ 65535 and are broadly divided into three categories.
| category | range | explanation |
|---|---|---|
| Well-Known Ports | 0 - 1023 | Reserved for major services and protocols |
| Registered Ports | 1024 - 49151 | Registered by a specific application or vendor |
| Dynamic/Private Ports | 49152 - 65535 | Used for temporary communication (automatically assigned by OS) |
List of major port numbers
1. Wellknown Port (0 – 1023)
| Port Number | protocol | use |
|---|---|---|
| 20, 21 | FTP | File Transfer Protocol |
| 22 | SSH | Secure Shell (Remote Login) |
| 23 | Telnet | Outdated remote login protocol (deprecated) |
| 25 | SMTP | Send an email (for sending) |
| 53 | DNS | Domain Name System |
| 67, 68 | DHCP | Automatic IP Address Assignment |
| 80 | HTTP | Website (non-SSL) |
| 110 | POP3 | Receive emails (old) |
| 119 | NNTP | newsgroup |
| 123 | NTP | Network Time Synchronization |
| 143 | IMAP | Email reception (currently mainstream) |
| 161, 162 | SNMP | Network Monitoring |
| 179 | BGP | Border Gateway Protocol |
| 389 | LDAP | Directory Services |
| 443 | HTTPS | Website (SSL/TLS compatible) |
| 465 | SMTPS | Send Mail (SSL/TLS) |
| 514 | Syslog | System Log Forwarding |
| 587 | SMTP (Auth) | Send an email (with authentication) |
| 993 | IMAPS | Email Receiving (SSL/TLS Supported) |
| 995 | POP3S | Email Receiving (SSL/TLS Supported) |
2. Registered Port (1024 – 49151)
| Port Number | protocol | use |
|---|---|---|
| 1080 | SOCKS | Proxy Servers |
| 1433 | MS-SQL | Microsoft SQL Server |
| 1521 | Oracle | Oracle Database |
| 3306 | MySQL | MySQL Database |
| 3389 | RDP | Windows Remote Desktop |
| 5432 | PostgreSQL | PostgreSQL Database |
| 5900 | VNC | Virtual Network Computing |
| 6379 | Redis | In-memory databases |
| 8080 | HTTP Proxy | Alternate HTTP port (e.g., Tomcat) |
3. Dynamic Ports (49152 – 65535)
- Mainly used for temporary client connections (automatically assigned by OS)
- Used by web browsers and applications to access a server
- Example:
- When a
https://example.comclient connects49152to , it uses a port from below
- When a
Services where changing the default port is common
1. SSH (Default: 22)
- Recommended: As a security measure, change to a different port (for example,
2222)
sudo nano /etc/ssh/sshd_configModified: yaml
Port 2222Apply:
sudo systemctl restart sshd2. HTTP/HTTPS(80, 443)
- Enterprises and development environments often use 8080 and 8443
- For example:
NginxorApacheto8080
How to find out the port number
1. Check the port you are using (Linux / Mac)
netstat -tulnpor
ss -tulnpSearch for a specific port
netstat -tulnp | grep 80802. Check the port in Windows
netstat -anoOr search for a specific port:
netstat -ano | findstr :80803. Check Docker’s public port
docker psExample: PORTS value
0.0.0.0:5001->5000/tcpThis indicates that the container’s 5000 port number is mapped to the host’s 5001 .
IANA(Internet Assigned Numbers Authority)
IANA (Internet Assigned Numbers Authority) is an international organization that manages the allocation of IP addresses, domain names, port numbers, protocol numbers, and more used on the internet.
IANA is the organization that manages the core identifiers of the Internet and is responsible for three main areas:
| Managed | summary | Related Links |
|---|---|---|
| Domain Name (DNS) Management | Manage root zones (e.g., TLDs: .com, .org, .jp) | IANA DNS Root Zone |
| IP Address Management | Assigning Global IP Addresses (Assigning to RIRs) | IANA IP Address Allocations |
| Port Number and Protocol Management | Official registration of TCP/UDP port numbers | Service Name and Transport Protocol Port Number Registry |
Summary
| Port Number Range | use |
|---|---|
0 - 1023 | Well-known port (for standard service) |
1024 - 49151 | Registered ports (for specific applications) |
49152 - 65535 | Dynamic port (for temporary connection) |
Commonly used ports:
- Web Server:
80 (HTTP), 443 (HTTPS), 8080 (代替 HTTP) - Database:
3306 (MySQL), 5432 (PostgreSQL), 6379 (Redis) - Remote Connection:
22 (SSH), 3389 (RDP), 5900 (VNC)
References
Internet Assigned Numbers Authority (IANA): The organization that manages the official assignment of port numbers
- IANA Service Name and Transport Protocol Port Number Registry
RFC (Request for Comments): Standardized document
- RFC 1700: Assigned Numbers
- RFC 6335: Internet Assigned Numbers Authority (IANA) Procedures for the Management of Service Names and Transport Protocol Port Numbers
Example official document
- SSH (Port Number: 22)
- SSH Communications Security
- URL: https://www.ssh.com/
- OpenSSH official documentation
- SSH Communications Security
- HTTP/HTTPS (port numbers: 80, 443)
- RFC 2818: HTTP Over TLS
- Apache HTTP Server Official Documentation
- Nginx official documentation
- MySQL (port number: 3306)
- MySQL official documentation
- PostgreSQL (port number: 5432)
- PostgreSQL official documentation
Comments