How to Configure UFW Application Profiles on Ubuntu

The Uncomplicated Firewall (UFW) is the default firewall configuration tool for Ubuntu. While it is easy to open and close specific ports (e.g., sudo ufw allow 80), managing raw port numbers becomes tedious and error-prone as you install more services. A much better approach is to use UFW Application Profiles—pre-configured rulesets bundled with software packages that allow you to manage firewall access by service name rather than port number.

What is a UFW Application Profile?

When you install a major network service on Ubuntu, such as Apache, Nginx, or OpenSSH, the package often includes a UFW profile file (stored in /etc/ufw/applications.d/). This file defines the exact ports and protocols the application needs to function.

How to List Available Profiles

To see which application profiles are currently available on your server, run the following command:

sudo ufw app list

You will see an output similar to this, depending on what software is installed:

Available applications:
  Apache
  Apache Full
  Apache Secure
  Nginx Full
  Nginx HTTP
  Nginx HTTPS
  OpenSSH

How to View Profile Details

Before enabling a profile, you might want to see exactly which ports it will open. Use the app info command followed by the profile name. (If the profile name contains spaces, enclose it in quotes).

sudo ufw app info "Nginx Full"

The output will show the profile description and the specific ports/protocols (e.g., 80/tcp and 443/tcp).

How to Enable and Disable Profiles

To allow traffic for a specific application, use the allow command followed by the profile name:

sudo ufw allow "Nginx Full"

UFW will read the profile and automatically create the necessary underlying iptables rules. You can verify the rules were added by checking the firewall status:

sudo ufw status verbose

If you later uninstall the application or want to revoke access, simply use the delete command:

sudo ufw delete allow "Nginx Full"

Using UFW Application Profiles not only makes configuring your firewall significantly faster, but it also makes your firewall rules self-documenting and easier for other administrators to understand at a glance.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.