Debian includes several packages which provide tools for managing a firewall. Iptables is installed as part of the base system It can be complicated for beginners to learn how to use the iptables tool to properly configure and manage a firewall, but UFW simplifies it.
UFW (Uncomplicated Firewall) is a user-friendly front-end for managing iptables firewall rules and its main goal is to make managing iptables easier or as the name says uncomplicated.
In this tutorial we will show you how to setup a firewall with UFW on Debian 9.