Hostxpeed
Login Get Started →
Security

How to Set Up a Firewall with UFW

5 min read
6 views
Apr 15, 2026

Install UFW

apt install ufw -y

Allow Essential Ports

ufw allow 22/tcp   # SSH
ufw allow 80/tcp   # HTTP
ufw allow 443/tcp  # HTTPS

Enable UFW

ufw enable

Check Status

ufw status verbose

Your firewall is now active. Only ports you have explicitly allowed will accept connections.

Was this article helpful?