# Network Ports, 80 and 443

> What a port number is and how one server runs many programs on one address. The ports to know: 22, 80 and 443, and why most should stay shut.

**Course:** [Computer Networking](https://learn.benibix.com/learn/infrastructure-networking)  
**Time:** 10 min

**After this lesson you can:**

- Say what a port number picks out
- Name the ports for SSH, HTTP and HTTPS
- Explain why unused ports stay closed

## What a port number picks out

An IP address finds the machine. A port number finds the program on it. Each port is a number from 0 to 65535. A web page asks for port 443, a remote login asks for port 22, and both can reach the same server at the same address. The port tells the server which program should answer.

An address with its port is written with a colon, such as 203.0.113.10:443. Most of the time you never see the port, because each kind of traffic has a usual number. A browser asks for 80 for plain web pages and 443 for secure ones, without being told.

A few ports are worth learning by heart. Port 22 is SSH, for logging in to a server. Port 80 is plain HTTP. Port 443 is HTTPS. Port 53 is for looking up names. Databases have their own, such as 5432 for PostgreSQL and 3306 for MySQL.

A program that waits for requests on a port is said to listen on it. A web program listens on 80 and 443. If nothing listens on a port, a request to it gets no answer. Two programs cannot listen on the same port on the same address at once.

Your own computer uses ports too. When your browser connects to a server, it picks a high, random port on your side, such as 51,734, for the replies to come back to. That is why one laptop can have twenty tabs open to the same site.

Every port that answers from the outside is a door someone can knock on. Attackers scan the whole internet for open ones, all day. So a server should answer only on the ports it really needs, often just 22, 80 and 443.

A common mistake is to leave a database port open to the world because it worked that way in testing. The database should answer only to the app that uses it. Bots find an open database port within hours. They try every password they know.

![Three requests arrive at one server with the address 203.0.113.10. The one for port 443 reaches the web program for HTTPS. The one for port 22 reaches the login program for SSH. The one for port 5432 is stopped with a cross, because the database is closed to the outside. A note says there are 65,536 numbers from 0 to 65535, and each open one is a way in.](https://learn.benibix.com/diagrams/infc-ports.svg)

### Example: Lucy checks her new server

Lucy rents a server and runs a scan against it from her laptop. It shows ports 22, 80, 443 and 5432 answering.

Her shop only needs the first three. She closes 5432, so the database now answers only to the shop's own code on the same machine.

**Words in this lesson:** [Network Port](https://learn.benibix.com/term/infrastructure/port)

**Question:** One server runs a website and a login service at the same address. How do requests reach the right one?

**Answer:** Each program listens on its own port number. The address finds the machine and the port finds the program. Web traffic asks for 443 and logins ask for 22, so each lands at the right one.

---

Source: https://learn.benibix.com/learn/infrastructure-networking/network-ports-80-and-443
Author: Behnia Zarei (a developer in Vienna, Austria, who builds and teaches data, AI and business intelligence at BENIBIX)
Publisher: BENIBIX Learn (https://learn.benibix.com/)
Last updated: 2026-11-19
Licence: CC BY 4.0 (https://creativecommons.org/licenses/by/4.0/). Quote freely with attribution.
