Quick answer

A port that looks closed from outside is usually one of four things: the service is not listening, it is listening on localhost only, a firewall is blocking it, or the network path from outside is blocked. Check them in that order and stop at the first broken layer. Then test the port from outside your own network.

Key takeaways
01

Check the listener first. Run ss -tlnp on the server and look for your port. If nothing comes back, the service is not running on that port and no firewall change fixes it.

02

A localhost bind is the classic cause. Many apps default to localhost and accept connections only from the machine itself. Change the bind address to every interface or to the server's public IP.

03

There may be two firewalls. Many Linux images ship with a firewall that allows only SSH by default. A cloud or provider firewall sits outside the server, so its rules do not show in ufw.

04

Home connections add their own blocks. Wrong router port forwarding, carrier-grade NAT and ISP-side port blocks are the three common causes in the path. Under carrier-grade NAT, port forwarding cannot work.

05

Test from three regions. The port checker tries a TCP connection from the US, the UK and the Netherlands. It tests TCP only and leaves out mail ports 25, 465 and 587.

You start a game server, a web app or an SSH daemon. It works on the machine itself. A friend tries to connect and gets a timeout. You check the logs and nothing is wrong. The port looks closed from outside, and the cause is almost always one of four things.

Work through them in this order. Each step rules out a layer, so you stop at the first one that is broken.

1. Is the service listening at all?

Run this on the server, not your laptop:

ss -tlnp | grep :25565

Use your own port. If nothing comes back, the service isn't running on that port, and no firewall will fix it. Check the service's own config for the port it expects.

2. Is it listening on the right address?

Look at the address column in the same output:

3. Is a firewall on the server blocking it?

Many Linux images ship with a firewall that allows only SSH by default. Check which one is active:

sudo ufw status
sudo firewall-cmd --list-all
sudo nft list ruleset | head -50

If your port isn't in the allow list, add it and reload. Also check the cloud or provider firewall in the control panel. It sits outside the server, so a rule there blocks traffic before the server sees it, and nothing in ufw will show it.

4. Is the path from outside open?

If steps 1 to 3 are clean, the block is between the internet and your server. There are three common causes:

Test from outside, from more than one place

Use the port checker to test the port from outside your own network. It tries a TCP connection from three regions: the US, the UK and the Netherlands. The result tells you more than a single check:

Per-port pages explain what each common port is for and how to lock it down, for example SSH on 22 or Minecraft on 25565.

How to check if a firewall is blocking a port (UFW, nftables, Windows Firewall)

When a service is listening on 0.0.0.0 yet external checks still time out or return filtered, inspect the host firewall directly:

Port forwarded but still closed? CGNAT, double NAT, and ISP blocks

If you configured router port forwarding and opened your host firewall yet the port still shows closed from outside, the two most common culprits are Carrier-Grade NAT (CGNAT) and double NAT (an ISP modem/router combo sitting in front of your own router). Residential ISPs like Starlink, T-Mobile 5G Home Internet, and many fiber carriers put your WAN IP in the 100.64.0.0/10 CGNAT range, making inbound router port forwarding impossible.

Verify your connection in 5 seconds with our CGNAT Checker. If you are behind CGNAT, you can forward inbound TCP and UDP ports cleanly to your home server using a dedicated public IPv4 on PrivateByte Static IP Gateway ($3/mo) over WireGuard.

Fixing closed ports in qBittorrent, Transmission, and Foundry VTT

Two notes on what the checker can't tell you

It tests TCP only, so a service that runs on UDP needs a different check. Mail ports (25, 465 and 587) are left out on purpose. Outbound mail is restricted on most hosts, including ours, so a result there would be misleading.

If a port is open from the checker but your application still fails, the port isn't your problem. Check the application's logs and its own bind and auth settings.