If you are working in Apache 2 Ubuntu system and if you run ufw status command on terminal you see “ufw status inactive”. And, You can enable or activate the issue using the sudo ufw enable command on a terminal window.
How to fix “UFW Status Inactive” on Ubuntu 22.04
Here are some steps to help you activate the inactive UFW firewall on ubuntu 22.04:
Step 1: Open Terminal Window
To check the status of UFW on your Ubuntu system, you’ll need to use the Terminal. You can open the Terminal by pressing Ctrl + Alt + T
or by searching for “Terminal” in the applications menu.
Step 2: Check UFW Status
To check the status of the UFW firewall you need to use the sudo ufw status command;
sudo ufw status
If the UFW firewall status is active or enable in your system, you will see the following output on the terminal:
Status: active To Action From -- ------ ---- OpenSSH ALLOW Anywhere
Otherwise, your terminal window will display Inactive instead of Active, something like this:
Status: inactive
If UFW is active, the output will display a list of rules and their corresponding actions (ALLOW or DENY). These rules define how traffic is allowed or denied on different ports.
If UFW is inactive, the output will simply state “Status: inactive,” which means UFW is not currently enforcing any firewall rules.
Step 3: Enable UFW Firewall Ubuntu 22.04
Type this command on terminal windows, to activate the inactive UFW firewall status on ubuntu 22.04:
sudo ufw enable
After enabling UFW, you can check its status again using the sudo ufw status
command. You can configure firewall rules according to your requirements.
Step 4: Reload UFW
If you modify the rules, you need to reload UFW for the changes to take effect:
sudo ufw reload
Here is the video guide on how to enable ufw firewall on ubuntu 22.04:
Conclusion
That’s it; you have successfully learned how to check ufw status and activate/enable ufw firewall in ubuntu apache 2 system.