How to Install Firewall in Ubuntu (UFW) 🔥🛡️

Ubuntu uses UFW (Uncomplicated Firewall) to manage firewall rules easily. It helps protect the system by controlling incoming and outgoing network traffic.


Step 1: Update the System

Open the Terminal and update packages.

sudo apt update

Step 2: Install UFW Firewall

Install the firewall package.

sudo apt install ufw

Step 3: Check Firewall Status

Check whether the firewall is active.

sudo ufw status

Example output:

Status: inactive

Step 4: Enable the Firewall

Enable UFW protection.

sudo ufw enable

Example output:

Firewall is active and enabled on system startup

Step 5: Allow Services (Example: SSH)

Allow specific services if required.

sudo ufw allow ssh

You can also allow HTTP for web servers.

sudo ufw allow http

Step 6: Check Firewall Rules

sudo ufw status verbose

Step 7: Disable Firewall (Optional)

If needed, you can disable it.

sudo ufw disable

Example Screenshots (Terminal)

1️⃣ Installing UFW

https://img.azdigi.com/2021/01/Screenshot-2021-01-22-at-22.12.17%402x.png
https://www.cyberciti.biz/media/new/faq/2018/11/Setup-a-UFW-firewall-on-Ubuntu-18.04-LTS-server.png
https://www.linux.com/images/stories/66866/ufw_A.png

By admin

Leave a Reply

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