Skip to main content

Firewall

Backend

This is the desired setup

ubuntu@vps-3c0a09ff:~$ sudo ufw status
Status: active

To Action From
-- ------ ----
22/tcp ALLOW Anywhere
80/tcp ALLOW Anywhere
443/tcp ALLOW Anywhere
22/tcp (v6) ALLOW Anywhere (v6)
80/tcp (v6) ALLOW Anywhere (v6)
443/tcp (v6) ALLOW Anywhere (v6)

To achieve that execute the following commands:

# Reset UFW (optional, if you want a clean slate)
sudo ufw reset

# Allow SSH, HTTP, and HTTPS traffic
sudo ufw allow 22/tcp
sudo ufw allow 80/tcp
sudo ufw allow 443/tcp

# Enable UFW (if not already enabled)
sudo ufw enable

# Check status to verify:
sudo ufw status