How to install CSF

To install CSF from your server, you may use the following command.

mkdir /tmp/;cd /tmp/;wget;tar zxf csf.tgz;cd csf;sh;

Once you finished install, you can either edit the configuration file from WHM with step below.
WHM >> Plugins >> “Config Server Security and Firewall” option.

If you do not have WHM (cPanel) installed, you may configure the setting from /etc/csf/ folder. And the CSF configuration stored from /etc/csf/csf.conf.

Extra configuration will be as below:

-If you would like to disable APF+BFD,run the following command.


CSF is pre configured to work on a cPanel server with all the standard cPanel ports open. It also auto-configures your SSH port if it’s non-standard on installation.

Once you make the required changes to your CSF configuration file and are sure, you are not going to block yourself out, change the following from /etc/csf/csf.conf from


and restart the csf firewall using command below:

csf -r

To uninstall csf and lfd is even more simple.

cd /etc/csf;sh

Published by

Mick Genie

Mick Genie is the founder of and working at ExaBytes Network Sdn Bhd and WPWebHost web host company. He is expertise in Windows and Linux environment especially web hosting related information, tips and trick as well as the IT Information.