Set Up UFW Firewall on Ubuntu
Çap et- ufw, ubuntu firewall, setup ufw, ubuntu 20.04, linux security, uncomplicated firewall, server hardening, ufw rules, vps firewall, iptables alternative
- 0
UFW (Uncomplicated Firewall) is a user-friendly interface to manage iptables and simplify firewall configuration on Ubuntu systems. It’s a great tool for beginners who want to secure their server with minimal complexity.
Why Use UFW?
UFW helps you define basic firewall rules to allow or deny incoming/outgoing connections. It’s simple, effective, and ideal for Ubuntu servers like VPS environments.
Steps to Set Up UFW on Ubuntu 20.04:
- Install UFW (if not installed):sudo apt update && sudo apt install ufw
- Check current status:sudo ufw status verbose
- Allow essential ports before enabling the firewall:sudo ufw allow 22(SSH)sudo ufw allow 80(HTTP)sudo ufw allow 443(HTTPS)
- Enable UFW:sudo ufw enable
- Review current rules:sudo ufw status numbered
- To deny a specific port:sudo ufw deny 8080
- To delete a rule:sudo ufw status numbered→ note rule number →sudo ufw delete [number]
- Disable UFW (if needed):sudo ufw disable
Tutorial Videos:
- English: Watch on YouTube
- Arabic: مشاهدة على يوتيوب
UFW is highly recommended for managing firewall rules easily, especially on VPS and production servers. Just be careful to always allow SSH before enabling the firewall to avoid being locked out.

