ufw (the Uncomplicated Firewall) is the friendly command-line front end to the Linux kernel’s netfilter packet filter — the Netfilter/iptables layer that every Linux firewall ultimately talks to. Instead of hand-writing chains and matches, you describe what you want in plain words: ufw allow ssh, ufw allow from 192.168.122.0/24 to any port 22 proto tcp, ufw limit 2222/tcp. ufw translates those into the ruleset for you, and keeps the rules it generated in its own files so you always know which rules you wrote and which it added.
It is a Canonical project — maintained by Jamie Strandboge, with contributions from Ubuntu and Debian developers — and it is old enough to be boring in the best way: ufw has shipped in every Ubuntu installation since 8.04 LTS, and in every Debian installation since Debian 10, which makes it the firewall most Linux users actually run whether they chose it or not. The current upstream release is 0.36.2 (18 May 2023), a maintenance release for the 0.36 series. ufw is written in Python, and it drives iptables; on modern distributions that means the nftables-backed iptables-nft compatibility layer underneath, so a Debian 13 or Ubuntu 24.04 box is really filtering with nftables even though you only ever type ufw commands.
ufw allow 443/tcp, ufw allow in on eth0 to any port 80, ufw deny from 203.0.113.7./etc/ufw/applications.d, so instead of guessing ports you run ufw app list and then ufw allow OpenSSH or ufw allow 'Apache Full'. This is how a rule survives a service changing its port inventory.ufw limit ssh/tcp refuses an address that tries to open more than six connections inside 30 seconds, which is the cheapest hardening step for an internet-facing SSH server. Rules can also be logged individually, or with log-all.ufw enable the machine is closed rather than open. Policies are set per direction with ufw default.ufw status shows the (v6) counterparts next to the IPv4 entries so you can see they matched.ufw route command manages the FORWARD path, which is what you need on a gateway, router or container host rather than on a leaf server.ufw status numbered, insert NUM, prepend, delete NUM, plus --dry-run to print the ruleset ufw would apply without touching the live firewall. prepend exists specifically so tools such as Fail2ban can push a high-priority rule in front of yours.ufw logging off|low|medium|high|full controls how much traffic is written to the kernel log, all rate-limited so a flood cannot spin the disk.Because a firewall you actually configure is worth more than a firewall with better features that you keep postponing. Raw iptables is powerful and precise, but it is a language of tables, chains and matches, and a single transposed argument can lock you out of the box you are sitting in front of — or, worse, silently leave a port open. ufw gives you a vocabulary that fits in your head, applies sane defaults, and remembers your rules across reboots through its own startup files (/etc/ufw/before.rules, user.rules and friends) written in exactly the same syntax the ufw command accepts, so the configuration stays legible and can be version-controlled, templated and copied between hosts like any other config file.
It is also the pragmatic choice on Debian and Ubuntu: it is already installed, already integrated with the distribution’s packaging (application profiles arrive with the packages they describe), and documented as the default tool. That means less bespoke glue, fewer surprises after an upgrade, and a ruleset your colleagues can read. The honest limitation is that ufw is a host firewall, not an intrusion-detection system or a network policy engine: it decides which packets a single machine accepts, and nothing more. It pairs with — rather than replaces — a log-driven blocker like Fail2ban or CrowdSec, which can add and remove ufw rules in response to what they observe.
ufw limit, optionally restricted to a VPN or management subnet.ufw route to manage forwarded traffic.ufw status verbose is a one-line answer to “is this port actually open?”.Linux: packaged in Debian, Ubuntu, Arch, Fedora and openSUSE, and installed by default on Ubuntu (since 8.04 LTS) and Debian (since 10). Requires Python 3, gettext, a few netfilter kernel modules and iptables 1.4 or later. IPv4 and IPv6, with iptables as the interface to the kernel (nftables-backed on current distributions). Graphical front ends: Gufw (GTK) and KDE’s firewall module. There is no Windows or macOS port — ufw is a Linux firewall.
GPL-3.0 — GNU General Public License version 3, copyright Canonical Ltd.
launchpad.net/ufw (project, bug tracker, source) · wiki.ubuntu.com/UncomplicatedFirewall (documentation) · ufw(8) man page