UFW (Uncomplicated Firewall) is a simple tool to manage iptables firewall rules. This guide explains how to enable and configure UFW on Debian servers.
sudo apt update
sudo apt install ufw -y
sudo ufw allow ssh
This ensures you don’t get locked out of your server when enabling the firewall.
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp
These commands allow HTTP and HTTPS traffic.
sudo ufw enable
This activates the firewall with the rules you’ve set.
sudo ufw status verbose
Displays active rules and firewall status.
sudo ufw deny 23/tcp
Blocks Telnet (port 23), which is insecure and should not be used.
Note: HostPalace Debian servers support UFW for easy firewall management, helping clients secure their infrastructure quickly.