UFW setup

UncomplicatedFirewall is an interface to iptables to simplify the process of configuring a firewall on Linux systems.

Quick start

  1. Check firewall status:
    sudo ufw status verbose
  2. Disable incoming traffic and enable outgoing
    sudo ufw default deny incoming
    sudo ufw default allow outgoing
  3. Allow usual connections
    sudo ufw allow ssh
    sudo ufw allow http
    sudo ufw allow https
  4. Enable firewall
    sudo ufw enable

Extra customizations

To allow specific port ranges:

sudo ufw allow 6000:6007/tcp
sudo ufw allow 6000:6007/udp

To allow specific IP Addresses:

sudo ufw allow from
sudo ufw allow from to any port 22