A few words of thanks would be greatly appreciated.

Install a firewall on Ubuntu (gufw)

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.

A few words of thanks would be greatly appreciated.

Ask a question
CCM is a leading international tech website. Our content is written in collaboration with IT experts, under the direction of Jean-François Pillou, founder of CCM.net. CCM reaches more than 50 million unique visitors per month and is available in 11 languages.


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 (ccm.net).