Firewall
Turn a server's firewall on or off, and decide which ports and addresses can reach it.
The firewall controls which ports the outside world can reach on a server. Open Firewall in the server's sidebar. Central shows and changes the firewall of the server itself, so the rules live on the server.

The top of the page says in what state the firewall is:
| State | Meaning |
|---|---|
| Your server is protected | The firewall is on. "Anything not listed below is blocked before it reaches your server." |
| Your server is not protected | The firewall is off. Nothing is blocked, and saved rules are not enforced. |
| Your firewall is on, but it isn't blocking anything | Your rules are enforced, but anything not listed is still allowed in, because the default policy was changed outside ServerAvatar. |
| Firewall state couldn't be read | Central could not ask the server. Nothing was changed. Reload in a moment. |
The page also shows the server's SSH port, ServerAvatar's address, and the default policy for Incoming and Outgoing traffic. A Risky open ports notice lists database and similar ports that are open to everyone. A notice about ports "closed to the internet" says that a program is running on the server but the firewall blocks it from outside. That is normal for a database, so add a rule only if you need to reach it from outside.
Turn the firewall on
- Select Turn on firewall.
- Confirm Turn the firewall on? Anything not on your rule list is blocked from then on. SSH and the ports ServerAvatar needs are added for you first, so you do not lose access.
Block incoming traffic by default
If the page says the firewall is on but is not blocking anything, select Block incoming by default and confirm Block incoming traffic by default? Only the listed rules are let in. SSH and ServerAvatar's own ports are allowed first. You see "Incoming traffic is blocked by default again."
Turn the firewall off
- Select Turn off firewall.
- Confirm Turn the firewall off? with Turn off. Every port on the server is open to the internet until you turn it back on.
Rules stay saved while the firewall is off. The list says "Saved, but not being enforced while the firewall is off."
Add a rule
-
Select Add rule. The dialog says "Let traffic in, or keep it out, by port and address."

-
Choose the Action: Allow or Deny.
-
Enter the Port: one port, like
443, or a range, like8000-8090. Under Or pick a known service to fill it in, you can choose a common service instead (SSH, HTTP, HTTPS, MySQL, PostgreSQL, Redis, FTP, SMTP or DNS). -
Choose the Protocol: TCP, UDP or Both TCP and UDP. A range of ports needs TCP or UDP. Add a second rule if you need both.
-
Enter the Source IP or range: one IP address like
203.0.113.5, or a range like203.0.113.0/24. Leave it blank to apply to every address. -
Enter a Name, for example "Allow SSH from office". It is how the rule appears in the list.
-
Check the summary line, for example "Allow incoming TCP on port 443 from anywhere", and select Add rule. When you edit a rule, the button is Save.
If you open a database port to every address, the dialog warns that it would be reachable from any address on the internet, and that databases are normally limited to a single IP.
Edit or delete a rule
- Open the rule's ⋯ menu (Actions for the rule for ports) and choose Edit. Changing the ports replaces the rule: the new one is added before the old one is removed.
- Use the switch (Rule for ports enabled) to disable a rule without deleting it.
- Choose Delete and confirm Delete the rule for ports? Traffic that rule allowed or blocked is handled by the default policy again.
A rule that ServerAvatar set up and still needs is marked Protected ("Added automatically so you cannot be locked out of this server."). Only its name can be changed.
Find rules
Use Search port or description and the filters Action (all, allow, deny), Status (All rules, Enabled, Disabled) and Added by (Default, Custom, Database). Sort by newest, port, action or protocol. You can show 10, 20, 30, 50 or 100 rules per page.
Adopt rules found outside ServerAvatar
If someone added rules directly on the server, the page shows Rules found outside ServerAvatar. Select Adopt to manage a rule here, or delete it from the server.
See the history
History opens the server's activity log filtered to firewall changes. It shows only to people who may view the server's activity.
Limits
- Ports run from 1 to 65535. The end of a range cannot be lower than the start.
- A port range needs one protocol, TCP or UDP.
- The source is one IP address or a range (CIDR), up to 64 characters.
- The name is one line, up to 255 characters.
Who can do this
- Seeing the page and rules needs View on Firewall. Turning the firewall on or off, adding, editing, deleting and adopting rules need Manage.
- The server refuses a rule that would cut off SSH access, and Central shows its message with the rule.
Common errors
- Enter a port.
- Use a port like 443, or a range like 8000-8090.
- Ports run from 1 to 65535.
- The end of the range cannot be lower than the start.
- For a range of ports, choose TCP or UDP. Add a second rule if you need both.
- You already have a rule exactly like this one.
- Firewall state couldn't be read. Reload the page. If it keeps happening, give support the reference shown.
Related
- Fail2ban
- Settings: the SSH port and sign-in rules
- System users
- Firewall in the OSS panel