How to Install and Configure UFW – An Un-complicated FireWall in Debian/Ubuntu

If You Appreciate What We Do Here On TecMint, You Should Consider:

  1. Stay Connected to: Twitter | Facebook | Google Plus
  2. Subscribe to our email updates: Sign Up Now
  3. Use our Linode referral link if you plan to buy VPS (it starts at only $10/month).
  4. Support us via PayPal donate - Make a Donation
  5. Support us by purchasing our premium books in PDF format.
  6. Support us by taking our online Linux course in 5 Days

We are thankful for your never ending support.

Pungki Arianto

Currently I am a Linux/Unix administrator. But I also play Windows both in server and desktop area. Interested in information technology, information security and writing.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

Receive Your Free Complimentary eBook NOW! -

Download Free Linux eBooks

Advanced Bash-Scripting Guide
Linux Bible
A Newbie's Getting Started Guide to Linux
Introduction to Linux - A Hands on Guide

You may also like...

9 Responses

  1. hurin says:

    Hi, thx for the tutorial, it really helps me out ^^

    By the way, i think there’s a small typo error with the command line => “dpkg –get-selection”
    Isn’t it “dpkg –get-selections” ?

    Anyway, great tutorial, thanks again :)

  2. Websearch2 says:

    sudo ufw allow form -> should be from not form

  3. Pungki Arianto says:

    Hi websearch,

    I never use UFW to block websites. But I think we can use this trick to do it :

    sudo ufw deny out to <> port 80

    But please remember, this will block All access on port 80, on that server.

    If you need to block websites, I think a tool such as Dansguardian may a good option.

  4. websearch says:

    Thanks you.

    Tell me please
    How can blocking sites (example

  5. Dave Dux says:

    I wonder if it’s possible to allow a certain port to open only if the certain application is running. Like ufw to open 51234 tcp port when I start Transmission, but close it when I close Transmission [torrent client]. That would be awesome. :)

  6. Staffan Melin says:

    Very good and simple to follow guide!

    One small error/typo below “List the current ufw rules”: The command should be
    $ sudo ufw status verbose (you forgot the “ufw”)

  7. Mark says:

    Great information, in a simple to understand tutorial. Bookmarked.

Got something to say? Join the discussion.

Your email address will not be published. Required fields are marked *

Join Over 150K+ Linux Users
  1. 100,756
  2. 5,113
  3. 36,418

Enter your email to get latest Linux Howto's