UFW vs firewalld on Linux: Which Firewall to Use

ufw vs firewalld linux - custom-fwcmp-featured.png

Teams running mixed Ubuntu and AlmaLinux need a clear UFW vs firewalld map — both often wrap nftables. Deep dives: UFW basics, firewalld zones.

Ubuntu / Debian default

UFW is a friendly front-end; still check ufw status verbose.

bashufw
sudo ufw allow 22/tcp
sudo ufw enable
sudo ufw status
ufw
allow

RHEL family default

firewalld with zones — services like ssh, http.

bashfirewalld
sudo firewall-cmd --permanent --add-service=ssh
sudo firewall-cmd --reload
firewalld
zones

Do not double-stack

Running conflicting tools can yield confusing results — pick one manager per host.

WarningCloud SGs + host firewall both apply — document inbound paths end-to-end.
compare
one tool

Proxmox note

Datacenter firewall is separate — see Proxmox docs; host still needs SSH protection.

bashcheck
ss -tlnp | grep ':22'
Proxmox
host

Quick Reference

  • Ubuntu: ufw
  • RHEL: firewall-cmd
  • One firewall manager per host

Related tutorials

Diagrams are original illustrations by Gnome IT Solutions. Tutorial text © Gnome IT Solutions.