How to set up a firewall with UFW on Ubuntu
Step 1: Check if UFW is installed
sudo ufw versionsudo apt update && sudo apt install ufw -yStep 2: Set default policies
sudo ufw default deny incoming
sudo ufw default allow outgoingStep 3: Allow SSH (very important)
sudo ufw allow sshStep 4: Allow other services you need
Step 5: Enable UFW
Step 6: Check the status
Managing rules after setup
Application profiles
Rate limiting
Checking logs
Common mistakes
Done
Last updated