How to Disable the Ubuntu ‘UFW’ Firewall Logging Completely

The Logging Deluge

UFW (Uncomplicated Firewall) is the default firewall configuration tool for Ubuntu. When enabled, it does an excellent job of blocking unwanted incoming traffic. However, by default, UFW also logs every single blocked packet to your system’s kernel log (/var/log/kern.log) and system log (/var/log/syslog).

If your server is exposed to the public internet, it is constantly being pinged and scanned by automated bots. UFW will dutifully block these thousands of unauthorized requests, but it will also write a line of text to your log files for every single one of them. This can quickly bloat your log files to massive sizes, eating up valuable disk space and making it impossible to find actual, critical system errors hidden amidst the firewall noise. You can turn this logging off entirely.

How to Disable UFW Logging

You can change the logging level directly via the UFW command line interface.

  1. Open your Ubuntu Terminal (or connect via SSH).
  2. To completely turn off all UFW logging, run the following command:
sudo ufw logging off
  1. The system will respond with Logging disabled.
  2. You can verify the change by checking the UFW status:
sudo ufw status verbose

Look at the “Logging” line in the output; it should now say off. The firewall itself is still perfectly active and will continue to block malicious traffic according to your rules, but it will do so silently, keeping your system logs clean and readable.

Get the best tech tips delivered straight to your inbox.

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