Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

iTechGuides is reader-supported. When you buy through links on our site, we may earn an affiliate commission. As an Amazon Associate I earn from qualifying purchases. Learn more

vnStat gives you lightweight, per-interface bandwidth history on a Linux server without capturing packets. Install it, start vnstatd, wait for the first collection cycle, then use vnstat to inspect five-minute, hourly, daily, monthly, yearly, live, JSON, or XML views. The key operational detail is that vnstatd collects and stores counters while vnstat reads the database; a query can therefore lag the kernel’s current counter until the daemon saves its next update.

What vnStat measures—and what it does not

vnStat is a console-based network traffic monitor for aggregate traffic on selected network interfaces. It reads counters exposed by Linux through the proc or sys filesystems, then records those counters in a local database. Because it reads interface totals instead of inspecting individual packets, it normally does not need root privileges for queries on systems where the counters and database are readable.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

This design makes vnStat useful for questions such as “How much traffic did this server receive yesterday?” or “How much did the public interface transfer this month?” It is not a packet sniffer, connection tracker, intrusion detector, or application-level accounting system. It cannot tell you which HTTP request, process, user, or remote host consumed a particular number of bytes. For those questions you need packet or flow analysis, process instrumentation, or a centralized monitoring platform.

Component Role Data it uses
vnstatd Background collector; reads interface counters, caches them, and writes updates Linux proc/sys interface counters
vnstat Command-line viewer and exporter Historical data already stored in the vnStat database
vnStat database Persistent operational state containing interface history Periodic samples saved by vnstatd

The daemon normally sleeps between updates. vnStat is therefore a historical accounting tool with periodic refreshes, not a continuously updating packet-level flow analyzer.

#1 Best Overall
Sale
Compressed Air Duster,130000RPM Super Power Cordless Air Duster,Rechargeable Brushless Blower,3 Gear Adjustable Blower with LED Light,Dust Remover for Computer/House/Outdoor/Car
  • Powerful Turbo Fan:CAGIWIRU Electric Air Duster have reached speed up to 130000RPM,Can efficient remove dust and debris.With LED light and Three Adjustable Speed to meet with different cleaning tasks.
  • With Attached USB C Fasting Charging cable.Charing 3 hours,Enjoy up to 240 minutes of use on the lowest setting, For third speed can use for 25mins.with four charging options to meet with your needs.
  • Wide Application:Upgraded attached 5 different nozzles,making it suitable for a variety of scenes, such as car,pet, pc, keyboards, and other electronic devices. It also serves for office and home clean duster.
  • Handy Design & Portable:Cordless air duster electric nozzle is Light weight and small size, design and comfortable to hold and space saving, convenient to carry around. You can put it in your room or inside the car without taking up space.
  • Warranty & Support: Our Electric air duster comes with 5 years warranty and 24/7 customer service. During this period, if you have any questions,pls kindly feel free to contact us.

Choose the interface before you collect anything

Bandwidth is tracked per interface, so the first step is identifying the interface that actually carries the traffic you care about. A server can have a loopback device, a physical Ethernet device, a virtual-machine device, a bonded device, a VPN tunnel, or several cloud-provided interfaces.

  1. Run ip link and note the real interface names, such as eth0, ens3, or enp1s0.
  2. Decide whether you need the host’s primary uplink, a private network, a tunnel, or more than one interface.
  3. Use an explicit interface with every production query on a multi-interface host. For example: vnstat -i eth0.

Relying on a default interface is convenient for a one-interface machine, but it can produce misleading dashboards after a migration or network redesign. Keep the interface name in your scripts and configuration documentation.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Install vnStat

Use your distribution package when available

Most Linux distributions package vnStat. This is usually the simplest installation route because the package can provide the daemon unit, configuration file, database-directory permissions, and upgrade handling. Package names, unit names, and whether the service is enabled automatically vary by distribution and release, so follow the current documentation for the operating system you are running.

After installation, confirm that both commands are available:

vnstat --version
vnstatd --version

If a distribution package does not include a service unit, you can still run the daemon using the upstream procedure, but you will need to manage startup and permissions yourself.

Build from source

The upstream build requires a C compiler and make. SQLite development files are required; libgd is optional and is needed only for image output. The documented build sequence is:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #2
EVEO® Screen Cleaner Spray Kit (Streak-Free) TV Screen Cleaner for Smart TV, Lcd, LEd, Oled | Computer Screen Cleaner Spray and Wipe Microfiber Cloth - TV, Monitor, Laptop, iPad, Car - 6.7oz 1 Pack
  • Screen Cleaner is Your Screen’s New Bestfriend! - EVEO is proud to present a screen cleaner that’s perfectly suited for your TV. Meet your new screen cleaner, computer screen cleaner, laptop cleaner, iPad cleaner, Macbook,tv cleaner or any other electronic device. Our screen cleaner spray and wipe along with the included plush microfiber cloth, easily removes dust, fingerprints & other smudges on the screen’s surface. Clean effectively for a streak-free screen
  • Gentle on your Screens - Our screen cleaner spray and wipes is compatible to be used even for the most sensitive LCD, LED, CRT, and OLED screens in proper use. Be at ease knowing that this product is compatible with all the major brands: LG, SONY, Samsung, Sharp, iPad, iPhone, Android screens, Kindle, PC monitors - we’ve got you covered! Can be used as LCD screen cleaner, tv cleaner, smart tv screen cleaner, and more
  • Premium Super Soft Plush Microfiber Cloth - Included in this efficient screen cleaning kit. This screen cleaner spray and wipe has our signature plush microfiber cloth specially designed to comply with screens and monitors and leave them streak-free. Has been shown to effectively absorbs stubborn stains, zero streaks, and no fiber shedding. Always use this together with our screen cleaner for the best results
  • Easy-to-Use Screen Cleaner Kit + microfiber cleaning cloth - The EVEO Screen Cleaning Kit will easily be your new favorite tool when it comes to taking care of the things you love most, quick and easy solution for a streak-free screen. Simply screw on the sprayer gun on the screen cleaner bottle. Spray the cleaning liquid onto the microfiber cloth, then wipe the screen until desired cleanliness & shine is achieved.
  • Quality Screen Care Kit Worth Purchasing - Enjoy a convenient Screen Cleaner anytime, anywhere you need it. Your satisfaction is our top priority. We stand behind the quality of our products and that’s why, you shouldn’t be worrying at all. We manufacture the Best Screen Cleaner. and can be used for laptop cleaning kit, laptop screen cleaner, tv screen cleaner for smart tv. MacBook screen cleaner, monitor cleaner or screen cleaner spray for electronic devices with microfiber cleaning cloth
./configure --prefix=/usr --sysconfdir=/etc && make && make install

Run installation with the privileges required by your operating system. The command places binaries under the selected prefix and the shared configuration under the selected system-configuration directory. If configure reports a missing SQLite development package, install that package through your distribution and rerun configure. Omit libgd only when you do not need image generation.

Start and enable the collector daemon

Installing the command is not enough: useful history appears only after vnstatd has collected and saved interface counters. With a systemd service supplied by the package or upstream installation, the documented commands are:

sudo systemctl enable vnstat
sudo systemctl start vnstat

enable makes the service start during future boots; start starts it now. Check its state before troubleshooting the reports:

systemctl status vnstat

On its first startup, vnstatd should discover and add available interfaces. It can take several minutes before vnstat displays useful values because database entries are not updated continuously. An empty or nearly empty report immediately after installation is therefore expected; it is not proof that the interface is idle or that installation failed.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

If your package names the unit differently, inspect the package’s service files and use that unit name. Do not create a second collector for the same database unless you deliberately understand the resulting write and permission behavior.

Verify the database and run your first queries

Check the default report

Once the first update cycle has completed, run:

vnstat

This displays the configured default interface. On a host with several interfaces, use the interface explicitly:

Rank #3
BladeHawks RGB Gaming Mouse Pad Extra Large Extended 31.5x12 Inch-Black
  • 【Large size】:Measuring 800 x 300 mm/ 31. 5×12 inches, which is wider and taller than others. Large mouse pad can perfectly fit your keyboard and mouse of any size, and there is also ample space for peripherals such as phones, tablets, etc.
  • 【LED backlight mouse pad】:Blade Hawks RGB mouse pad provides 7 static modes and 7 dynamic modes will give you the options you are looking for. Power-off memory function remembers the last lighting mode you selected. The super glow fiber Chroma will give you a colorful gaming setup that you want.
  • 【Anti-slip rubber base】:Made from Natural rubber, this gaming mousepad will firmly grip your desktop, allowing you to enjoy the ultimate precision in the games you are most passionate about. It also comes with a texture that enhances this ability even further.
  • 【Smooth and waterproof surface】: Micro-textured cloth surface, for extremely precise mouse control and a smooth movement. When liquid splashes on the gaming mouse pad, it forms water droplets and slides down. Will not delay your work or gameplay.
  • 【Plug and play】: This mouse and keyboard pad is powered by USB, plug and play, no driver required. One button control light modes. Press one time to change the lighting mode, press twice to change the brightness, press and hold about 3 seconds turn ON/OFF.
vnstat -i eth0

Replace eth0 with the name returned by ip link. If the interface is absent from the database, use vnStat’s documented interface-add operation, then verify that it appears in the database list:

vnstat --add -i eth0
vnstat --dbiflist

Option spelling can differ between major releases, so check vnstat --help when a build rejects an option. Adding an interface starts its history from the point it is added; vnStat cannot reconstruct periods that were never collected.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Use the period that matches the question

Question Typical command What it shows
How much traffic moved today? vnstat -d -i eth0 Daily totals and recent daily rows
What is the current month’s usage? vnstat -m -i eth0 Monthly totals and month-by-month history
How did usage trend by year? vnstat -y -i eth0 Yearly totals
What happened during the last few hours? vnstat -h -i eth0 Hourly breakdown
What happened in the recent five-minute buckets? vnstat -5 -i eth0 Five-minute history where available
What is moving right now? vnstat -l -i eth0 Live-style display based on current counters

The exact layout and unit labels depend on the vnStat version and configuration. The period reports are best for quick SSH checks; they are not a substitute for a packet trace when you need individual connections.

Interpret RX and TX correctly

vnStat reports receive (RX) and transmit (TX) separately. RX is traffic entering the monitored interface; TX is traffic leaving it. For a web server, a large download can appear primarily as TX on the server, while client requests appear as RX. For a backup host, the direction can reverse depending on whether it is sending or receiving the backup data.

Do not add interface totals from both ends of a link unless you intentionally want to count the same transfer twice. Also decide whether your quota or provider reports ingress, egress, or both before comparing a vnStat value with an external allowance.

vnStat can display transfer rates in bytes or bits. The Debian manual documents selecting the rate unit; choose one mode explicitly for scripts and dashboards instead of mixing a human-readable byte view with a bit-rate alert. Keep the unit choice alongside the metric name, for example “TX bytes” or “RX bits per second,” so a later reader cannot mistake one for the other. If your installed release uses different command-line switches for rate or unit selection, consult vnstat --help and the installed manual, then pin that choice in your script.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #4
Sale
Vaydeer Wrist Rest for Keyboard and Mouse, Computer Ergonomic Wrist Support Pad, Soft Memory Foam Arm Cushion for Desk, Palm Hand Office Laptop Typing
  • 【Softer and More Comfortable】Vaydeer wrist rest has unique diamond pattern, which is the combination of softness and aesthetics. The materials of wrist rest are improved into higher quality memory foam and covered with silky smooth lycra. The computer wrist rest makes you as comfortable and cushiony as like rest your wrists on clouds.
  • 【Ergonomic Wrist Saver】The wrist rests for keyboard and mouse comes with a 17.32×3.15×0.83 inch keyboard wrist pad and a 5.94×3.15×0.83 inch mouse wrist support. Based on ergonomic design, the unique concave shape is the perfect fit for your wrist joints. The wrist rest pad fits most computer keyboards and laptops, improve hand and wrist posture, release your wrist and arm stress.
  • 【Non-Slip Rubber Bottom】Featuring an anti-skid silicone base on the bottom, this wrist keyboard support stays firmly in place on your desk, preventing the padding from sliding around, ensuring stable and consistent wrist support during extended computer sessions.
  • 【Better Experience & Pain Relief】Our keyboard arm rest is beneficial to alleviate the soreness caused by direct contact and friction between your arm and a hard desk surface, reducing the risk of wrist fatigue or carpal tunnel. The soft texture of memory foam can evenly distribute the pressure around your wrists and provide good support with just enough give.
  • 【Helpful in Multiple Scenarios】Whether you're working, studying, writing, typing, gaming, this keyboard and mouse rest combo is an essential accessory to add comfort and support to your hands and wrists. It’s also a great gift for men, women, family, friend, coworker, gamer, teacher, etc.

Export data for scripts and dashboards

Human-readable tables are convenient at a terminal, but machine-readable output is safer for automation. vnStat provides JSON and XML output:

vnstat --json -i eth0
vnstat --xml -i eth0

Use the explicit interface in scheduled jobs, parse the structured fields rather than scraping column spacing, and preserve the timestamp and unit metadata with every value. Test your parser against an empty or newly created database, because the first collection period may contain no complete bucket.

For a local diagnostic or migration, vnStat also documents database-listing and database-dump-oriented modes. vnstat --dbiflist is useful for discovering the interfaces currently represented. A dump can help inspect or export stored records, but it is not a replacement for a versioned backup of the database directory.

Account for the daemon’s cache in every automation design. vnstatd may have read a newer kernel counter but not yet written it to disk when your job runs. A small, consistent lag is normal. If a job needs the latest cached value before a planned shutdown or snapshot, the daemon manual documents SIGHUP behavior that writes cached data, rescans the database directory, and reloads configuration. Use your service manager’s supported reload operation when available; otherwise send SIGHUP to the running vnstatd process according to the service’s permission model.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Configure the database and shared behavior

vnstat.conf is shared by vnstat, vnstati, and vnstatd. It can define the database directory, default interface, disk-space checks, update behavior, and other common settings. Read the comments in the configuration file installed by your version before changing a key; names and available settings can vary across releases.

The documented Linux default database directory is /var/lib/vnstat unless you change DatabaseDir. Treat that directory as operational state:

Best Value
Sale
Under Desk Cable Management Tray No Drill, Metal Mesh Cable Management Under Desk with Clamp Mount, 2 Hole Cable Tray with Wire Management and Cord Organizer for Home Office Standing Desk
  • 【No Drill Mounted】Cable management tray can be assembled in as little as 3 minutes or less-simply. Side clips easily clampe the edge of desk, pass through the holes on the sides, and secure excess cables with baskets. Desk cable management supports inward or outward installation to meet your needs in different scenarios, and provides you with great convenience when collecting and organizing wires.
  • 【Rubber Pad Protects Desk】Wire organizer under desk built-in soft rubber pads on the clamp protect your desk from scratches, so you will not damage your furniture or office.
  • 【Sturdy and Beautiful】Cord management under desk is made of high-quality carbon steel and holds about 15 lbs. The wire basket has 2 holes on each side of the tray to enable your cables to pass freely. Cable baskets are suitable for desk thickness use from 0.4" to 2.4".
  • 【Space Saving & Keep Organized】Desk cable management tray holds all your power cords, outlet strips, USB hubs and computer transformers hidden from your feet, and the data cables will not enter the vacuum cleaner to keep your desk clean and tidy. Desk wire organizer is also suitable for use in the kitchen and outdoors.
  • 【Reduce Safety Risks】Cable tray under desk keeps all plugs away from your kids, no more worry about tripping. Using 2 holes wire tray saves extra space, helps you easily cabling and wire protection. The mesh design is not easy to accumulate dust, but avoids safety accidents caused by messy wires.
  • Include it in backups if long-term bandwidth history matters.
  • Preserve ownership and permissions so the daemon can write and the reporting users can read.
  • Record any custom DatabaseDir in your server documentation and monitoring configuration.
  • When migrating a host, copy the interface database files and keep the configured path consistent before starting the new daemon.

The authoritative documentation does not publish a universal retention period or an accuracy percentage. Do not promise that vnStat retains a fixed number of months everywhere or that its totals have a guaranteed error rate. Retention, update cadence, clock behavior, filesystem availability, and distribution packaging all affect what remains available on a particular installation.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Make startup and upgrades predictable

  1. Record the interface names and whether each is physical, virtual, bonded, or tunneled.
  2. Record the vnStat version, the service unit name, and the location of vnstat.conf.
  3. Keep the database directory on persistent storage, not an ephemeral runtime filesystem.
  4. After a reboot or package upgrade, check systemctl status vnstat and run an explicit interface query.
  5. After changing DatabaseDir or another shared setting, reload the daemon using the supported service-manager action and verify that new samples are being written.

A query command can succeed while the collector is stopped because it can still read old rows. Always check the daemon separately when freshness matters.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot the common failures

The report is empty immediately after installation

  • Check that the service is running with systemctl status vnstat.
  • Confirm that the intended interface exists with ip link.
  • Wait through the first update cycle; the installation guide warns that useful output may take several minutes.
  • Run vnstat --dbiflist to see whether the daemon added the interface.

Do not interpret a just-created database as zero traffic for the whole day. It may simply have no completed sample yet.

The wrong interface appears

Use vnstat -i interface-name for every check, add the intended interface if it is missing, and update the configured default only after confirming which device carries the traffic. On virtualized systems, the interface visible inside the guest may not match the provider’s label outside the guest.

History vanished after a migration

Inspect vnstat.conf and verify DatabaseDir. The default is /var/lib/vnstat, but a custom path is common. Confirm that the old interface database files were copied, that the daemon can read and write them, and that the new interface name has not changed. Starting a fresh database under a different path will produce an apparently empty history even when the old files still exist elsewhere.

Values look stale in a script

Remember that vnstat reads saved history while vnstatd periodically writes cached counters. Check the daemon’s update state, allow for the documented save interval, and avoid declaring an outage solely because one query is behind a live kernel counter. For a controlled handoff or snapshot, use the daemon’s documented SIGHUP/reload behavior to flush cached data first.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A script mixes incompatible units

Set the rate-unit mode explicitly and store the selected unit with the exported value. Do not compare bytes per second with bits per second or assume that a display’s abbreviated suffix has the same meaning across releases and locale settings.

Know when vnStat is the wrong tool

Need vnStat fit Why
Per-interface daily or monthly accounting Good fit It stores historical aggregate counters in a local database.
Low-overhead monitoring on one Linux host Good fit It reads proc/sys counters instead of capturing packets.
Which process or connection used the bandwidth? Not a fit Aggregate interface counters do not contain application or flow attribution.
Inspect packet contents or troubleshoot a protocol exchange Not a fit vnStat is explicitly not a packet sniffer.
One dashboard for a large server fleet Limited fit Each host keeps a local database; centralized collection, retention, and alerting require another layer.
Immediate alerting on a live incident Limited fit Periodic sampling and daemon caching introduce delay, and vnStat is primarily historical.

You can still use vnStat alongside packet or flow tools: let vnStat answer “how much crossed this interface over time,” and use a specialized analyzer when the question is “which traffic caused it?”

A repeatable operating procedure

  1. Identify interfaces with ip link.
  2. Install vnStat from the distribution package or build it with the documented configure, make, and install sequence.
  3. Enable and start the systemd service: sudo systemctl enable vnstat followed by sudo systemctl start vnstat.
  4. Confirm the daemon is active and wait for its first update cycle.
  5. Check the database list and add any required interface that was not discovered automatically.
  6. Use explicit-interface period queries for human checks and JSON or XML for automation.
  7. Choose one rate unit, document it, and preserve it in exported metrics.
  8. Back up the configured database directory and verify it after migrations or upgrades.
  9. When numbers appear stale or missing, troubleshoot the daemon, interface, database path, permissions, and update timing in that order.

With those controls in place, vnStat provides dependable local trend data without the resource and privilege overhead of packet capture. Its boundaries remain important: it accounts for interface traffic, while connection-level diagnosis, application attribution, centralized retention, and alerting belong to other monitoring components.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.