Install a firewall on Ubuntu (gufw)

April 2018

Linux has a powerful firewall (netfilter) that can be configured with a command line tool (iptables). But this is not very intuitive.

Ubuntu 8.10 (Intrepid Ibex) is supplied with a simplified configuration of the firewall, gufw (Graphic uncomplicated firewall).

Install gufw

  • Type in a terminal: sudo apt-get install gufw
  • or go through Synaptic to install the gufw package.

Start the firewall

  • Go to System> Administration> Firewall configuration.
  • Enter the administrator password if requested.
  • And check "Firewall enabled".
  • That's it! You're protected.
  • Nobody can connect to your computer remotely

Note that you're protected even if the guwf window is not displayed.
(You do need to run gufw that to change the configuration of the firewall.)
The firewall will remain active even after restarting the computer.

Opening a port

If you need to open a port, follow the procedure:
  • Enter the port number to be opened.
  • Indicate whether it is TCP, UDP or both.
  • Click "Add".
  • For example, for BitTorrent, we open the port 6881 for both TCP and UDP:
  • Opening of ports is effective immediately and this configuration will be retained even after you restart the computer.
Published by jak58. Latest update on April 30, 2010 at 01:14 PM by jak58.
This document, titled "Install a firewall on Ubuntu (gufw) ," is available under the Creative Commons license. Any copy, reuse, or modification of the content should be sufficiently credited to CCM (
Ubuntu - What ports are open on my computer?
Ubuntu 9.10 - How to execute a .run program?