vnStat counts the data that your server sends and receives, per hour, day and month, and keeps the numbers after a restart. It helps you see how much of your monthly traffic you use and when. The steps were tested with vnStat 2.13 on Ubuntu 26.04 LTS.


1. Install vnStat

apt install vnstat

vnStat starts at once and counts all network cards. It counts only from now on: traffic from before the installation is not included. It saves its numbers every 5 minutes, so the first numbers appear a few minutes after the installation; until then it says No data.

Find the name of your network card; it is usually the one with a speed, here eno0:

vnstat --iflist
Available interfaces: eno0 (1000 Mbit) eno1 (1000 Mbit)

2. Read the Numbers

The overview, with the current month and today:

vnstat -i eno0
   eno0 since 2026-11-27

          rx:  816.74 MiB      tx:  4.46 MiB      total:  821.20 MiB

   monthly
                     rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       2026-11    816.74 MiB |    4.46 MiB |  821.20 MiB |   22.22 Mbit/s
     ------------------------+-------------+-------------+---------------
     estimated    668.67 GiB |    3.65 GiB |  672.32 GiB |
  • rx is data received (downloads to the server), tx data sent (uploads, for example seeding), total both.
  • estimated projects the current rate to the end of the period. Right after the installation it is far off: in the example above, one download of 795 MB in the first minutes gives an estimate of 668 GiB for the month.

Other views:

vnstat -i eno0 -m     # months
vnstat -i eno0 -d     # days
vnstat -i eno0 -h     # hours
vnstat -i eno0 -5     # 5-minute steps
vnstat -i eno0 -t     # top days

3. The Speed Right Now

To see the current speed, average it over a few seconds, or watch it live and stop with Ctrl+C:

vnstat -i eno0 -tr 5
vnstat -i eno0 -l

4. Use the Numbers in a Script

--oneline prints everything in one line, separated by ;, for example to check your usage from a script or to send it to yourself:

vnstat -i eno0 --oneline

The fields are: version, card, today's date, today rx, tx, total, average rate, the month, month rx, tx, total, average rate, and the totals since the start.

vnStat and Your Traffic in the Client Area

  • vnStat counts what your server sees. The traffic shown for your service in the Client Area is the official number for your plan; small differences are normal.
  • vnStat starts a new month on the 1st. If your plan counts from another day, open /etc/vnstat.conf, find the line ;MonthRotate 1, remove the ; at its start and set the day, for example MonthRotate 15. Then restart vnStat with systemctl restart vnstat.
  • For a check of the network itself, see Check the Network of Your Linux Server: ping, mtr and iperf3.

Related Guides

View all Linux guides

Was this answer helpful? 0 Users Found This Useful (0 Votes)