Network security is a fundamental pillar of any desktop or server Linux installation. Ubuntu incorporates a robust network packet filtering framework known as UFW (Uncomplicated Firewall). While configuring UFW via command-line syntax is straightforward for administrators, managing complex port forwardings, application rules, and network log analysis can be intimidating for everyday desktop users. GUFW provides an intuitive, graphical interface for UFW, allowing Ubuntu users to enable desktop security, block suspicious connections, and open ports for gaming or media servers with simple toggles.
Why Running a Desktop Firewall Matters
Running an active firewall on your Ubuntu PC provides essential layers of defence:
- Public Wi-Fi Protection: Prevents unauthorized inbound scanning when connected to untrusted public Wi-Fi networks in libraries, airports, or cafes.
- Local Service Isolation: Ensures local development servers (like Apache, Docker, or Node.js) remain accessible only to localhost rather than broadcasting openly to the local LAN.
- Port Visibility: Provides an immediate visual audit of every active listening port on your system.
How to Install GUFW in Ubuntu
GUFW is available directly from the standard Ubuntu software universe repositories:
- Press
Ctrl + Alt + Ton your keyboard to open the terminal. - Install the package via APT:
sudo apt update && sudo apt install gufw - Type your sudo administrative password and press
Enter. - Once the installation finishes, you can close the terminal.
Launching GUFW and Enabling the Firewall
Because firewall rules modify core Linux kernel networking tables, launching the app requires elevated permissions:
- Open the Ubuntu Show Applications menu (the grid icon on your dock) and search for Firewall Configuration.
- Click the icon and enter your user password when prompted to authenticate administrative access.
- The main GUFW dashboard will appear.
- Locate the Status toggle switch near the top of the window and toggle it to On.
- Select your Profile:
- Home: Sets Incoming to Deny and Outgoing to Allow. Perfect for home networks behind a router.
- Public: Sets Incoming to Reject. Highly recommended when travelling with a laptop on public hotspots.
- Office: Balanced profile allowing local print sharing while blocking unapproved external queries.
Creating Custom Rules to Open Ports for Games or Servers
If you run a media server like Plex or host multiplayer game servers:
- Click on the Rules tab at the top of the GUFW interface.
- Click the + (Add Rule) button at the bottom of the window.
- Under the Preconfigured tab, you can search for popular software (such as SSH, Minecraft, or Transmission) and click Add to apply verified defaults automatically.
- Alternatively, click the Simple tab to specify an exact custom port number (e.g., port
8080), choose TCP or UDP, set Policy to Allow, and click Add.