How to configure the CloudPanel firewall
Manage UFW firewall rules from the CloudPanel interface. Open and close ports, allow specific IP addresses,
On this page
CloudPanel manages the server's UFW (Uncomplicated Firewall) through a graphical interface. Rules added here apply to the Linux firewall on the VPS-they control which ports are accessible from the internet. All other ports are blocked by default.
CloudPanel firewall overview
To open the firewall manager:
- Log in to CloudPanel
- Click Admin in the top navigation
- Select Firewall from the admin menu
The firewall page shows all current incoming rules. Each rule specifies a port (or range), protocol (TCP/UDP), and whether it applies to all IPs or a specific IP/range.
Default open ports
A fresh CloudPanel installation opens these ports by default:
| Port | Protocol | Purpose |
|---|---|---|
| 22 | TCP | SSH access |
| 80 | TCP | HTTP web traffic (and Let's Encrypt validation) |
| 443 | TCP | HTTPS web traffic |
| 8443 | TCP | CloudPanel admin panel |
| 3306 | TCP | MySQL-open only if remote DB access is needed |
Do not close port 80-it is required for Let's Encrypt HTTP-01 certificate validation, even if you want to serve all traffic over HTTPS.
Add a firewall rule
- In the Firewall page, click Add Rule
- Enter the port number (or range, e.g.,
8000:9000) - Select protocol: TCP, UDP, or both
- Leave IP blank to allow all IPs, or enter a specific IP/CIDR range to restrict access
- Click Add Rule
Example use cases:
- Open port
27017for MongoDB access from a specific developer IP - Open port
6379for Redis access from your application server's IP only - Open a custom port for a Node.js application that should be publicly accessible
Allow a port for a specific IP only
To allow port 8443 (CloudPanel) only from your own IP:
- Add a new rule: Port
8443, ProtocolTCP, IP:YOUR.IP.ADDRESS - Delete the existing open rule for port 8443 (all IPs)
This way only your IP can access the panel. All other IPs receive a connection refused response.
If you accidentally block port 22 (SSH) or port 8443 without SSH access, you may lose all access to the server. Ensure SSH is working before making any firewall changes that could lock you out.
Delete a rule
In the Firewall page, find the rule in the list and click the delete icon (trash can) next to it. The rule is removed immediately from UFW.
UFW via command line
If the CloudPanel UI is inaccessible, you can manage UFW directly via SSH:
# View current rules
ufw status numbered
# Allow a port
ufw allow 8443/tcp
# Allow a port from specific IP only
ufw allow from 1.2.3.4 to any port 8443
# Delete a rule by number
ufw delete 3
# Reload rules
ufw reload
CloudPanel's firewall UI and the ufw command both modify the same underlying rules-changes made via SSH are reflected in the CloudPanel UI and vice versa.
Related: CloudPanel security basics-users, SSH, and access control | How to connect to your VPS via SSH | Setting up a firewall on your VPS
Need CloudPanel on a server?
Use CloudPanel on an UnderHost VPS or dedicated server for fast PHP app and WordPress hosting without a heavy panel stack.





















