How to enable or disable UFW, the built-in firewall configuration tool on Ubuntu 22.04 or 20.04 LTS, is covered in a tutorial by Linux Capable.
Enable or Disable Firewall on Ubuntu 22.04 | 20.04
Learn how to enable/disable the firewall on Ubuntu 22.04 or Ubuntu 20.04 LTS using the command line terminal or graphically using the command terminal.