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
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 statusAlmaLinux / Rocky with firewalld
firewall-cmd --permanent --add-service=ssh
firewall-cmd --permanent --add-service=http --add-service=https
firewall-cmd --reloadcPanel 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.
| Service | Port |
|---|---|
| SSH | 22 (or your custom port) |
| HTTP / HTTPS | 80 / 443 |
| cPanel / WHM | 2083 / 2087 |
| SMTP submission | 465, 587 |
#firewall#UFW#CSF#VPS
Was this article helpful?
Your vote helps us write better guides.
