# Ports reference

Source: https://openpanel.sh/docs/tcp-udp/ports

Every port OpenPanel uses or opens on a connected server today, before and after the setup, and why.

This is every port OpenPanel uses on a server you connect over SSH, as the setup leaves it. To see a server's actual firewall rules, open its page and look under **Security**.

A server connected with the one-command install keeps its own firewall: OpenPanel needs no incoming port there, only the agent's outgoing connection below. See [The OpenPanel agent](/docs/servers/agent).

## Incoming [#incoming]

| Port | Protocol | Open to | Used for |
|---|---|---|---|
| The SSH port you enter (usually 22) | TCP | The internet, **before the setup only** | OpenPanel's first sign-in with your password. After the setup, SSH moves off it and the firewall closes it. |
| One port from 20000 to 59999, picked at random per server | TCP | The internet | SSH after the setup, for OpenPanel's key only. The server's **Overview** shows the port. |
| 80 | TCP | The internet | HTTP, kept open for websites you run yourself. Nothing OpenPanel runs listens on it: your services are reached through the agent. |
| 443 | TCP | The internet | HTTPS, kept open for websites you run yourself. Nothing OpenPanel runs listens on it. |
| 41641 | UDP | The internet | The private network's direct connections between devices. Only on a server in the private network. |
| Every port, on the private network's interface (`quietlane0`) | TCP and UDP | Your organization's devices in the private network | Anything on the server that listens on its private address. Only on a server in the private network. |

Every other incoming port is closed by the firewall (`ufw`).

## Outgoing [#outgoing]

All outgoing traffic is allowed. During the setup the server downloads Ubuntu's updates and packages, and the private network's software from the network service. Afterwards it fetches security updates by itself, and keeps its connections in the private network.

The OpenPanel agent keeps one connection out to `gateway.openpanel.sh` on TCP 443. Everything OpenPanel sends to the server, and all traffic to your public services, comes back over it, so no incoming port is needed for them.

## What to open at your provider or router [#what-to-open-at-your-provider-or-router]

| When | Open | Why |
|---|---|---|
| To connect the server over SSH | TCP on the SSH port, and TCP 20000–60000 | The first sign-in, and the SSH port the setup picks, which it cannot know in advance. A server connected with **One command** needs none. |
| After the setup | TCP on the one SSH port shown on the server's **Overview** | OpenPanel reaches the server only on this port from now on. |
| Optional | TCP 80 and 443 | For websites. |
| Optional | UDP 41641 | Direct private-network connections to the server instead of relayed ones. |

At home, see [Port forwarding on your router](/docs/servers/port-forwarding).

## Docker and the firewall [#docker-and-the-firewall]

OpenPanel never publishes a container's port: your services are reached through the agent. Docker writes its own firewall rules, which pass before `ufw`'s, so a container you start yourself with a published port (`docker run -p …`) would be open to the internet although `ufw` does not list it. The setup closes that gap: rules it adds to Docker's `DOCKER-USER` chain drop outside traffic to published ports, except 80 and 443. Containers' own traffic, their answers, and the private network still pass.

## Your services' ports [#your-services-ports]

A public service's TCP and UDP ports listen on OpenPanel's edge, on ports from 30000 to 32767, not on your server. A private service's ports listen on its server's `127.0.0.1` only, on ports from 20000 to 29999. See [TCP and UDP services](/docs/tcp-udp).