What Is a Port in Networking?

A network port is a numbered endpoint (0-65535) that lets multiple services run and communicate on the same device via the same IP address.

Published November 17, 2026

A port is a 16-bit number (0–65535) that identifies a specific service on a machine, so one IP address can run many network services at once. An address like 192.168.1.5:443 means the HTTPS service on that host.

The concept

The IP address finds the computer; the port finds the program. TCP and UDP each have their own port space.

Well-known ports (0–1023) include 80 HTTP, 443 HTTPS, 22 SSH, 53 DNS and 25 SMTP. Registered and dynamic ports cover the rest; clients receive a random ephemeral port for each connection.

One host, many services

203.0.113.9:22 → SSH
203.0.113.9:80 → HTTP
203.0.113.9:443 → HTTPS
203.0.113.9:3306 → MySQL

Practical examples

Who is listening?

ss -ltnp
lsof -i :3000

Test if a port is open

nc -zv example.com 443

Listen on a port

app.listen(3000, () => console.log('http://localhost:3000'))

Open a port in the firewall (ufw)

sudo ufw allow 443/tcp

Common mistakes

  • Exposing database ports to the internet.
  • Running two services on the same port.
  • Forgetting UDP vs TCP are separate.

Key takeaways

  • IP = host, port = service.
  • Well-known: 80, 443, 22, 53.
  • Expose only what you need.

FAQ

What is localhost:3000?

Port 3000 on your own machine.

How many ports are there?

65,536 per protocol.

More General articles