A port is a 16-bit number (0–65535) that distinguishes multiple network services on a single machine sharing one IP address.
If an IP address is a 'building address,' a port is the 'room number,' letting one server run web, mail, SSH, and more simultaneously.
Ports fall into ranges: 0–1023 are well-known ports reserved for standard services (HTTP=80, HTTPS=443, SSH=22, DNS=53; binding them needs admin privileges on Linux), 1024–49151 are registered ports, and above that are dynamic/ephemeral ports clients use temporarily. TCP and UDP have separate port-number spaces, so TCP 80 and UDP 80 are distinct.
On the web, it matters that the port is part of the origin definition: `https://example.com` (443) and `https://example.com:8443` are treated as different origins under the Same-Origin Policy because the ports differ. In URLs the standard ports (80/443) may be omitted, but non-standard ports must be stated. One server serving many domains on a single port (443) is made possible by TLS SNI and virtual hosts in a reverse proxy.