How to set up a basic firewall

A firewall is your server's first line of defence, controlling which connections are allowed in. On cPanel servers, CSF (ConfigServer Security & Firewall) is the popular choice.

The essentials

  • Allow the ports you actually use — typically 80 and 443 (web), 22 (SSH), and mail ports.
  • Block everything else by default.
  • Enable login failure detection to auto-block brute-force attempts.

With CSF

Once installed, CSF adds a section in WHM where you can manage allowed ports, view blocked IPs and tune protection — no command line needed for day-to-day tasks.

Be careful

Don't lock yourself out — always keep your SSH port open and test changes carefully. Want us to install and configure a firewall for you? Open a ticket.

Was this answer helpful?

 Print this Article

Also Read

Getting started with your VPS or dedicated server

A VPS or dedicated server gives you more power and full control. Here's how to get going after...

How to reboot your server

Sometimes a reboot is the quickest fix for a server that's sluggish or unresponsive. You can do...

How to connect to your server via SSH

SSH gives you secure command-line access to your VPS or dedicated server — the most direct way to...

How to change your server root password

It's wise to set a strong root password and change it periodically, or immediately if you suspect...

How to install a control panel on your server

A control panel like cPanel/WHM gives your server a friendly web interface for managing sites,...