Skip to content

Firewall

1Panel integrates two widely used Linux firewalls: Firewalld and UFW.

  • Firewalld is used on RedHat/CentOS
  • UFW is used on Debian/Ubuntu

1 Installation

1. Update packages

sudo yum update

2. Install firewalld

sudo yum install firewalld

3. Start firewalld

sudo systemctl start firewalld

4. If you connect to your server remotely, you must explicitly allow SSH before enabling firewalld, or you will lose access.

sudo firewall-cmd --zone=public --add-port=22/tcp --permanent

If SSH uses a non‑standard port, replace 22 with your actual SSH port.

5. Allow the 1Panel port.

sudo firewall-cmd --zone=public --add-port=8090/tcp --permanent

Replace 8090 with your actual 1Panel port.

6. Reload firewall rules

sudo firewall-cmd --reload

7. Enable firewalld on boot

sudo systemctl enable firewalld

1. Update packages

sudo apt update

2. Install UFW

sudo apt install ufw

3. If you connect to your server remotely, you must explicitly allow SSH before enabling UFW, or you will lose access.

sudo ufw allow 22/tcp

If SSH uses a non‑standard port, replace 22 with your actual SSH port.

4. Allow the 1Panel port.

sudo ufw allow 8090/tcp

Replace 8090 with your actual 1Panel port.

5. Enable UFW

sudo ufw enable

2 Firewall Status

Click the firewall switch to turn it on or off.

img.png

Click the Ping Disable button to enable or disable PING.

  • Disabling PING prevents server performance degradation caused by frequent pings.

img.png

3 Port Rules

Click Create Port Rule to configure port access.

  • Protocol: Default TCP; options: TCP, UDP, TCP/UDP
  • Port: Custom port (0–65535)
  • Source: Default All IPs; options: All IPs, Specified IP
  • Policy: Default Allow; options: Allow, Deny

After allowing ports, you can view the current status in the firewall list.

img.png

img.png

4 Port Forwarding

Click Create Port Forwarding to set up forwarding rules.

  • Protocol: Default TCP; options: TCP, UDP, TCP/UDP
  • Source Port: Packets to this port are forwarded to Target IP:Target Port (0–65535)
  • Target IP: For local forwarding, use 127.0.0.1; empty means local forwarding
  • Target Port: Port that receives forwarded traffic

img.png

5 IP Rules

Click Create IP Rule to set IP access policies.

  • Specified IP
  • Policy: Default Allow; options: Allow, Block

img.png

img.png


Take 1Panel Further

Running 1Panel OSS? Pro Edition adds WAF protection, unlimited AI agents, multi-node management, and priority support — starting at $80/year.

Compare OSS vs Pro → Start 30-day free trial →