A port is a numbered endpoint on your computer that allows different applications to communicate over the network simultaneously. When you visit localhost:3000, the '3000' is the port — it tells your browser which application to connect to. Different services run on different ports to avoid conflicts.
Ports are like apartment numbers in a building. The building (your computer) has one address, but each apartment (port) houses a different service.
| Port | Typical Use |
|---|---|
| 3000 | Next.js, React dev server |
| 3001 | Secondary dev server |
| 5173 | Vite dev server |
| 5432 | PostgreSQL database |
| 6379 | Redis |
| 8080 | Alternative HTTP server |
| 443 | HTTPS (production) |
| 80 | HTTP (production) |
The most common port-related issue for vibe coders:
Error: listen EADDRINUSE: address already in use :::3000
This means another process is already using that port. Fixes:
npm run dev -- --port 3001In development, you explicitly see ports (localhost:3000). In production, ports are hidden:
When building full-stack applications, you might run multiple services simultaneously. Each needs its own port so your computer knows which service should handle each request.