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

If you have any questions or problems regarding this article and want help within 24 Hours? Ask Now

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
Ubuntu Linux Toolbox: 1000+ Commands

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.

Leave a Reply

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

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>

Join Over 80000+ Linux Users
  1. 52882
  2. 2763
  3. 18,639

Enter your email to get latest Linux Howto's