FastPanel for administrators: firewall
This article is for the server administrator (user fastuser). The client login does not show these sections — if you need such a setting, contact support.
The firewall decides from which addresses and to which ports connections to the server are allowed. It is used to close the panel, SSH and databases to outsiders while keeping sites and email open.
"Management" → "Firewall". The list shows your rules: name, range of ports, protocol, type and policy. The "Global settings" button opens the general firewall options.

Rule fields
| Field | What to enter |
|---|---|
| Name | a clear name, for example "Panel from office only" |
| Range of ports | one port (8888) or a range with a hyphen (4500-5500) |
| Protocol | TCP - sites, panel, email, SSH, MySQL; UDP - DNS and some VPNs; ALL - both |
| Type | INPUT - incoming connections to the server (needed almost always); OUTPUT - outgoing from the server |
| Policy | ACCEPT - allow everyone; DROP - deny everyone; PARTIAL ACCEPT - allow only the listed IPs |
Panel 8888 from your IP only
- "Firewall" → "New rule".
- Name - for example "Panel". Port
8888, TCP, type INPUT. - Policy "PARTIAL ACCEPT" → "My IP" → "Add". Add the other addresses you work from the same way.
- "Save".

Check the result: from your address the panel opens as before, from another one (for example a phone on mobile data) it does not.
Other common rules
- MySQL for an external application: port
3306, TCP, PARTIAL ACCEPT - only the IP of that application (remote MySQL access). - SSH from your addresses only: port
22, TCP, PARTIAL ACCEPT - if you have a static IP. - Close the port of a service you do not use: its port, policy DROP.
Which ports are needed
| Port | For |
|---|---|
| 80, 443 | sites (HTTP and HTTPS) |
| 8888 | FastPanel |
| 22 | SSH |
| 21 | FTP |
| 25, 465, 587 | email: receiving and sending (SMTP) |
| 110, 995, 143, 993 | POP3 and IMAP - email programs |
| 53 | DNS, if this server serves your domains |
| 3306 | MySQL - open only for specific IPs |
Do not close 80 and 443 (sites), 22 (SSH) and 8888 (panel) for your own address. If your IP changes (home internet without a static address, mobile data), a PARTIAL ACCEPT rule for the panel and SSH will lock you out the next time the address changes.
Common mistakes
- Type OUTPUT instead of INPUT - incoming connections are not restricted, while outgoing ones (for example sending email) may stop working.
- DROP on port 25 - the server stops receiving email for its domains.
- Port 3306 open with ACCEPT - bots start guessing database passwords. Use PARTIAL ACCEPT with the addresses you need.
Frequently asked questions
Does the firewall protect against password guessing? No, it only lets addresses through to ports or not. Password guessing is handled by fail2ban, which already runs on the server.
How do I open the panel from a new address if access is restricted? Log in from an allowed address and add the new IP to the rule. That is why you should add all the addresses you work from in advance.