How to install CSF on Linux 

In this tutorial you will learn how to install and configure CSF on Linux Dedicated server.

Installation of CSF

At present before installing CSF make sure you need to install the following Perl modules.

The given modules are needed for detail graphs open from the CSF UI. we require Perl modules which can assist CSF with running its modules in the backend.

Install csf Ubuntu commandline

$ sudo apt-get install liblist-compare-perl

Install CSF is immediate and quiet to get to it.

First of all download most recent source file of CSF firewall utilizing beneath command to download,

$ sudo wget

Now extract downloaded file and in the event that you need you can remove that after extraction.

$ sudo tar -xvzf csf.tgz && rm csf.tgz

Go into the CSF file to install,

$ cd csf/

Run "" script to install CSF file,

$ sudo ./

Presently, we should confirm that in the event that you have fundamental iptables modules by utilizing underneath command on your Linux Dedicated server,

$ sudo perl /usr/local/csf/bin/

You can view something almost similar to.

Testing ip_tables/iptable_filter...OK

Testing ipt_LOG...OK

Testing ipt_multiport/xt_multiport...OK

Testing ipt_REJECT...OK

Testing ipt_state/xt_state...OK

Testing ipt_limit/xt_limit...OK

Testing ipt_recent...OK

Testing xt_connlimit...OK

Testing ipt_owner/xt_owner...OK

Testing iptable_nat/ipt_REDIRECT...OK

Testing iptable_nat/ipt_DNAT...OK


RESULT: CSF should function on this web server

You need to remove the already firewalls from the server of your Linux Dedicated hosting if such exist, else it will hurt CSF surely.

$ sudo bash /usr/local/csf/bin/


One of the undertaking to check and remove of the firewall is done likewise bear in mind about that sneaky UFW Firewall.

$ sudo ufw disable


Firewall stopped and disabled on system startup


Go into default directory of csf file, Modify to csf config file.

  $ cd /etc/csf/

Presently inside this directory, All arrangement of CSF are here and take a look at these records later we're experiencing a portion of the configuration documents to realize what we can do.

r00t@ubuntu14:/etc/csf$ ls


alerts                csf.deny         csf.logfiles    

csf.rblconf           csf.sips    


changelog.txt         csf.dirwatch     csf.logignore  

csf.redirect          csf.smtpauth     csf.uidignore   

messenger             ui

csf.allow             csf.dyndns       csf.mignore    

csf.resellers         csf.suignore     csfwebmin.tgz

csf.blocklists        csf.fignore      csf.pignore    

csf.rignore           csf.syslogs      install.txt   

readme.txt            version.txt

csf.conf              csf.ignore        

csf.signore           csf.syslogusers       webmin


Below are the CSF firewall commands for the installation procedure.


Alter the configuration file to roll out improvements keeping in mind the end goal to work CSF,

  $ sudo nano csf.conf


Under this setup, Scroll down and search and roll out improvements to,

    **Testing="1"**  to **Testing="0"**


Save and then close it, It will enable CSF for utilize.

In case everything goes as in the guide, We would now be able to start CSF and LFD administrations.

$ sudo service csf start


$ sudo service lfd start

Yield should resemble this at the base,

LOCALINPUT all opt -- in !lo out * -> 

LOCALOUTPUT all opt in * out !lo ::/0 -> ::/0

LOCALINPUT all opt in !lo out * ::/0 -> ::/0


We are going to examine CSF design files and it’s uses

At beginning of CSF, If you get this following mistake demonstrated as follows,

*WARNING* URLGET set to use LWP but Perl module is not    installed, reverting to HTTP:: Tiny

Use the command given below to install perl dependencies so CSF will work properly.

$ sudo apt-get install libwww-perl

All done, now CSF is installed on your Linux Dedicated server.