How to Disable the Ubuntu ‘Vnstat’ Service

The Network Traffic Monitor

When setting up an Ubuntu server for network routing or firewall management, administrators sometimes install vnstat. This is a console-based network traffic monitor. When installed, it creates the vnstat.service daemon, which runs continuously in the background, polling the Linux kernel for network interface statistics (bytes sent and received) and logging that data to a local database. This allows you to generate historical graphs of your server’s bandwidth usage over days, weeks, or months.

While useful on a dedicated router or a server with a strict, metered bandwidth cap, it is largely unnecessary on standard application or database servers running within a modern cloud environment. Cloud providers (like AWS, Google Cloud, or DigitalOcean) provide their own robust, external bandwidth monitoring tools natively through their dashboards. Running vnstat internally duplicates this effort, constantly waking up the CPU to write microscopic data points to the disk, causing unnecessary I/O overhead. If you rely on external monitoring tools, you should disable the local daemon.

How to Disable the Vnstat Daemon

You can stop this background traffic logger using systemctl.

Warning: Do not disable this if you are actively using the `vnstat` command-line tool to track your monthly data allowance. Disabling the daemon will halt all data collection.

  1. Open your Ubuntu Terminal or connect via SSH.
  2. Stop the active logging daemon:
sudo systemctl stop vnstat.service
  1. Disable the service to prevent it from starting automatically on the next boot:
sudo systemctl disable vnstat.service
  1. (Optional) If you never intend to use the tool again, you can remove the package and its databases entirely:
sudo apt-get purge vnstat

Your Ubuntu server will immediately stop polling the network interfaces for statistical logging, freeing up disk I/O and reducing background noise.

Get the best tech tips delivered straight to your inbox.

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