In this article you will learn how to enable and disable firewall on Ubuntu 20.04 LTS Focal Fossa Linux

In this tutorial you will learn:
  • How to check firewall status
  • How to enable/disable firewall
  • How to control firewall settings from GUI
How to enable/disable firewall on Ubuntu 20.04 LTS Focal Fossa
How to enable/disable firewall on Ubuntu 20.04 LTS Focal Fossa

Software Requirements and Conventions Used

Software Requirements and Linux Command Line Conventions
Category Requirements, Conventions or Software Version Used
System Installed or upgraded Ubuntu 20.04 Focal Fossa
Software N/A
Other Privileged access to your Linux system as root or via the sudo command.
Conventions # - requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command
$ - requires given linux commands to be executed as a regular non-privileged user

How to enable/disable firewall on Ubuntu 20.04 LTS Focal Fossa Linux step by step instructions

UFW ( Uncomplicated Firewall ) firewall is a default firewall on Ubuntu 20.04 LTS Focal Fossa.
  1. Check the current firewall status:
    $ sudo ufw status
    [sudo] password for linuxconfig: 
    Status: inactive
    
    For more detailed output regarding your current firewall settings execute:
    $ sudo ufw status verbose
    
  2. To enable your firewall execute the following command.
    WARNING
    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
    

  3. SUBSCRIBE TO NEWSLETTER
    Subscribe to Linux Career NEWSLETTER and receive latest Linux news, jobs, career advice and tutorials.


  4. To control the UFW firewall via GUI interface you will need to install the gufw package:
    $ sudo apt install gufw
    
  5. To manipulate the status of the UFW firewall via GUI now start the gufw application and click on the Status switch to either enable or disable the firewall.
  6. How to enable/disable firewall on Ubuntu Linux
ARE YOU LOOKING FOR A LINUX JOB?
Submit your RESUME, create a JOB ALERT or subscribe to RSS feed on LinuxCareers.com.
LINUX CAREER NEWSLETTER
Subscribe to NEWSLETTER and receive latest news, jobs, career advice and tutorials.
DO YOU NEED ADDITIONAL HELP?
Get extra help by visiting our LINUX FORUM or simply use comments below.