General, Tips and Tricks

Installing CSF (ConfigServer Security & Firewall)

The CSF, ConfigServer Security & Firewall, is a powerful firewall that is made for Linux systems. It comes with an easy to use CLI (Command Line Interface) and integrates with DirectAdmin and cPanel control panels as a graphical user interface (GUI) that is just as powerful as it’s CLI counterpart. Installing CSF is easy but as with making changes to any server, if you do not know what you are doing, you can cause damage. If you are unfamiliar with using the command line interface via SSH, we recommend contacting our sales department to get an installation quote.

Note that this tutorial was written for Linux systems running a RedHat variant such as RHEL or CentOS. If you are using a different Linux flavor, you may need to adapt certain commands to work with your system. As with all our tutorials, this is written as-is and comes with no warranty or support what so ever. Should you rather Mean Servers install CSF for you, please contact the sales department for a quote.

Installing CSF

1.) Login to your server via SSH.

2.) Obtain the latest CSF package directly from ConfigServer by running: wget

3.) Untar the downloaded package by running: tar -xvzf csf.tgz

4.) Change directories to the newly created csf directly by running: cd csf/

If you are installing on a DirectAdmin system, proceed to Step 5-DA. If you are installing on a cPanel system, proceed to Step 5-CP. If you are installing on a Linux system without a control panel, proceed to Step 5-NP.

5-DA.) Run the following command: ./

5-CP.) Run the following command: ./

5-NP.) Run the following command: ./

6.) CSF has now been installed. If you wish to add the graphing ability, run the following command: yum install perl-GDGraph

7.) CSF now needs to be configured, which is beyond the scope of this article. Luckily, CSF is pretty much self explanatory when using either the CLI or GUI. Just read the instructions or hints if you are unsure what the purpose of a certain function is.

You can configure CSF via CLI or the GUI when using DirectAdmin/cPanel and the CLI if you do not have a control panel installed. The DirectAdmin GUI is located at the Admin Level under Extra Features titled ConfigServer Firewall&Security. In cPanel, the CSF GUI is available from the left handed menu, just search for ConfigServer Firewall&Security. If you are using the CLI, you can access CSF by running csf from command line. Running csf will show you a list of available commands along with helpful hints.

**Important**: Do not forget to whitelist your IP address and take CSF out of test mode once you have tested your settings to ensure they work as you expected.

Leave a Reply