Track monthly data usage with vnstat

A lightweight daemon logs traffic per interface so you can check daily and monthly totals anytime.

LinuxnetworkmonitoringvnstatbandwidthLow risk
Install vnstat once, then run vnstat -m for monthly totals or vnstat -d for daily usage per network interface.

01Command

Command
$ vnstat -m

02What it does

vnstat runs a tiny background daemon that reads the kernel's interface counters every few minutes and stores them in a database — it doesn't sniff traffic, so it uses almost no CPU. After it has run for a day or more, vnstat -m shows how much you uploaded and downloaded each month, which is exactly what capped broadband and mobile hotspot users need. Real-time speed still needs nethogs or iftop.

03Risk

RiskLow risk
Requirementsvnstat installed and its service enabled: sudo apt install vnstat (service starts automatically)
!Warning: The database only starts counting from installation — past usage is unknown; also vnstat counts all traffic on the interface, including local network transfers.

04Undo

✓No undo needed — this command does not change persistent state.

05Sources

  • vnstat(1) — manual page
    Arch Linux · community · 2026-09-17
    Evidence: vnstat keeps a history of transferred data per interface and can display daily (-d) or monthly (-m) summaries.
  • vnstat(1) — Ubuntu manual page
    Ubuntu · community · 2026-09-17
    Evidence: vnstat -m shows monthly traffic from a database continuously populated by the vnstatd daemon; -d shows daily figures.

Last verified: 2026-09-18 · Category: Network

06Related solutions