The default firewall on Ubuntu 22.04 Jammy Jellyfish is ufw, which is short for “uncomplicated firewall.” Ufw is a frontend for the typical Linux iptables commands, but it is developed in such a way that basic firewall tasks can be performed without the knowledge of iptables.
Additionally, ufw can be managed from a graphical interface. In this tutorial, you will learn how to enable and disable the ufw firewall on Ubuntu 22.04 Jammy Jellyfish from both command line and GUI.
In this tutorial you will learn:
- How to check firewall status
- How to enable/disable firewall
- How to control firewall settings from GUI
|Category||Requirements, Conventions or Software Version Used|
|System||Ubuntu 22.04 Jammy Jellyfish|
|Other||Privileged access to your Linux system as root or via the
# – requires given linux commands to be executed with root privileges either directly as a root user or by use of
$ – requires given linux commands to be executed as a regular non-privileged user
How to enable/disable firewall on Ubuntu 22.04 LTS Jammy Jellyfish Linux step by step instructions
Enable or Disable Ubuntu firewall via command line
- The first thing we should do is open a command line terminal and check the status of the firewall to see if it’s on or off with the following command.
$ sudo ufw status Status: active
As seen here, our firewall is currently active (on). For more detailed output regarding your current firewall settings, add the
$ sudo ufw status verbose
- To disable the Ubuntu firewall, execute the following command.
$ sudo ufw disable
- If you decide you need to enable the Ubuntu firewall again later, you can run the following command.
Please note that by enabling your firewall, you may get disconnected if you are currently using SSH to remotely connect to your Ubuntu server.
$ sudo ufw enable
Enable or Disable Ubuntu firewall via GUI
- To control ufw via GUI, you need to install the
gufwpackage with the following command.
$ sudo apt install gufw
- After installation, search for the
gufwapplication in the Activities menu to open it.
- Simply click the Status toggle button in order to turn the ufw firewall on or off. After you are satisfied with the changes, you can close the application window. Your changes will take effect immediately.
See the video below for more help.
In this tutorial, you learned how to enable or disable the system firewall (ufw) in Ubuntu 22.04. You also saw how to check the current status of the firewall. Normally, you will not need to disable the firewall unless for testing purposes or something similar. Usually, it is better to simply allow a port through the firewall.