All Hosting Plan Are Also Available On Monthly, Quarterly And Semi-Annually.
Skip to main content
< All Topics
Print

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

  1. 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
  2. Ensure no conflicting firewalls are running.
    • If you have a different firewall like firewalld or APF, you must disable and uninstall it before installing CSF to avoid conflicts.
    • To disable firewalld, use the commands: systemctl stop firewalld and systemctl disable firewalld.
  3. Download the CSF installation package.
    • Change to the /usr/src directory: cd /usr/src
    • Download the CSF package using the wget command: wget https://download.configserver.com/csf.tgz
  4. Extract the files and run the installer.
    • Extract the downloaded file: tar -xzf csf.tgz
    • Navigate into the new csf directory: cd csf
    • Run the installation script: sh install.sh
  5. 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.
  6. 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 to 0.
    • Save and close the file.
  7. Restart CSF.
    • To apply the changes and take CSF out of testing mode, run the restart command: csf -r

After these steps, you can manage the CSF firewall from the WHM interface, which will appear under the “Plugins” section.

Table of Contents

Windows Hosting is comming soon. All Hosting Plan Are Also Available On Monthly, Quarterly And Semi-Annually.

Call back request.