How to Back up and Restore the CSF Firewall Configuration

Prior to making direct edits to the firewall configuration file or changing advanced firewall settings in WHM, a backup of the current configuration should be taken so that the settings can quickly and easily be reverted if needed.

Pre-Flight Check

  • This series assumes you have the ConfigServer Firewall (CSF) installed on your cPanel server, and you have access to WebHost Manager (WHM).
  • If your server currently uses APF but you’d prefer CSF, contact Heroic Support® and request a switch. There is no charge, it typically takes only a few minutes, and the only service that needs to be restarted as a result is the firewall itself. Our support technicians also can port your existing APF rules to CSF. If requesting an upgrade, please be sure to indicate whether your server uses the Guardian backup service so that its rules also can be configured.

How to Back up the Firewall Configuration

Step #1:

In WebHost Manager, locate and select ConfigServer Security & Firewall under the Plugins section in the left menu. You also can begin typing “fire” into the search field at the top left to narrow down the options.

Open the Firewall Configuration in WHM

Step #2: Open and Back up the Profile

  1. Scroll down to the csf – ConfigServer Firewall section and click the Firewall Profiles button.
  2. On the Firewall Profiles page, scroll down to the Backup csf.conf section, enter a name to identify the backup and click the Create Backup button.
    Back up the Firewall Configuration
  3. The next screen will show you the location of the backup file, which you’ll want to note in case you need to restore.
    CSF backup creation

How to Restore a Saved Configuration

Step #1: Open the Firewall Plugin in WHM

In WebHost Manager, locate and select ConfigServer Security & Firewall under the Plugins section in the left menu. You also can begin typing “fire” into the search field at the top left to narrow down the options.

Step #2: Open and Restore the Saved Backup

  1. Scroll down to the csf – ConfigServer Firewall section and click the Firewall Profiles button.
  2. On the Firewall Profiles page, scroll down to the Restore Backup Of csf.conf section and click on the name of the desired backup.
    Select CSF config backup to restore
  3. Click the Restore Backup button.
  4. On the next screen, click the Restart csf+lfd button to restart the firewall with the settings from the backup file.
    Backup restored

Next Steps

Now that you’re familiar with backing up and restoring a firewall configuration file, you’re ready to explore some of CSF’s advanced features.
See Part Two: How to Block by Country in the CSF Firewall.

Be Sociable, Share!
Here's $75, Launch a New VPS Today. Find out why 30,000 customers have chosen our Best-in-Class Performance & 24x7 Heroic Support.