UnderHost
Knowledgebase Docs

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:

  1. Log in to CloudPanel
  2. Click Admin in the top navigation
  3. 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:

PortProtocolPurpose
22TCPSSH access
80TCPHTTP web traffic (and Let's Encrypt validation)
443TCPHTTPS web traffic
8443TCPCloudPanel admin panel
3306TCPMySQL-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

  1. In the Firewall page, click Add Rule
  2. Enter the port number (or range, e.g., 8000:9000)
  3. Select protocol: TCP, UDP, or both
  4. Leave IP blank to allow all IPs, or enter a specific IP/CIDR range to restrict access
  5. Click Add Rule

Example use cases:

  • Open port 27017 for MongoDB access from a specific developer IP
  • Open port 6379 for 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:

  1. Add a new rule: Port 8443, Protocol TCP, IP: YOUR.IP.ADDRESS
  2. 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.

Always keep SSH accessible before locking down other ports

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

Was this article helpful?

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.

Related articles

Back to CloudPanel