An open port is a numbered doorway on a computer or server where a program is actively listening for incoming network connections. Every port number from 0 to 65,535 belongs to a service: port 443 for HTTPS websites, port 22 for SSH, port 3389 for remote desktop. A port is only a risk when the service behind it is unnecessary, unpatched or exposed to the internet.
Key takeaways
- An open port means a specific program is listening — the port number tells you which service, not the machine in general.
- Ports 443 and 80 are normal on a web server; 3389, 445 and database ports should almost never face the internet.
- Check your own ports with built-in commands, then close or firewall anything you do not recognize or need.
Every time a security report says a server was breached through an exposed service, an open port is usually part of the story. Ports are not mysterious, and they are not automatically dangerous — but you should know which ones are open on your systems, and why.
What are open ports?
An open port is a numbered endpoint on a computer where a program is actively listening for incoming network connections. The IP address names the machine; the port number names the program on that machine. That is how one server can be a website, a mail server and an SSH host at the same address without the traffic getting mixed up.
There are 65,536 ports for TCP and the same number again for UDP, numbered 0 to 65,535. When a port is open, it always means a specific program is listening — never something vague about the machine in general. If nothing is listening, the port is closed, and connection attempts are refused.
Ports fall into three ranges set by IANA, the Internet Assigned Numbers Authority — see the common ports cheat sheet for the full list — the Internet Assigned Numbers Authority, which keeps the official registry of which service each port belongs to.
Well-known ports (0–1,023) hold the foundational services such as DNS, HTTP and HTTPS. Registered ports (1,024–49,151) belong to specific applications such as MySQL and remote desktop. Dynamic ports (49,152–65,535) are picked by your computer as the source port for outgoing connections.
How do ports work?
When your browser loads a website, it opens a connection to the server's IP address on port 443, the HTTPS port. The server's web software is listening there, so it answers. Your computer picks a random dynamic port as its own end of the connection, which is how it can hold many connections at once.
A connection is identified by four things: the source IP, the source port, the destination IP and the destination port. That four-part combination is why one server port can serve thousands of clients at the same time, and why a firewall can allow port 443 while blocking everything else.
TCP and UDP use separate port spaces. TCP is the reliable protocol: it checks that every packet arrives, which suits web pages, email and file transfers. UDP sends packets without checking, which suits DNS lookups, video calls and gaming, where speed matters more than perfect delivery. TCP port 53 and UDP port 53 are different doors, even though both belong to DNS.
What are the most common open ports?
You will meet the same dozen ports again and again. The TCP and UDP port reference follows the IANA registry port by port. Learn them once and most port lists become readable at a glance.
| Port | Protocol | Service | What it does | Safe to expose? |
|---|---|---|---|---|
| 80 | TCP | HTTP | Unencrypted web traffic | Web servers only; usually redirects to 443 |
| 443 | TCP/UDP | HTTPS | Encrypted web traffic; UDP 443 is HTTP/3 | Yes, on web servers |
| 22 | TCP | SSH | Encrypted remote login and file transfer | Only when hardened, ideally behind a VPN |
| 25 | TCP | SMTP | Mail routing between servers | Mail servers only |
| 53 | TCP/UDP | DNS | Hostname-to-IP lookups | Only on intended DNS servers |
| 110 / 995 | TCP | POP3 / POP3S | Email retrieval | Use the encrypted 995, not 110 |
| 143 / 993 | TCP | IMAP / IMAPS | Email retrieval | Use the encrypted 993, not 143 |
| 587 | TCP | SMTP submission | Where mail clients send mail | Yes, with authentication and TLS |
| 3389 | TCP/UDP | RDP | Windows Remote Desktop | No — never expose directly |
| 3306 | TCP | MySQL / MariaDB | Database connections | No — internal only |
| 5432 | TCP | PostgreSQL | Database connections | No — internal only |
| 27017 | TCP | MongoDB | Database connections | No — never expose |
| 445 | TCP | SMB | Windows file and printer sharing | No — never expose to the internet |
| 23 | TCP | Telnet | Unencrypted remote login | No — should not exist on modern networks |
Two ports deserve special attention. Port 3389, Remote Desktop, is a favorite ransomware entry point: attackers scan the whole internet for it and brute-force the login. Port 445, Windows file sharing, has been abused by worms for decades and should never face the internet. If either shows up on a public scan of your network, treat it as urgent.
What is the difference between open, closed and filtered ports?
A port scan reports three states. Open means a program is listening and answered. Closed means nothing is listening and the machine refused the connection. Filtered means a firewall blocked the probe, so the scanner cannot tell whether anything is listening behind it.
Filtered is usually the state you want for ports you do not need to expose. It gives an attacker no information at all. Closed is fine too, but it confirms the machine exists. Open is only a problem when the service behind it should not be reachable — which is a decision about the service, not about the number.
Why are open ports a security risk?
Every open port is an invitation to try the service behind it. Attackers scan the entire internet continuously, looking for open ports on services with known flaws, weak passwords or default settings. A database port left open with no password has led to real breaches, as has an unpatched remote desktop service.
The risk is not the port number itself. Port 443 is open on every website you visit, and that is fine, because the web server behind it is patched and hardened. The risk is a port that is open by accident — a development server, a forgotten test database, a default service nobody turned off — and exposed to everyone.
That is also why port numbers protect nothing on their own. Moving SSH from port 22 to a random high port hides it from casual scans, but a full scan finds it in seconds. Security through obscurity buys minutes, not safety. Patch the service, require strong authentication, and restrict who can reach it.
How do I check which ports are open?
Check from inside first, then from outside. The inside view shows every listening program; the outside view shows what the internet can actually reach. The two lists are often different, and the difference is where the problems hide.
Check on your own computer
On Windows, open a terminal and run netstat -ano. On macOS or Linux, run ss -tuln. Both list listening ports and, on Windows, the process ID behind each one. Look for anything you do not recognize, then work out which program owns it before you close it.
Check from the internet
For a server, scan it from outside your network. A port scanner such as Nmap, run with permission against your own server, shows exactly what an attacker sees.
You can also check what your public address looks like with our free what is my IP tool.
To look up the domain behind a server, use our free DNS lookup.
Check your home router
Most home networks expose nothing, because the router's firewall blocks incoming connections by default. Ports become exposed when someone enables port forwarding — for a game server, a camera or remote access — and forgets about it. Log into your router, review the port-forwarding rules, and remove any you no longer use. Our guide to how to secure your Wi-Fi covers the router settings worth checking.
Which open ports should you close?
Close anything you do not need, and firewall anything you need only internally. The default answer for a small business is simple: only the ports your public services need should face the internet.
- Close Telnet (23) and FTP (21) outright. Both send credentials in plain text. SSH and SFTP replace them.
- Close database ports (3306, 5432, 27017, 1433, 6379) at the firewall. Databases should only accept connections from your own application servers.
- Close RDP (3389) and SMB (445) to the internet. Use a VPN for remote access and internal file sharing.
- Restrict SSH (22) to trusted IP addresses where possible, disable password login in favor of keys, and add multi-factor authentication.
- Check port 8080. It is the common alternate HTTP port, and it is often exposed by accident on development servers, Jenkins and admin panels.
After closing a port, verify it from outside. A firewall rule that looks right in a console but does not actually block traffic is worse than no rule, because it creates false confidence.
What should you do if a scan finds unexpected open ports?
Do not panic, and do not ignore it either. Work through the list one port at a time: identify the program, decide whether it needs to be reachable, and either close it, restrict it or patch it.
- Identify the service. Match the port to the program listening on it, on the machine itself.
- Ask who needs it. If nobody can name a reason, close it. If only your office needs it, restrict it to your office IP range.
- Patch it. If the service must stay open, make sure it is fully patched and running the latest version.
- Strengthen login. Disable default credentials, require strong passwords or keys, and add MFA where the service supports it.
- Rescan. Confirm the port is closed or filtered from outside, and repeat the check after every major change.
For servers, make this a routine: include a port review in your regular vulnerability scanning cycle, so new services get noticed within weeks, not years.
The bottom line
An open port is a program waiting for a connection. Most of the time that is exactly what you want — your website on 443, your mail on 587. The trouble starts with the ports you forgot about: a database, a remote desktop, a test server that nobody turned off.
List your listening ports, close what you do not need, restrict what you do, and check again from the outside. You can start with the public side right now using the free SSL checker to confirm your website's encryption is sound.
Frequently asked questions
What are open ports in simple terms?
Think of your computer as a building and ports as numbered doors. An open port is a door with a program behind it, ready to answer anyone who knocks. Port 443 is the door for secure websites, port 22 for remote login.
Are open ports dangerous?
Not by themselves. A web server needs port 443 open. The danger comes when a port is open to the internet for a service you do not need, or one with a known flaw — then anyone on the internet can knock on it.
How many ports are there?
There are 65,536 ports for TCP and the same number again for UDP, numbered 0 to 65,535. Ports 0 to 1,023 are well-known system ports, 1,024 to 49,151 are registered ports, and 49,152 to 65,535 are dynamic ports used for outgoing connections.
What is the difference between TCP and UDP ports?
TCP ports carry connections that check every packet arrives, like web pages and file transfers. UDP ports carry fire-and-forget traffic, like DNS lookups and video calls. TCP port 53 and UDP port 53 are completely separate doors.
How do I check which ports are open on my computer?
On Windows run netstat -ano in a terminal, on macOS and Linux run ss -tuln. Both list listening ports and the program behind each one. For a server, scan it from outside with a port scanner to see what the internet sees.
Should I close port 3389?
Yes, unless you have a specific, hardened reason to expose Remote Desktop to the internet. Port 3389 is a favorite ransomware entry point. Use a VPN instead, or at minimum restrict it to trusted IP addresses and require multi-factor authentication.
What does it mean if a port is filtered?
Filtered means a firewall is blocking the port, so a scanner cannot tell whether anything is listening behind it. That is usually the state you want for ports you do not need to expose.
Can a website tell which ports I have open?
No, not directly. A website can only see the connection you made to it. An attacker would need to scan your public IP address, which is why a firewall in front of your network matters.
Sources
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.
Checked against the IANA port registry as summarized in the TCP and UDP port references cited, and standard TCP/UDP networking references.
How we write and fact-check →