CSF (ConfigServer Security & Firewall) is a powerful and flexible firewall solution for Linux systems, designed to provide security and ease of use. When used with cPanel/WHM, CSF can enhance the security of your server and protect it against various threats. In this guide, we will walk you through the process of installing and configuring CSF for use with cPanel/WHM.


Step 1: Installing CSF

  1. SSH into your server: Log in to your server using SSH as the root user.
  2. Download CSF: Run the following command to download the CSF installation script:
    wget https://download.configserver.com/csf.tgz
  3. Extract the archive: Use the following command to extract the downloaded archive:
    tar -xzf csf.tgz
  4. Navigate to the CSF directory: Enter the CSF directory by running:
    cd csf
  5. Install CSF: Install CSF using the installation script:
    sh install.sh
  6. Verify installation: Once the installation is complete, verify that CSF is installed correctly by running:
    csf -v

Step 2: Configuring CSF for cPanel/WHM

  1. Open the CSF configuration file: Use your preferred text editor to open the CSF configuration file:
    nano /etc/csf/csf.conf
  2. Configure CSF settings: In the CSF configuration file, you can configure various settings such as allowed ports, IP addresses to whitelist, and more. Make sure to review and update the settings according to your requirements.
  3. Enable CSF: Start CSF and enable it to run on startup using the following commands:
    csf -s
    csf -e
  4. Configure cPanel/WHM integration: CSF provides integration with cPanel/WHM, which allows you to manage CSF directly from the WHM interface. To enable this integration, edit the CSF configuration file and set the following option:
    LF_CPANEL = "1"
  5. Restart CSF and LFD: Restart CSF and its login failure daemon (LFD) to apply the changes:
    csf -r

Step 3: Managing CSF in cPanel/WHM

  1. Access CSF in WHM: Log in to WHM, and you should see a new section called “ConfigServer Security & Firewall” under the “Plugins” section.
  2. Configure CSF settings: From the CSF plugin in WHM, you can manage various CSF settings, including firewall rules, IP address whitelisting, and more.
  3. Monitor CSF logs: CSF logs can provide valuable information about firewall activity and potential security threats. You can view these logs from the CSF plugin in WHM.
  4. Update CSF: It’s important to keep CSF up to date to ensure that you have the latest security enhancements and bug fixes. You can update CSF from the CSF plugin in WHM.

Need help?

Find answers quick, talk to us on live chat.

Start Live Chat