The original CSF developers stopped maintaining the plugin on August 31, 2025, and released it under the GPLv3 license. cPanel now maintains its own CSF version for supported cPanel & WHM servers and provides critical security and stability fixes.
The instructions in this guide apply to the CSF version maintained by cPanel. For more information, refer to the official cPanel documentation.
ConfigServer Security & Firewall, or CSF, is a free, third-party firewall plugin for cPanel & WHM servers. It allows you to manage iptables rules through WHM and includes IP blocking, login tracking, intrusion detection, and other server security features.
We recommend installing and enabling CSF to help protect your server against brute-force attempts, suspicious login activity, and unwanted connections. Keep in mind that a firewall is only one part of server security.
This guide covers CSF installation and the most common management tasks. Use the links below to go directly to the relevant section:
InstallationCSF must be installed from the command line using the root user. If needed, refer to our SSH access guide for connection instructions.
CSF does not function with the firewalld utility. Before installing CSF, check its status and deactivate it if necessary.
To check the status, run this command as root: systemctl status firewalld
active means that firewalld is running and must be deactivated;
inactive means that the service is already inactive;
Unit firewalld.service could not be found means that it is not installed.
To deactivate firewalld, run: sudo systemctl disable --now firewalld
Run systemctl status firewalld again to confirm that the service is inactive.
Run the command that matches your server’s operating system:
The system downloads and installs the cpanel-csf package. A successful installation ends with the CSF installation completed successfully and Complete! messages:
Now, to activate CSF, proceed to WHM > Plugins section > ConfigServer Security & Firewall and follow the steps below.
Right after the installation, Test Mode will be enabled, which means that the firewall is not fully active yet:
To disable the mode, open the Firewall Configuration menu:
Find TESTING under Initial Settings and set it to Off:
Scroll to the bottom of the page and click Change:
After that, apply the changes by clicking Restart csf+lfd:
Once done, you will see the Firewall Status: Enabled and Running message on the main CSF page:
CSF offers many features. We will discuss the most commonly used ones below.
Blocking IP addresses
In order to block an IP address from accessing the server, use the Quick Deny option under csf - Quick Actions:
Whitelisting IP addresses
If you want to whitelist any IP address on the server to prevent it from being blocked, use the Quick Allow option from the csf - Quick Actions section:
Checking IP addresses
If you suspect that an IP address is blocked by the firewall, enter it in the Search for IP field under csf - ConfigServer Firewall:
Any allow or block rules associated with the IP address will be displayed. For example, the block added earlier will appear as follows:
To unblock the IP address from this page, click Remove [IP address] block.
Opening ports
To open a TCP or UDP port on your server, go to Firewall Configuration > the IPv4 Port Settings section, and locate the TCP_IN, TCP_OUT, UDP_IN, and UDP_OUT settings.
Add the port number to the corresponding comma-separated list. For example, to open port 3306 for incoming connections to your MySQL database, add 3306 to the TCP_IN field:
Remember to click Change at the bottom of the page and restart CSF by clicking Restart csf+lfd to apply the changes.
Disabling email notifications
To disable specific email notifications via WHM, go to Firewall Configuration and turn off the relevant options, depending on which notifications you no longer want to receive:
Remember to click Change at the bottom of the page and restart CSF by clicking Restart csf+lfd to apply the changes.
As an alternative to WHM, CSF can be managed through SSH while logged in as root. The following commands can be used for common actions:
| Action | Command |
|---|---|
| Block an IP address permanently | csf -d IP comment |
| Add an IP address to the allow list | csf -a IP comment |
| Remove an IP address from the allow list | csf -ar IP |
| Search for an IP address | csf -g IP |
| Remove a permanent block | csf -dr IP |
| Open the CSF configuration file to manage ports and email alerts | nano /etc/csf/csf.conf |
| Restart CSF and LFD after changing the configuration file | csf -ra |
| View all available CSF commands | csf -h |
For more information about CSF settings and features, refer to the readme.txt file.
That's it!
Need help? We're always here for you.