Set up a firewall on your server

Allow only the ports you need with UFW, firewalld or CSF on cPanel servers.

Updated 4 October 20262 min read5 views0 found this helpful
On this page

A firewall blocks everything except the services you choose to expose.

Ubuntu with UFW

ufw allow OpenSSH
ufw allow 80,443/tcp
ufw enable
ufw status

AlmaLinux / Rocky with firewalld

firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http --add-service=https
firewall-cmd --reload

cPanel servers with CSF

cPanel servers usually use ConfigServer Security & Firewall (CSF). In WHM open Plugins β†’ ConfigServer Security & Firewall to allow or block IPs and review the ports listed under TCP_IN.

ServicePort
SSH22 (or your custom port)
HTTP / HTTPS80 / 443
cPanel / WHM2083 / 2087
SMTP submission465, 587
#firewall#UFW#CSF#VPS

Was this article helpful?

Your vote helps us write better guides.

Keep reading

Related articles

Still stuck?

Talk to our support team

Open a ticket

Best for anything technical. Every reply is tracked.

Submit a ticket

Call our Nairobi team

+254 726 872 512 Β· +254 722 917 455

Call now

Message us

Send a question and we'll reply by email or phone.

Contact support
Launch today

Powering Your Online Success!

Domain, hosting, email and SSL from one local team β€” set up in minutes and backed by people you can call.

  • Free SSL
  • Free migration
  • 99.9% uptime
  • 24/7 expert support

Start with your domain

Check availability, then add hosting in the same order.

Prefer to talk? Call +254 726 872 512