DocumentationSecurity & Ports

Common Network Ports Every Developer Should Know

A reference guide to the most frequently used TCP/UDP ports, their associated services (HTTP, SSH, FTP), and why securing them is critical.

Key Takeaways

  • Ports 80 (HTTP) and 443 (HTTPS) are required for public web servers.
  • Management ports like 22 (SSH) and 3389 (RDP) should be heavily restricted.
  • Database ports should never be exposed to the public internet.

The Web Ports: 80 and 443

The foundation of the World Wide Web relies on two specific TCP ports. Port 80 is the default port for unencrypted HTTP traffic. Port 443 is used for secure, encrypted HTTPS traffic. If you are hosting a website, your firewall must allow inbound connections on these two ports.

Server Management Ports

System administrators rely on specific ports to remotely manage infrastructure. Port 22 (SSH) is the standard for accessing Linux terminals securely. For Windows servers, Port 3389 (RDP) is used for Remote Desktop. Leaving these ports exposed to the public internet without IP-whitelisting invites constant brute-force attacks.

Database Ports

Databases have their own default communication ports. MySQL uses Port 3306, PostgreSQL uses Port 5432, and MongoDB uses Port 27017. Best practices dictate that database ports should never be publicly accessible; they should only accept connections from local application servers or trusted VPN subnets.

Frequently Asked Questions

Can I run a web server on a port other than 80 or 443?

Yes, you can run an application on any port (e.g., 8080 or 3000). However, users will have to explicitly type the port in the URL (like http://example.com:8080). Standard browsers only default to 80/443 when no port is specified.

Supported By

Sponsor Banner