> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Check if a Port Is Open on Your Server from Outside

> Check if a port is open from outside: run nc -zv or nmap from Linux or macOS, or Test-NetConnection -Port in PowerShell, then check the service listens.

To check if a port is open from outside, test it from a different machine, not from the server itself. On Linux or macOS run `nc -zv -w 3 203.0.113.10 443`; in Windows PowerShell run `Test-NetConnection 203.0.113.10 -Port 443` and look for `TcpTestSucceeded : True`. If the test fails, check on the server that the service is listening (`ss -tlnp`) and that the firewall allows the port.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 5 minutes | Tests from Linux, macOS or Windows to any Linux or Windows server | A second machine outside the server's network |

## Before you start

* A **port** is a numbered door on the server that one service listens on, for example 22 for SSH, 80/443 for websites, 3389 for Remote Desktop.
* A test from the server to itself (`localhost` or its own IP) skips the outside network and some firewalls, so it can succeed while outside connections fail. Use your home computer or another server.
* These tools check **TCP** ports. UDP has no connection handshake, so a reliable outside test needs the actual application (for example the game client).

## How to test a port from another machine

> [tab] Linux / macOS (nc)
>
> ```bash theme={null}
> nc -zv -w 3 203.0.113.10 443
> ```
>
> `-z` only checks the connection, `-v` prints the result, `-w 3` gives up after 3 seconds. Install `nc` with `sudo apt install netcat-openbsd` (Ubuntu/Debian) or `sudo dnf install nmap-ncat` (AlmaLinux/Rocky); macOS has it built in.
>
> ```text theme={null}
> Connection to 203.0.113.10 443 port [tcp/https] succeeded!
> ```

> [tab] Windows (PowerShell)
>
> ```powershell theme={null}
> Test-NetConnection 203.0.113.10 -Port 443
> ```
>
> Shortened output:
>
> ```text theme={null}
> ComputerName     : 203.0.113.10
> RemoteAddress    : 203.0.113.10
> RemotePort       : 443
> TcpTestSucceeded : True
> ```
>
> Add `-InformationLevel Quiet` to get only `True` or `False`, which is handy in scripts.

> [tab] nmap (several ports)
>
> ```bash theme={null}
> nmap -Pn -p 22,80,443 203.0.113.10
> ```
>
> `-Pn` skips the ping check, so servers that don't answer ping are still scanned. Only scan servers you own or have permission to test.

> [!NOTE]
>
> `telnet 203.0.113.10 443` also works where the telnet client is installed: a blank screen or "Connected" means the port is open. On current systems `nc` and `Test-NetConnection` are easier.

## What the result means

| Result | `nmap` state | Meaning | What to check |
| - | - | - | - |
| Succeeded / `TcpTestSucceeded : True` | `open` | Something accepts connections on that port | The port is fine; check the application itself |
| "Connection refused" | `closed` | The server is reachable but nothing listens on that port | Is the service running and on the right port? |
| Timeout / no answer | `filtered` | A firewall drops the connection, or the server is down | Server firewall, network firewall, IP address |

## How to check the service is listening on the server

> [tab] Linux
>
> ```bash theme={null}
> sudo ss -tlnp
> ```
>
> ```text theme={null}
> State   Recv-Q  Send-Q  Local Address:Port  Peer Address:Port  Process
> LISTEN  0       511           0.0.0.0:443        0.0.0.0:*      users:(("nginx",pid=812,fd=6))
> LISTEN  0       80          127.0.0.1:3306       0.0.0.0:*      users:(("mariadbd",pid=640,fd=22))
> ```
>
> `0.0.0.0` or `*` means all IPv4 addresses, `[::]` all IPv6 addresses. `127.0.0.1` means **local only**: the service can't be reached from outside until you change its listen address. Use `ss -ulnp` for UDP. More in [check open ports on Linux](https://help.freakhosting.com/portals/other/how-to-check-open-ports-on-linux.md).

> [tab] Windows Server
>
> ```powershell theme={null}
> Get-NetTCPConnection -State Listen -LocalPort 443
> ```
>
> If nothing is returned, no program listens on that port. `netstat -ano | findstr :443` shows the same with the process ID.

## How to open the port in the firewall

> [tab] Ubuntu / Debian (UFW)
>
> ```bash theme={null}
> sudo ufw allow 443/tcp
> sudo ufw status
> ```

> [tab] AlmaLinux / Rocky (firewalld)
>
> ```bash theme={null}
> sudo firewall-cmd --permanent --add-port=443/tcp
> sudo firewall-cmd --reload
> ```

> [tab] Windows Server
>
> ```powershell theme={null}
> New-NetFirewallRule -DisplayName "HTTPS in" -Direction Inbound -Protocol TCP -LocalPort 443 -Action Allow
> ```

If you use the FREAKHOSTING Firewall panel, check its rules and filters for the IP too: see the [Firewall panel overview](https://help.freakhosting.com/portals/firewall/firewall-panel-overview.md).

> [!WARNING]
>
> Only open ports for services that need to be public. Database ports (3306, 5432, 6379) and admin panels should stay closed or be limited to your own IP. When you change firewall rules over SSH, make sure port 22 (or your SSH port) stays allowed.

## Frequently asked questions

### Why does the port work from the server but not from outside?

The service probably listens on `127.0.0.1` only, or a firewall blocks outside traffic. Check `ss -tlnp` for the listen address, then the firewall rules.

### Can I check a UDP port from outside?

Not reliably with general tools. Many UDP services don't answer an empty test packet, so `nmap -sU` often reports `open|filtered` and can't tell the difference. Confirm the service listens with `ss -ulnp`, allow the port in the firewall, and test with the real client.

### Why does Test-NetConnection say the ping failed but the TCP test succeeded?

The server's firewall blocks ICMP (ping) but allows the port. The port test is what matters. To allow ping, see [enable ICMP on Windows](https://help.freakhosting.com/portals/other/how-to-enable-icmp-on-windows.md).

### Are online port checker websites reliable?

They test from their own network, which is a real outside test. They only check TCP, and some only test common ports. `nc` or `Test-NetConnection` from your own machine gives the same answer with more detail.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [Check open ports on Linux](https://help.freakhosting.com/portals/other/how-to-check-open-ports-on-linux.md)
>
> See what listens on the server.

> [card] [Open a port in Windows Firewall](https://help.freakhosting.com/portals/other/how-to-open-a-port-in-windows-firewall.md)
>
> Inbound rules on Windows Server.

> [card] [Set up UFW](https://help.freakhosting.com/portals/other/how-to-set-up-a-firewall-with-ufw.md)
>
> Firewall basics on Ubuntu.

> [card] [Port forwarding with iptables](https://help.freakhosting.com/portals/other/how-to-set-up-port-forwarding-and-nat-with-iptables.md)
>
> Forward a port to another host.

> [card] [Locked out after a firewall change](https://help.freakhosting.com/portals/other/how-to-fix-locked-out-after-firewall-change.md)
>
> Get back in safely.

***

> [!NOTE]
>
> **Checked against Microsoft Learn ([Test-NetConnection](https://learn.microsoft.com/en-us/powershell/module/nettcpip/test-netconnection))** on 4 November 2026; `nc`, `nmap` and `ss` commands tested on Ubuntu 24.04 LTS (netcat-openbsd, Nmap 7.94). Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.