Enable VPS Firewall on Ubuntu
Using UFW (Uncomplicated Firewall) to enable VPS firewall and allow traffic on ports 80 (HTTP) and 443 (HTTPS)
Allow SSH access
sudo ufw allow ssh
Allow HTTP traffic on port 80
sudo ufw allow http
Allow HTTPS traffic on port 443
sudo ufw allow https
Enable UFW
sudo ufw enable
Check the UFW status
sudo ufw status verbose