What Is a Port? IP Ports, TCP/UDP and the Most Common Port Numbers

Sunucun 5 min read

In computer networking, a port is a numbered endpoint that decides which application or service on a device receives incoming data. If the IP address is the device’s address on the network, the port number is the door number at that address. For example, a web server accepts HTTPS requests on port 443 and SSH connections on port 22. Port numbers range from 0 to 65535. In this article we explain what a port means, how IP addresses and ports work together, TCP and UDP ports, the most common port numbers, how to check open ports and port security.

Illustration: What Is a Port? IP Port…

What Does Port Mean? A Simple Analogy

Imagine a large apartment building. The building’s address is like an IP address: the mail carrier brings the letter to the right building. But they also need to know which apartment it belongs to; apartment numbers correspond to ports. A single server can publish a website, receive email and be managed remotely at the same time because each service “listens” on a different port. The destination port number of an incoming packet decides which service it goes to.

Note: the word “port” is also used for hardware (USB port, HDMI port, DisplayPort). The port in this article is not a physical socket but a logical number used by networking software.

IP Address and Port (IP:Port Notation)

The two ends of a network connection are identified by an IP address + port number pair, usually written with a colon: 203.0.113.10:443. This pair is also called a socket. When your browser connects to a site, it connects to port 443 on the destination server; on your side the operating system picks a temporary (dynamic) source port, for example 192.168.1.20:52814. The server sends its reply to that source port. If no port is written in an address, the protocol’s default port is used: 80 for http:// and 443 for https://. For the bigger picture, see our article what is a network, and for addressing, what is an IP address.

Port Number Ranges

RangeNameUse
0–1023Well-known portsCore services such as HTTP, HTTPS, SSH and DNS. On Linux, listening on these ports requires administrator privileges.
1024–49151Registered portsPorts registered with IANA for specific applications, such as MySQL (3306) and RDP (3389).
49152–65535Dynamic / private portsSource ports the operating system assigns temporarily for outgoing connections.

Port assignments are managed by IANA; for the full list, see the list of TCP and UDP port numbers.

TCP vs UDP Ports

Ports are used with two main transport protocols, and the same number exists separately for TCP and UDP (TCP 53 and UDP 53 are different ports).

  • TCP (Transmission Control Protocol): Sets up a connection with a three-way handshake before sending data, resends lost packets and delivers packets in the right order. Web (HTTP/HTTPS), email (SMTP/IMAP), SSH and database connections use TCP.
  • UDP (User Datagram Protocol): Sends without setting up a connection; there is no delivery or ordering guarantee, but lower overhead gives lower latency. DNS queries, live streaming, voice calls (VoIP), online games and HTTP/3 (QUIC) use UDP.

Most Common Port Numbers

PortProtocolServiceDescription
20, 21TCPFTPFile transfer (21 for commands, 20 for data in active mode). Unencrypted; SFTP or FTPS should be preferred.
22TCPSSH / SFTPEncrypted command-line access to a server and secure file transfer.
23TCPTelnetOld, unencrypted remote access; should not be left open to the internet.
25TCPSMTPEmail relay between servers.
53UDP/TCPDNSTurns domain names into IP addresses; mostly UDP.
80TCPHTTPUnencrypted web traffic.
110TCPPOP3Downloading email to a client (unencrypted).
143TCPIMAPAccessing email on the server (unencrypted).
443TCP (UDP for HTTP/3)HTTPSWeb traffic encrypted with TLS.
465TCPSMTPSSending email over SSL/TLS.
587TCPSMTP (submission)Email clients sending mail with authentication (STARTTLS).
993TCPIMAPSIMAP over SSL/TLS.
995TCPPOP3SPOP3 over SSL/TLS.
2083 / 2087TCPcPanel / WHMSSL access to the cPanel and WHM control panels.
3306TCPMySQL / MariaDBDatabase connections; usually kept closed to the outside.
3389TCP/UDPRDPWindows Remote Desktop connection.
5432TCPPostgreSQLDatabase connections.
8080TCPHTTP alternativeCommon alternative web port for test servers, proxies and application servers.
8443TCPHTTPS alternative / PleskAlternative HTTPS port; default access port of the Plesk panel.

How to Check Open Ports

Ports listening on your own computer (Windows): This command in Command Prompt lists listening ports and process IDs (PIDs); match the PID in Task Manager to find which program uses the port:

netstat -ano | findstr LISTENING

Can you reach a port on a remote server? (Windows PowerShell):

Test-NetConnection sunucun.com.tr -Port 443

The line TcpTestSucceeded : True in the output shows the port can be reached.

Listening ports on a Linux server and a remote port test:

sudo ss -tulpn
nc -zv example-server.com 22

Use port scanning tools (such as nmap) only on systems you own or have permission to scan.

What Is Port Forwarding?

Devices at home use private IP addresses behind the router, so they cannot be reached directly from the internet. Port forwarding means the router passes traffic arriving on a specific external port to a specific port on a device in the network; it is used, for example, for a game server or a security camera. Every forwarded port is a door open to the internet, so forward only the ports you really need and keep that device’s software up to date.

Port Security and Firewalls

Every open port is an entry point whose safety depends on the service listening on it. Attackers find open ports and running services with port scans, then try known vulnerabilities. Basic rules:

  • Turn off services you do not need: If you do not use FTP, close port 21; disable Telnet and unused services completely.
  • Do not expose database ports: If the database is only used from the same server, bind 3306 or 5432 to local access only (127.0.0.1).
  • Restrict management ports: Use a firewall to allow SSH (22) and RDP (3389) only from IP addresses you trust, use SSH keys instead of passwords, and install tools such as Fail2Ban against brute-force attempts.
  • Prefer encrypted versions: Use 995/993 instead of 110/143 and SFTP instead of FTP.

To configure firewall rules, see our guide on firewall tools for Linux. For full control over port and firewall rules, a VDS server with root access on Linux or Administrator access on Windows is a good fit.

Conclusion

A port is a number from 0 to 65535 that lets traffic reach a specific service at an IP address; the IP address identifies the device and the port number identifies the service on it. The ports you meet most often are 80/443 for the web, 22 for SSH, 587/993 for email and 3389 for Windows Remote Desktop. Check listening ports with netstat or ss, close the ports you do not need and allow management ports only from addresses you trust.

Categories

Latest guides