How Can We Help?
How to Install CSF Firewall via WHM/cPanel
Installing a CSF (ConfigServer Security & Firewall) on a cPanel server requires SSH access as the root user. While CSF integrates with WHM for management after installation, the initial setup must be done via the command line.
Step-by-Step Installation Guide
- Log in to your server via SSH.
- Open your terminal or SSH client.
- Connect to your server using the command:
ssh root@your_server_ip
- Ensure no conflicting firewalls are running.
- If you have a different firewall like
firewalldorAPF, you must disable and uninstall it before installing CSF to avoid conflicts. - To disable
firewalld, use the commands:systemctl stop firewalldandsystemctl disable firewalld.
- If you have a different firewall like
- Download the CSF installation package.
- Change to the
/usr/srcdirectory:cd /usr/src - Download the CSF package using the
wgetcommand:wget https://download.configserver.com/csf.tgz
- Change to the
- Extract the files and run the installer.
- Extract the downloaded file:
tar -xzf csf.tgz - Navigate into the new
csfdirectory:cd csf - Run the installation script:
sh install.sh
- Extract the downloaded file:
- Verify the installation.
- Run the following command to check if the required iptables modules are available:
perl /usr/local/csf/bin/csftest.pl - The result should indicate that CSF should function on your server.
- Run the following command to check if the required iptables modules are available:
- Configure and disable testing mode.
- By default, CSF installs in a “testing” mode to prevent you from being locked out of your server.
- Open the CSF configuration file in a text editor like
nano:nano /etc/csf/csf.conf - Find the line
TESTING = "1"and change the value to0. - Save and close the file.
- Restart CSF.
- To apply the changes and take CSF out of testing mode, run the restart command:
csf -r
- To apply the changes and take CSF out of testing mode, run the restart command:
After these steps, you can manage the CSF firewall from the WHM interface, which will appear under the “Plugins” section.


