AI Workshop: learn to build apps with AI →
The Internet: What is a port

Join the AI Workshop and learn to build real-world apps with AI. A hands-on, practical program to level up your skills.


When making network requests, you use an IP address, or a hostname, and a port.

Like this:

  • http://localhost:8080 (port 8080)
  • ftp://127.0.0.1:4321 (port 4321)

What is a port, exactly?

It’s a technique introduced to allow multiple applications to respond on the same computer using the same protocol.

For example, we might have a web server running on our machine. A second web server can be started on a different port.

Say the first runs on port 80, which is the default for web servers using the HTTP protocol. A second web server can run on any other port except port 80. It’s common to use ports 8080 or 81, for example.

HTTPS runs on port 443 by default.

Every protocol has a different default port, but programs are not required to use it. They can use any unused port between 1 and 65,535 (a 16-bit unsigned integer, i.e. 2^16). Here is a list of default port numbers for all protocols based on TCP and UDP.

Lessons in this unit:

0: Introduction
1: What is a URL
2: ▶︎ What is a port
3: The DNS protocol
4: The TCP protocol
5: The UDP protocol