Exclusive Metin2 game shield on FreeBSD: Automatic siege mode, VIP list, and whitelist from your dashboard. See how it works
Create a server

Guide

How to Enable UFW Firewall on Ubuntu

UFW (Uncomplicated Firewall) is the simplest way to filter traffic on Ubuntu. Allow SSH before enabling it or you will lock yourself out.

Steps

  1. Install UFW if needed:

    sudo apt update
    sudo apt install -y ufw
  2. Allow SSH (port 22 or your custom port) before enabling:

    sudo ufw allow OpenSSH
  3. If you serve a website, open HTTP and HTTPS:

    sudo ufw allow 80/tcp
    sudo ufw allow 443/tcp
  4. Enable the firewall and check status:

    sudo ufw enable
    sudo ufw status verbose

Tips

  • If you changed the SSH port, use sudo ufw allow 2222/tcp (or yours) instead of OpenSSH.
  • To remove a rule: sudo ufw status numbered then sudo ufw delete N.

ext step

Firewall ready on a clean VPS: Deploy your Cloud VPS.

Related guides