How to Install CSF (Config Server Firewall) in Linux?

Install CSF in Linux
This article will help you to learn how to install CSF ( Config Server Firewall ) in Linux. CSF will provide an extra layer of security for your server.

CSF is one of the best firewalls out there that will provide an extra layer of security for your Linux server. Follow the below steps to install CSF and LFD.
Go to “/opt”, download the latest CSF source files, and untar it.

cd /opt
tar -xvf csf.tgzcd csf


Execute the “” shell script to install the CSF.



Next, test whether you have the required iptables modules:

perl /etc/csf/


If you have any APF or BFD firewalls installed in your system, you can run the below command to uninstall it. ( Otherwise, there will be conflict. )

sh /etc/csf/


By default, CSF will be running in “test” mode. Please follow the below steps to disable “test” mode and to make CSF fully functional.
Edit the CSF main configuration file.

vi /etc/csf/csf.conf


You can find the below lines.



Change it as follows.



Now restart CSF, LFD, and IPtables to update the changes.

/etc/init.d/csf restart
/etc/init.d/lfd restart
/etc/init.d/httpd restart


That’s it!! You have Installed and configured CSF and LFD in your system.

If you find any difficulty following the steps, please do let us know and we will be right here for your help.

Share this post

Services to Explore

Stay up to date!

Stay up to date with the Web Hosting, Cloud and Server Management Industry News and Tutorials!

We will send you only the relevant emails, and we respect your privacy. Please review our privacy policy for more info.

Linux Management Services

Focus on your business, and let us take care of your Linux Servers!
From what you are reading, it seems you are interested in Linux and related technologies. If you have a moment to spare, please take a look at our Linux Management Services plan, which might interest you even more!
Linux Management Plan

Value-Added Services

We have services that can help you run a successful business. With us, you don't have to worry about these areas because our experts will take care of it for you.

ServerHealers uses cookies.