Server setup: Setting up a firewall
A firewall is a basic filter that can provide an efficient protection to your server by only allowing the traffic in and out as the rules of the firewall allows it. Setting up a firewall on a Ubuntu Linux server does not need to be complicated - in fact the one used in this example is called “uncomplicated firewall”.
To get the firewall up and running make sure it’s installed through the package manager. Login and switch to a root shell, then install the firewall with this command: