How to configure the server firewall and open ports

For server administrators · Updated 2026-10-29

On this page
  1. Steps
  2. The default ports
  3. Good to know
  4. Common questions

The firewall decides which ports of the server can be reached from the internet. With port filtering on, everything that is not listed is dropped. It is turned on when the panel is installed.

Steps

  1. In the administrator panel (https://<server>:2087), open Firewall (section Security). The heading shows Active or Port filtering off.
  2. Tick Enable port filtering (drop everything not listed below).
  3. Open TCP ports — comma separated, ranges like 30000-30100. Ports 22 (SSH) and 2087 (admin panel) must always stay in the list.
  4. Open UDP ports — for example 53,443.
  5. Optional: tick Block brute-force attackers at the firewall (all services), not only at the login page. It is on by default.
  6. Click Save & apply and confirm.
  7. A yellow box says Confirm the new rules. If the page still loads, click Keep these rules within 90 seconds.

If you do not confirm, the previous rules come back by themselves. See firewall changes were rolled back.

The default ports

PortService
21, 30000–30049FTP (and its data ports)
22SSH and SFTP (a different SSH port of the server is added at installation)
25, 465, 587Mail delivery and sending
53 (TCP and UDP)DNS
80, 443 (and UDP 443)Websites
110, 143, 993, 995POP3 and IMAP
2083Control panel
2087Admin panel
2096Webmail
2097Database tool

Good to know

  • Your own address is added to the allow list when you turn port filtering on, so you keep access.
  • Allowed addresses reach every port, even those not in the list. Blocked addresses are blocked even with port filtering off.
  • Remote MySQL: addresses customers allow in Remote MySQL get port 3306 automatically. Do not open 3306 for everyone.
  • Ping (ICMP) is answered, with a rate limit.
  • Other firewall tables on the server (for example fail2ban's) are not touched. The panel's rules are in /etc/sahaab/firewall/sahaab.nft.
  • Every change is checked before it is applied; a ruleset with an error is refused and nothing changes.

Common questions

I added a port but the service is still unreachable.

Check that you clicked Keep these rules, that the service is running and listening on that port, and that your hosting provider's own network firewall (outside the server) allows the port too.

It says "TCP port 22 must stay open (SSH / admin panel access)."

Ports 22 and 2087 cannot be removed, so you always keep a way in. Put them back in Open TCP ports.

Can I close FTP if nobody uses it?

Yes. Remove 21 and 30000-30049 from Open TCP ports and save. SFTP keeps working on the SSH port.

Was this article helpful?

Still stuck?

Ask the AI about your exact situation — it answers from this knowledge base — or contact us.