Clear, practical technology insights BSOD Code Lookup · Windows Error Code Lookup · Wi-Fi Troubleshooting · PC Troubleshooting Checklist

How to Set Up the GUFW Firewall on Ubuntu

Install GUFW, choose safe defaults, allow only the incoming connections you need, and verify the active firewall rules.

Table of Contents

GUFW is a desktop interface for Ubuntu’s Uncomplicated Firewall (UFW). A common starting point for a desktop is to deny incoming connections and allow outgoing connections. Add exceptions only for services you use. If you’re administering the machine remotely, confirm that your existing access is allowed before enabling the firewall.

Install GUFW from Ubuntu’s repositories

In a terminal, refresh the package index and install GUFW. If Ubuntu can’t find it, check that the Universe repository is enabled for your release.

sudo apt update
sudo apt install gufw

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 1

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 2

Install through the software app

If your software app lists Ubuntu repository packages, search for GUFW or Firewall Configuration, then install it.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 3

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 4

Check the defaults and enable the firewall

Open Firewall Configuration from the app menu and authenticate if prompted. Review the current incoming and outgoing policies and any existing rules. Enable the Status switch after you’ve confirmed that the connections you need will still be allowed.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 5

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 6

Use profiles for different rule sets

GUFW profiles let you store different policies. Check the settings in each profile before activating it. A name like Home or Office does not indicate which traffic will be allowed on your system.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 7

Use Edit → Preferences to add, rename, or remove a custom profile. Review the selected profile before making changes.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 8

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 9

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 10

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 11

Add and edit only the rules you need

In Rules, select +. Use Preconfigured for a listed service, Simple for a specific port, or Advanced to restrict the source address, network, or interface. For a service that only your local network should reach, restrict the rule to that network if you know its subnet.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 12

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 13

Allow permits matching traffic. Deny drops it, while Reject sends a rejection response. Limit rate-limits new connections for supported rules.

Select an existing rule and use its settings or edit control to adjust it. Review what the rule permits before saving.

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 14

How to setup GUFW (Graphical Uncomplicated Firewall) on Ubuntu Picture 15

Verify the resulting configuration

sudo ufw status verbose

Check that UFW is active and that the listed rules match what you intended. Test an allowed service from an authorized device. See Ubuntu’s firewall documentation for how UFW fits into the system.

Discussion

Reader Comments 0

Sign in with email or Google to join the discussion.