How To Enable Firewall with UFW On Ubuntu Server 20.04 LTS

How To Enable Firewall with UFW On Ubuntu Server 20.04 LTS


Security on servers is a good thing to apply on all your systems. One of the tools at hand is the firewall, with Ubuntu Server the firewall is available but not enabled. In this post, we will enable UFW on Ubuntu Server.


First, what is UFW? UFW stands for uncomplicated firewall and is easy to use. with a few easy steps we can be up and protected.

Before we enable ufw we will want to open SSH port 22 so we can get back into the system after enabling. You must have sudo privileges to run these commands.

From a terminal type the following.

$ sudo ufw allow ssh


Now we can turn the firewall on. Type:

$ sudo ufw enable

UFW Enable

Let’s check our work and status. Type:

$ sudo ufw status

UFW Status

And that is all there is to do. Note: as you install applications (Apache, NGINX, etc..), that other systems need to access you will need to open the ports on the firewall

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.