What is a Port? | Glossary

Glossary

What is a Port?

A port is a number from 0 to 65535 that tells a computer which program should receive incoming network traffic, such as 443 for HTTPS or 22 for SSH.

In networking, a port is a number that tells a computer which program should receive a piece of incoming traffic. If an IP address is the street address of a building, the port is the apartment number: it gets the delivery to the right door inside.

How port numbers route traffic

Ports belong to the TCP and UDP protocols and range from 0 to 65535. A server program "listens" on a port, and a client connecting to that address and port is handed to it. Your own device also picks a temporary port for its side of each connection, which is how one laptop can have dozens of browser tabs talking to the same site without mixing up the replies.

Ports 0 to 1023 are the well-known range, assigned by IANA to standard services. A few you will meet:

  • 80: HTTP, unencrypted web traffic.
  • 443: HTTPS, encrypted web traffic.
  • 22: SSH, remote server login.
  • 25, 587 and 465: sending email (SMTP).
  • 53: DNS lookups.

Why you rarely type a port

Browsers assume 443 for https:// and 80 for http://, so https://example.com really means https://example.com:443. You only see port numbers when something runs on a non-standard one, such as a development server at localhost:3000 or a router admin page on 8080.

Example: setting up email in an app

A shop owner connects their website's contact form to their email provider. The settings ask for an SMTP host and port. Choosing 587 with STARTTLS or 465 with SSL works; choosing 25 often fails, because many cloud hosts and home internet providers block outgoing traffic on port 25 to limit spam. A wrong port here is one of the most common reasons form emails never arrive.

Ports and security

Every open port is a program that strangers can try to talk to. A firewall controls which ports accept connections from outside. A public web server usually needs only 80 and 443 open to the world, with SSH limited to trusted addresses.

Mistakes involving ports

  • Exposing a database port to the internet. Database ports such as 3306 for MySQL or 5432 for PostgreSQL should not be reachable from everywhere.
  • Two programs on one port. Only one can listen; the second fails to start with an "address in use" error.
  • Forgetting the firewall after changing ports. The service runs, but nobody can reach it.
  • Confusing a port with a physical socket. Network ports are numbers in software, not the USB or Ethernet holes on a device.

Related terms

  • IP address: the machine a port number belongs to.
  • Firewall: decides which ports are reachable.
  • Localhost: where development ports are most visible.
  • Web server: the program listening on 80 and 443.

Ready to put this into practice?

We.Inc lets you describe a site in chat and watch AI build it live, then refine it visually or in code.

Start Building

No credit card required

Describe your business. Get a website ready to publish.

Keep exploring

Related Resources

From the Blog

Guides

SEO Reporting: What to Track and How to Report Results

How to build an SEO report people actually read: which metrics to track from Search Console and analytics, how to report rankings honestly, a monthly report template, and a workflow that takes an hour instead of a day.

Read
Guides

Drupal Sites and Black October: Updating PHP Without Breaking Drupal

PHP2Shell affects Drupal through PHP itself. How to read the version from the Status report, why Drush can show the wrong number, what to do on Drupal 7, and how to roll the update across several environments.

Read
Guides

Still on PHP 7.4, 8.0 or 8.1? Your Options After PHP2Shell

There is no official PHP release fixing Black October for PHP 8.1 and older. What the PHP team did provide, where patched builds can come from, and how to decide between backports and upgrading.

Read

Ready to simplify everything?

Join 15,000+ businesses that replaced their entire marketing stack with one platform.

No credit card required · Talk to sales

Product

Who It's For

Features

Resources

Company

View Sitemap