Network security

Common Ports List: 40+ TCP and UDP Ports Explained (With Security Guide)

Port 443 is HTTPS, 22 is SSH, 53 is DNS — but which ports should actually be open on your server? This list covers the ports you will meet, and the ones to close.

Cysoro Security TeamPublished · 8 min read
PORT SERVICE STATE 22SSH 53DNS 80HTTP 443HTTPS 23Telnet 3389RDP Green = safe to expose · Red = keep closed NETWORK SECURITY Commonports 40+ ports, what they do, what to close.
Quick answer

The most common ports are 22 (SSH), 53 (DNS), 80 (HTTP), 443 (HTTPS), 25, 465 and 587 (email), 143 and 993 (IMAP), 3306 (MySQL), 5432 (PostgreSQL) and 3389 (RDP). Ports run from 0 to 65535: 0-1023 are well-known system ports assigned by IANA, 1024-49151 are registered ports, and 49152-65535 are dynamic ports used for outgoing connections.

Key takeaways

  • Ports 0-1023 are well-known system ports, 1024-49151 are registered, and 49152-65535 are dynamic ports for outgoing connections.
  • Only a handful of ports should face the internet: 80 and 443 for web servers, 25 for mail servers, and 22 for SSH with key-only login.
  • Never expose 23 (Telnet), 3389 (RDP), 3306 (MySQL) or 5432 (PostgreSQL) directly to the internet.

Every service on a network listens on a numbered port, and knowing which number means what is the fastest way to read a firewall rule, a scan report or a server log. Port 443 is HTTPS, 22 is SSH and 53 is DNS — but the list does not stop there, and some of the numbers you will meet should never be reachable from the internet at all.

What is a port?

A port is a 16-bit number, from 0 to 65535, attached to a network connection. The IP address gets a packet to the right machine, and the port gets it to the right program on that machine.

TCP and UDP each have their own set of 65,536 ports. TCP port 53 and UDP port 53 are separate ports that happen to serve the same service, DNS. TCP guarantees delivery and order, which suits web pages, email and file transfers. UDP is connectionless and fast, which suits DNS lookups, video calls and gaming.

The Internet Assigned Numbers Authority (IANA) keeps the official registry of which service each port belongs to, in the Service Name and Transport Protocol Port Number Registry. A port number is a convention, not a law: any program can be configured to listen on any port, so a service running on a strange port is worth a second look.

What are the three port ranges?

IANA divides the port space into three ranges: well-known ports (0-1023), registered ports (1024-49151) and dynamic ports (49152-65535). The range tells you how official a number is, and who is allowed to use it.

The three IANA port ranges 0 – 1023 · Well-known (system) ports Core services: SSH 22, DNS 53, HTTP 80, HTTPS 443. Binding needs admin rights. 1024 – 49151 · Registered (user) ports Applications that registered a number: RDP 3389, MySQL 3306, PostgreSQL 5432. 49152 – 65535 · Dynamic (ephemeral) ports Never assigned to services. Your computer picks one as the source port for outgoing connections. Total: 65,536 ports for TCP and 65,536 for UDP.
The three IANA port ranges, from the official port number registry. Illustration by Cysoro.
RangeNameWhat lives thereExamples
0-1023Well-known / systemCore internet services, assigned by IANA22 SSH, 53 DNS, 80 HTTP, 443 HTTPS
1024-49151Registered / userApplications that registered a number3306 MySQL, 3389 RDP, 5432 PostgreSQL
49152-65535Dynamic / ephemeralTemporary client-side ports, never assignedYour browser's outgoing connections

Which ports do websites use?

Web traffic uses ports 80 and 443, plus a few alternates for development and proxies. On a public web server, these are usually the only ports the whole internet needs to reach.

PortProtocolServiceExpose to the internet?
80TCPHTTPYes, usually only to redirect to 443
443TCP + UDPHTTPS (UDP 443 is HTTP/3 over QUIC)Yes, on a web server
8080TCPHTTP alternate (Tomcat, Jenkins, proxies)Only if intended; often exposed by accident
8443TCPHTTPS alternateOnly if intended
8000TCPDevelopment serversNo
3128TCPSquid proxyNo, unless it is a public proxy

If your site loads over HTTPS, you can check its certificate and headers with our free SSL checker. Port 8080 deserves a special mention: it is the port most often left open by accident, usually by a test server or admin panel that was never meant to be public.

Which ports are used for remote access?

Remote access ports let you log in to another machine, and they are the ports attackers scan first. Treat every one of them as a door that needs a strong lock.

PortProtocolServiceSecurity verdict
22TCPSSH, SFTP, SCPOpen only when hardened: key-only login, no root login
23TCPTelnetNever: logins cross the network unencrypted
3389TCP + UDPRemote Desktop (RDP)Never expose directly; use a VPN
5900TCPVNCNever expose directly; tunnel over SSH or VPN
5938TCP + UDPTeamViewerOutbound only; keep the client updated
51820UDPWireGuard VPNYes, if it is your VPN endpoint
1194TCP + UDPOpenVPNYes, if it is your VPN endpoint
1723TCPPPTP VPNAvoid: PPTP encryption is broken

CISA has warned repeatedly about internet-exposed RDP, which is a common entry point for ransomware. If you need remote access to a Windows machine, put a VPN in front of it rather than opening 3389 to the world. Our guide to securing your Wi-Fi and home network covers the same principle for home routers.

Which ports does email use?

Email uses different ports for sending mail between servers, submitting mail from your device, and reading your inbox. The plain-text versions are legacy; the encrypted versions are the ones to use.

PortProtocolServiceNotes
25TCPSMTP, server to serverMail servers only; many clouds block outbound 25
465TCPSMTP submission over implicit TLSModern, encrypted submission port
587TCPSMTP submission with STARTTLSStandard port for mail clients
110TCPPOP3Plain text; use 995 instead
995TCPPOP3 over TLSEncrypted inbox download
143TCPIMAPPlain text; use 993 instead
993TCPIMAP over TLSEncrypted inbox access

If you run your own mail server, port 25 must be open to receive mail from other servers, but it should be closed everywhere else. If your email client is set to port 110 or 143, switch it to 995 or 993 so your password and messages are encrypted.

Which ports do network services use?

These are the ports that keep a network itself running: name resolution, address assignment, time sync and file sharing. Most of them belong on private networks only.

PortProtocolServiceExpose to the internet?
53UDP + TCPDNS (TCP for large answers and zone transfers)Only on an authoritative name server
67 / 68UDPDHCP server / clientNever; DHCP belongs on a private network
69UDPTFTPNever; no authentication, plain text
123UDPNTP time syncOnly if you run a public time server
161 / 162UDPSNMP monitoringNever expose SNMP v1/v2; use v3 behind a VPN
389 / 636TCPLDAP / LDAPS636 only, behind a VPN or allowlist
137-139, 445TCP + UDPNetBIOS / SMB file sharingNever; a classic ransomware target
2049TCP + UDPNFS file sharingNever expose directly

Port 53 deserves care in both directions. An open DNS resolver on your server can be abused for DNS amplification attacks, where small queries trigger large responses aimed at a victim. And if DNS stops working on your own machine, a stale local cache is often the cause — see our guide on how to flush DNS.

Which ports do databases use?

Database ports are the most commonly exposed by mistake, usually because a database was installed with its default settings on a cloud server. A database port open to the internet is an invitation to brute-force attacks and, in the worst cases, data theft or ransomware.

PortProtocolServiceSecurity verdict
3306TCPMySQL / MariaDBDo not expose
5432TCPPostgreSQLDo not expose
1433TCPMicrosoft SQL ServerDo not expose
1434UDPSQL Server BrowserDo not expose
27017TCPMongoDBDo not expose; enable authentication
6379TCPRedisDo not expose; Redis has no auth by default
9200TCPElasticsearchDo not expose; bind to localhost
1521TCPOracle DatabaseDo not expose

The rule is simple: databases should only accept connections from the application servers that need them, on a private network. If you must reach a database remotely, use an SSH tunnel or a VPN, never a public port.

What about FTP, gaming and other common ports?

A few more ports show up constantly in logs and firewall rules. FTP is the oldest of them, and the one most worth replacing.

PortProtocolServiceNotes
20 / 21TCPFTP data / controlPlain text; use SFTP on port 22 instead
990TCPFTPS (implicit TLS)Encrypted FTP, if FTP must stay
43TCPWHOISLookup service, not a server port
514UDPSyslogCentral logging; keep it internal
5060 / 5061TCP + UDPSIP (VoIP)5061 is the TLS version; restrict by allowlist
25565TCPMinecraft Java serverOpen only if you run a public server
27015TCP + UDPSteam / Source game serversOpen only if you run a public server

How do I check which ports are open?

Check from inside the machine first, then from outside. The inside view shows what is listening; the outside view shows what an attacker can actually reach, which is the one that matters.

Check open ports in one command Windows (Command Prompt or PowerShell) netstat -an macOS and Linux ss -tuln Which program owns a port (Linux) sudo lsof -i -P -n | grep LISTEN Then scan the server from outside to confirm what the internet can reach.
One-command port checks for Windows, macOS and Linux. Illustration by Cysoro.
  • Windows: open Command Prompt and run netstat -an. Lines marked LISTENING are open ports. Add -b as an administrator to see which program owns each one.
  • macOS and Linux: run ss -tuln in a terminal. To see the owning process, run sudo lsof -i -P.
  • From outside: use a port scanner such as Nmap (nmap -sV your-server) or an online port checker. This is the view an attacker sees, so it is the one to trust.
  • On a router: log in to the admin panel and review port-forwarding rules. Remove any you do not recognize — a forgotten rule is a common way a home network ends up exposed.

You can also confirm what address the world sees for your connection with our what-is-my-IP tool before you start scanning.

Close ports you cannot explainIf a scan shows an open port and nobody on your team knows why it is open, close it first and ask questions later. An unexplained open port is how forgotten test servers, old databases and compromised machines stay reachable.

Which ports should a small business open?

Most small businesses need far fewer open ports than they think. Start from nothing and add only what a service genuinely requires.

  • Web server: 80/TCP and 443/TCP, plus 443/UDP if you serve HTTP/3. SSH on 22/TCP, restricted to your addresses or behind a VPN.
  • Mail server: 25/TCP, 465/TCP, 587/TCP and 993/TCP, plus 22/TCP for administration.
  • Office network: usually none inbound at all. Staff connect out, and remote workers come in through a VPN on 51820/UDP or 1194.
  • Everything else: databases, file shares, admin panels and monitoring dashboards stay on the private network or behind a VPN.

For a full review of the controls around this, work through our small business cybersecurity checklist.

The bottom line

A port number is a label, not a protection. The services behind ports 80 and 443 are built to face the internet; the services behind 23, 3389, 3306 and 5432 are not, and exposing them is one of the most common and most avoidable mistakes in network security.

Audit your open ports at least once a quarter, close anything you cannot explain, and put a VPN in front of everything that does not need to be public. You can start by checking what your own connection looks like with the free what-is-my-IP tool.

Frequently asked questions

What is the most common port?

Port 443 is the most common port on the public internet because it carries HTTPS, which is how almost all websites are loaded today. Port 80 (HTTP) is next, followed by 22 (SSH) and 53 (DNS). On a typical web server, only 80 and 443 need to be open to the world.

What is the difference between TCP and UDP ports?

TCP ports carry connections that guarantee delivery and order, such as web pages, email and file transfers. UDP ports carry fast, connectionless traffic where a lost packet is acceptable, such as DNS lookups, video calls and online games. TCP port 53 and UDP port 53 are separate ports that happen to serve the same service, DNS.

How many ports are there in total?

There are 65,536 ports for TCP and 65,536 for UDP, numbered 0 to 65535. Ports 0 to 1023 are the well-known system ports, 1024 to 49151 are registered ports, and 49152 to 65535 are dynamic or ephemeral ports that operating systems pick for the client side of outgoing connections.

Which ports should never be open to the internet?

Telnet on port 23 should never be open because logins cross the network in plain text. Remote Desktop on port 3389, MySQL on 3306, PostgreSQL on 5432, SQL Server on 1433 and MongoDB on 27017 should also never be exposed directly. Reach them through a VPN or an allowlisted bastion host instead.

What port does HTTPS use?

HTTPS uses TCP port 443 by default, and UDP port 443 for HTTP/3, which runs over QUIC. HTTP uses TCP port 80. Most sites keep port 80 open only to redirect visitors to the secure port 443 version of the site.

How do I check which ports are open on my computer?

On Windows, run netstat -an in Command Prompt or PowerShell to list listening ports. On macOS and Linux, run ss -tuln or sudo lsof -i -P in a terminal. For a server, scan it from outside with a port scanner or an online port check to see what the internet can actually reach.

What is port 8080 used for?

Port 8080 is the common alternate HTTP port, used by development servers, proxies, Tomcat and Jenkins, and as a second web server on a machine that already uses port 80. It is often exposed by accident, so check whether yours is reachable from the internet and close it if it does not need to be.

Is it safe to leave port 22 open?

Port 22 can be open if SSH is hardened: key-only login, password login disabled, root login disabled, and ideally an allowlist of source addresses or a VPN in front of it. An unhardened SSH server on port 22 is scanned and brute-forced constantly, so never leave default passwords enabled.

Sources

  1. IANA — Service Name and Transport Protocol Port Number Registry
  2. Wikipedia — List of TCP and UDP port numbers
  3. VMHeaven — Common ports list: TCP and UDP port numbers for servers
  4. CISA — Guidance on Securing Remote Desktop Protocol
Written & fact-checked byCysoro Security Team

The engineers and analysts who build Cysoro's domain scanner, email-authentication checks and free security tools. We test what we write about every day — SPF, DKIM, DMARC, certificates, look-alike domains and phishing — and check each guide against the relevant standards, government guidance and vendor documentation.

  • Email authentication
  • Phishing & BEC
  • Domain & DNS security
  • Small-business security

Checked against the IANA Service Name and Transport Protocol Port Number Registry and CISA guidance on exposed services.

How we write and fact-check →

Free tools for this topic

No account needed.

See where your domain stands

Free for up to 3 domains. No card, no installs.

Start free