toolhq.io

All posts
6 min readby Jameel Haider

Common network ports: the numbers worth memorizing

An IP address gets traffic to the right machine; a port number gets it to the right program on that machine. Port 443 on a server might be a web server while port 5432 on the same box is Postgres. Every TCP or UDP connection is really a four part address: source IP, source port, destination IP, destination port.

Ports are 16 bit numbers, 0 through 65535, split by convention into three ranges:

RangeNameUsed for
0 – 1023Well knownStandard services; binding usually needs root/admin
1024 – 49151RegisteredApplications and databases, registered with IANA
49152 – 65535EphemeralChosen automatically by your OS for outgoing connections

That last range answers a common confusion: when your browser connects to a server's port 443, your side of the connection uses a random high port. Thousands of connections to the same destination port stay distinguishable because each has a different source port.

The ports you actually meet

Web:

PortServiceNotes
80HTTPPlain text web traffic; today mostly redirects to 443
443HTTPSHTTP over TLS; also HTTP/3 over UDP on the same number
8080, 8000, 3000, 5173Dev servers, proxiesConventional alternates for local development

Port 8080 exists because 80 requires elevated privileges on Unix systems, so developers and proxies converged on "80 with something in front of it". The difference between the traffic on 80 and 443 is worth understanding fully: see HTTP vs HTTPS.

Remote access and file transfer:

PortServiceNotes
22SSHAlso carries SFTP and SCP
23TelnetUnencrypted; if you see it open, that is a finding
21FTPControl channel; data flows on other ports, which is why FTP and firewalls fight
3389RDPWindows remote desktop; a top target for attackers when exposed

Email:

PortServiceNotes
25SMTPServer to server delivery; residential ISPs commonly block it
587SMTP submissionYour app or mail client sending outbound mail, with STARTTLS
465SMTPSImplicit TLS submission, revived as a standard in 2018
993IMAPSReading mail over TLS

If mail is failing, the split between 25 and 587 is the first thing to check, and MX records are the second.

DNS:

PortServiceNotes
53DNSUDP for most queries, TCP for large responses and zone transfers
853DNS over TLSEncrypted DNS

DNS over HTTPS hides inside 443, indistinguishable from web traffic, which is precisely its design goal.

Databases and infrastructure:

PortService
5432PostgreSQL
3306MySQL / MariaDB
6379Redis
27017MongoDB
1433Microsoft SQL Server
9200Elasticsearch
5672 / 15672RabbitMQ (AMQP / management UI)
9092Kafka

A hard learned rule about this table: none of these should ever be reachable from the public internet. Databases exposed on their default ports get found by scanners within minutes, and unauthenticated Redis and MongoDB instances have fed years of breach headlines. Bind them to private interfaces and reach them through a VPN or SSH tunnel.

Everything else you will recognize:

PortService
123NTP, time sync
67 / 68DHCP
445SMB, Windows file sharing
5900VNC
51820WireGuard (UDP)
1194OpenVPN

What does a port error tell you?

The failure mode tells you something:

  • Connection refused, and instantly: the machine is up, but nothing is listening on that port, or a firewall actively rejected it. The port is closed.
  • Timeout, after long seconds: packets are being silently dropped, almost always by a firewall configured to drop rather than reject. From outside, this is indistinguishable from the host being offline, which is intentional.
  • Connects but the protocol fails: something is listening, but it is not the service you expected. Talking HTTP to a TLS port produces garbage or a reset; browsers show a cipher mismatch style error, covered in our cipher mismatch guide.

nc -zv host 443 or telnet host 443 answers "is anything listening" in one line.

Can two programs share a port?

On one IP and one protocol, no: binding a TCP port that is already bound fails with "address already in use", the error behind every "port 3000 is already taken" moment in development. But the same port number can be reused across different IPs on the same machine, and TCP 443 and UDP 443 are entirely separate, which is how HTTP/3 (UDP) and HTTP/2 (TCP) share the number.

Ports are one axis of addressing; the IP side, subnets, and what makes an address public or private are the other. For those, see public vs private IP addresses and the IP Lookup tool, which shows what the internet sees about any address, including your own.