← Back to Library Internet & Networking Intermediate 7 min read

What Is a Port in Networking? Common Ports (80, 443, 22) and Sockets

In computer networking, a port is a 16-bit virtual communication endpoint that allows an operating system to direct incoming network traffic to the specific software application running on the machine.

💡 Plain-English Analogy

If your computer's IP address is an apartment building, the port numbers are the individual apartment room numbers. Mail arrives at the building (the IP address), but the letter carrier delivers it directly to apartment #443 (the web server) or apartment #22 (the SSH server).

⚙️ Architecture & Under the Hood

Ports range from 0 to 65535, divided into Well-Known Ports (0–1023, privileged), Registered Ports (1024–49151), and Dynamic/Private Ports (49152–65535). A network socket is defined by the combination of an IP address, a port number, and a transport protocol (e.g. 192.168.1.50:443/TCP).

Essential Port Numbers Every Developer Must Know

Standard internet protocols always listen on well-known default ports.

  • Port 80: HTTP (Unencrypted Web Traffic)
  • Port 443: HTTPS (Encrypted Web Traffic)
  • Port 22: SSH (Secure Shell Remote Server Access)
  • Port 53: DNS (Domain Name Resolution, typically UDP)
  • Port 3000 / 8080: Common development servers (React, Node.js, Vite)
  • Port 5432: PostgreSQL Database default port
  • Port 6379: Redis In-Memory Cache default port

Frequently Asked Questions

Can two different programs listen on the exact same port simultaneously?

No. On a single IP address and transport protocol (TCP or UDP), only one process can bind to a port at any given time. Attempting to start a second program on the same port triggers an EADDRINUSE error.