Back to documentation
Security

Configuring the Firewall

Set up UFW firewall rules to protect your server from unauthorized access.

Intermediate5 min readUpdated 2024-02-01

About UFW

UFW (Uncomplicated Firewall) is a user-friendly interface for iptables. It helps you:

  • Block unwanted traffic
  • Allow specific ports and services
  • Whitelist IP addresses
  • Log connection attempts

Default rules

When you set up the firewall:

  • Default: Deny all incoming
  • Allow: SSH (port 22)
  • Allow: HTTP (port 80)
  • Allow: HTTPS (port 443)

This keeps your server secure while allowing web traffic.

Adding rules

To add a firewall rule:

  1. Go to Security > Firewall
  2. Click "Add Rule"
  3. Choose:
    • Action: Allow or Deny
    • Port: Port number or range
    • Protocol: TCP, UDP, or both
    • Source: Any or specific IP
  4. Click "Add"

Managing rules

In the firewall interface:

  • View all active rules
  • Enable/disable individual rules
  • Delete rules you no longer need
  • Reorder rule priority

Screenshots

Configuring the Firewall - Screenshot 1

Screenshots may vary slightly from the current version

Related Features

Ready to try Server Compass?

Download the app and deploy your first application in under 5 minutes. No terminal knowledge required.