Networkingbeginner

Port

A numbered endpoint on a computer that network services listen on, allowing multiple apps to share one server.

Detailed Explanation

A Port is a number (0-65535) that identifies a specific service running on a Server. Think of the server's IP address as a building address, and the port as the apartment number.

Common ports in web development:

  • Port 80 — HTTP (standard web traffic)
  • Port 443HTTPS (encrypted web traffic)
  • Port 3000 — Common for Node.js development servers
  • Port 5173 — Default for Vite dev servers
  • Port 5432 — PostgreSQL databases

When you run npm run dev and see http://localhost:3000, the 3000 is the port your app is listening on. In Production, cloud services like Google Cloud Run assign a port via an environment variable (PORT), and your app must listen on whatever port is assigned.

A Dockerfile typically sets the port with ENV PORT=3000 and the app reads this value to know which port to listen on. The cloud platform then routes incoming traffic from port 443 (HTTPS) to your app's port.

Ready to Build Something Real?

We give you the skills to build, deploy, and own a full product. Professional stack, AI co-pilot, no coding background required.