Security is very important when you run your own server. And You want to make sure that only authorized users can access your server and services installed in the server.

Ubuntu comes with default firewall (already installed) called UFW. UFW stands for Uncomplicated Firewall.

Step 1 : To install the ufw firewall on ubuntu if not installed already, execute the below command:

first update the apt package


$ sudo apt-get update

Output something like the below screenshot :-

Now run below command on terminal to install ufw firewall


$ sudo apt-get install ufw

Output something like the below screenshot :-

Step 2 : To check the status of the ufw, execute the below command:



$ sudo ufw status

Output something like the below screenshot :-

Step 3 : To enable the ufw firewall on ubuntu, execute the below command:


$ sudo ufw enable

Output something like the below screenshot :-

Step 4 : To disable the ufw firewall on ubuntu, execute the below command:

first update the apt package


$ sudo ufw disable

Output something like the below screenshot :-

Step 5 : If you need to reload ufw (reload rules), execute the below command.


$ sudo ufw reload

Output something like the below screenshot :-

Previous post
How To Install Docker on Ubuntu 18.04
Next post
How to reindex Magento 1.x by using command line

Write a Comment

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

All Rights Reserved. ReadAndCare