How to Install the CSF / LFD Firewall on your VPS / Dedicated Server

Throughout this guide, you'll learn how to install your own Firewall on your linux VPS / Dedicated server.
CSF / LFD is an excellent firewall which is based on IPtables rules which would protect your server from many threats including and not limited to : brute forces attacks, port scanning, HTTP / UDP / SYN flooding, Email relays...

CSF / LFD can be set up on any kind of server with or without cPanel. With cPanel you would have a graphic interface to manage it with great ease which would be included in your WHM Panel.


You can find the step below to set up your first firewall :

1) You would need to connect to your server in SSH with any SSH client (including Putty)

2) We are going to remove any previous download of CSF you may already have by typing this SSH command :

rm -fv csf.tgz

3) We are going to download the CSF package to your server :

wget http://www.configserver.com/free/csf.tgz

4) We are going to go inside its directory :

cs csf

5) Finally we will initiate the installation :

sh install.sh

That's it! Your CSF firewall is now installed. It is in test mode by default, you would need to edit the file csf.conf in /etc/csf in order to enable and configure the firewall as you please. If you are running cPanel / WHM, you can presently see a new menu in the plugins category named : ConfigServer Security & Firewall.
  • 859 Users Found This Useful
Was this answer helpful?

Related Articles

How to Refresh your cPanel License

If you have purchased your linux VPS along with a cPanel license. Your license won't be active...

How To Clean your cPanel Logs Files in One Go

This tutorial is meant to provide a shortcut to clean your log files in a cPanel Dedicated Server...

How To Update cPanel From SSH or GUI

In order to update the cPanel software on a Linux VPS, there is 2 ways to do it. Upgrading the...

How To Backup / Restore / Export your CSF Firewall Configuration

Whenever you want to deploy a new Linux VPS / Dedicated server, you generally have to set and...

How to activate TUN/TAP on your Linux VPS

Throughout this tutorial, we will show you how to activate the TUN / TAP feature on your linux...