How to Install and Use UFW Firewall on Linux


UFW also known as Uncomplicated Firewall is an interface to iptables and is particularly well-suited for host-based firewalls. UFW provide an easy to use interface for beginner user who is unfamiliar with firewall concepts. It is most popular firewall tool originating from Ubuntu. It supports both IPv4 and IPv6.

In this tutorial, we will learn how to install and use UFW firewall on Linux.


  • Any Linux based distribution installed on your system
  • root privileges setup on your system

Installing UFW


By default, UFW is available in most Ubuntu based distributions. If it is deleted, you can install it by running the following linux command.

# apt-get install ufw -y 


Read more