How to Configure a Firewall with UFW on Ubuntu 18.04

In this article, we will show you how to install and configure UFW on an Ubuntu 18.04 VPS. First, we will take a moment to introduce and explain what firewalls are, and then we’ll show you how to use UFW and how to make the appropriate UFW configuration.

A firewall is a software program that monitors the network traffic and prevents unauthorized access to or from a private network. In regards to the Linux kernel, a Netfilter subsystem is implemented, which is used to manipulate the network traffic. Almost all modern Linux firewall solutions use this system to filter network packets. Additionally ???iptables??? – a firewall utility accessible from the command line – is also part of the Netfilter framework. To simplify the process of creating firewall rules, Canonical (the creators of Ubuntu) developed an iptables interface called Uncomplicated Firewall (UFW).

If you are using Ubuntu 18.04 and want to secure your network without having to deal with learning how to use iptables, then UFW may be the appropriate solution you are looking for.