Skip to content
Skip to Content

Port forwarding on your router

Which ports a home or office server needs forwarded and why, what routers call address reservation and port forwarding, and why not to use the DMZ.

A server added with One command needs no port forwarded: its agent only connects out. This page is for the SSH setup.

A router hides the machines behind it from the internet. For OpenPanel to reach a server at home or in an office over SSH, the router must send some incoming connections on to that server. That takes two settings: a fixed address for the server on your network, and the port forwards themselves.

The ports

Protocol and portForward toNeededWhy
TCP 22the server's port 22For the setupOpenPanel's first sign-in, with your password. After the setup, the server's firewall closes port 22 and you can remove this forward.
TCP 20000–60000the same port on the serverFor the setupThe setup moves SSH to one random port from 20000 to 59999 and must reach it on that port. It cannot know the port in advance, so the whole range must be open. After the setup, keep only the one port shown on the server's Overview.
TCP 80 and 443the same port on the serverOptionalThe server's firewall keeps them open for websites. OpenPanel's services do not need them: their traffic reaches the server through the agent's own outgoing connection.
UDP 41641the same port on the serverOptionalThe private network's port for direct connections. Without it, your devices still reach the server, sometimes through a relay.

If port 22 from outside is already taken, forward another outside port (for example 2222) to the server's port 22, and enter that outside port as the SSH port in OpenPanel. The 20000–60000 range must go to the same port numbers on the server.

Why not the DMZ

Many routers can send every incoming connection to one machine, called the DMZ host or exposed host. Do not use it for an OpenPanel server, and do not forward all ports:

  • Every port of the machine faces the internet, including during the install, before OpenPanel turns on the server's firewall.
  • Anything that later listens on the machine is reachable from the internet at once, whether you meant it to be or not.
  • The router stops filtering anything for that machine.

The forwards above are all OpenPanel needs.

What routers call these settings

Menus differ between models and firmware versions. These are the usual names.

RouterFixed address for a machinePort forwarding
AVM FRITZ!Box"Always assign this network device the same IPv4 address" (in the device's settings under Home Network)Port Sharing (under Internet → Permit Access)
TP-LinkAddress ReservationVirtual Servers (under NAT Forwarding)
NetgearAddress ReservationPort Forwarding / Port Triggering
ASUSManually Assigned IP around the DHCP list (under LAN → DHCP Server)Virtual Server / Port Forwarding (under WAN)
LinksysDHCP ReservationsSingle Port Forwarding and Port Range Forwarding
Ubiquiti UniFiFixed IP Address (in the client's settings)Port Forwarding
OpenWrtStatic Leases (under Network → DHCP and DNS)Port Forwards (under Network → Firewall)
MikroTikMake Static (on the machine's DHCP lease)A NAT rule with the action dst-nat
Your provider's routerOften DHCP reservation or static leaseOften port forwarding, port mapping, NAT or virtual server

To find the server's address on your network, run this on the server:

ip -4 addr

Two routers in a row

Some homes have the provider's modem-router and a router of their own behind it. If your own router's internet address is a private one (for example 192.168.x.x), forward the ports on both, or put the provider's device in bridge mode so your router gets the public address.

Check the forwards

Before you connect the server, check that port 22 answers from outside your network, for example from a phone on mobile data with an SSH app, or from another network:

Use your public address and the outside port you forwarded. Many routers do not let you reach your own public address from inside the same network, so test from outside it.

See Connect a home or office server for the whole flow.