Firewall configuration via UFW

This guide shows you how to install and enable the firewall via ufw.

Install Fail2ban

[email protected]:~# apt-get update && apt-get install ufw

Configure firewall

It is important that you configure the firewall rules before you enable it. Otherwise you might lock yourself out.

Configure allow rules

[email protected]:~# ufw allow http
[email protected]:~# ufw allow https
[email protected]:~# ufw allow ssh
[email protected]:~# ufw enable

Activate firewall

[email protected]:~# ufw enable