Back to Blog
Network 2026-01-10 7 min read

How to Find Open Ports on Your Website

Open ports are one of the most common attack vectors. Learn how to detect, audit, and close ports that expose your server to risk.

Network Security

What Are Open Ports and Why Do They Matter?

Every service running on your server listens on a port — a numbered channel through which network traffic flows. Port 80 for HTTP, 443 for HTTPS, 22 for SSH. When a port is open, it means a service is actively listening for connections on that port.

The problem: every open port is a potential entry point for attackers. If a service is misconfigured, outdated, or running with default credentials, an open port becomes an open door.

Ports That Should Never Be Publicly Exposed

3306
MySQL
Critical

Database directly accessible from internet. Any credentials leak = full data breach.

5432
PostgreSQL
Critical

Same as MySQL. Never expose database ports publicly.

27017
MongoDB
Critical

Historically misconfigured with no auth. Billions of records leaked this way.

6379
Redis
Critical

Default install has no password. Exposed Redis = remote code execution.

22
SSH
High

Should be restricted to specific IPs or use key-only auth. Never password auth publicly.

8080 / 8443
Dev servers
High

Development servers accidentally left running in production.

21
FTP
High

Unencrypted file transfer. Use SFTP instead.

How to Scan for Open Ports

There are several ways to check which ports are exposed on your server:

nmap (command line)
nmap -sV -p 1-65535 yourdomain.com

The industry standard port scanner. Shows open ports and the service version running on each.

ScanYour.Site (automated)
Enter your domain and click Scan Now

Runs nmap automatically and shows results with severity ratings and remediation steps. No setup required.

How to Close Unnecessary Ports

Step 1: Identify which service is using the port
sudo ss -tlnp | grep :[PORT]
Step 2: Stop the service if not needed
sudo systemctl stop [service] && sudo systemctl disable [service]
Step 3: Block with firewall even if service is stopped
sudo ufw deny [PORT]
Step 4: Verify the port is closed
nmap -p [PORT] yourdomain.com

Port Security Checklist

Only ports 80 and 443 open publicly for web servers
SSH restricted to specific IP ranges or key-only
All database ports firewalled from public internet
Development servers not running in production
Firewall rules documented and reviewed quarterly
Automated port scanning scheduled to detect changes

Scan your open ports now

ScanYour.Site runs a full port scan using nmap and shows you exactly which ports are exposed and what to do about them.

Scan My Site Now