> ## Documentation Index
> Fetch the complete documentation index at: https://help.freakhosting.com/llms.txt
> Use this file to discover all available pages before exploring further.

# How to Check Bandwidth Usage on Linux (vnStat and iftop)

> Check bandwidth usage on Linux: vnstat -d and vnstat -m show daily and monthly traffic, sudo iftop shows live connections, ip -s link shows counters.

To check bandwidth usage on Linux, install vnStat and run `vnstat -d` for daily or `vnstat -m` for monthly traffic per interface; it records in the background once installed. For what is using bandwidth right now, run `sudo iftop -i eth0`, which lists the busiest connections. `ip -s link show eth0` shows total bytes since boot without installing anything.

| Difficulty | Time | Works on | Needs |
| - | - | - | - |
| Beginner | 10 minutes | Ubuntu 22.04/24.04, Debian 12/13, AlmaLinux/Rocky 9/10 | sudo access; EPEL on AlmaLinux/Rocky |

## Before you start

* **Bandwidth** is how fast data moves (Mbit/s). **Traffic** is how much data moved in total (GB or TB). Received data is **rx** (inbound), sent data is **tx** (outbound).
* On a VPS, the panel also shows monthly traffic for your server: see [VPS traffic and bandwidth](https://help.freakhosting.com/portals/vps-panel/understanding-vps-traffic-and-bandwidth.md). The numbers inside the server can differ slightly from the panel, because they're measured at a different point.
* Find your interface name with `ip -br link` (for example `eth0`, `ens3`). Commands use `sudo`; as root, leave it out.

## Which tool should I use?

| Question | Tool |
| - | - |
| How much traffic per day or month? | `vnstat` |
| Which IP or connection is using bandwidth now? | `iftop` |
| What's the current speed in and out? | `nload` or `vnstat -l` |
| Total since boot, no install | `ip -s link` |

## How to see daily and monthly traffic with vnStat

**1. Install vnStat**

> [tab] Ubuntu / Debian
>
> ```bash theme={null}
> sudo apt update
> sudo apt install vnstat
> ```
>
> The `vnstat` service is enabled and started during installation.

> [tab] AlmaLinux / Rocky
>
> vnStat is in the EPEL repository:
>
> ```bash theme={null}
> sudo dnf install epel-release
> sudo dnf install vnstat
> sudo systemctl enable --now vnstat
> ```

**2. Wait for the first data**

The background service (`vnstatd`) adds every interface it finds and saves data every few minutes. Right after installing you'll see "No data" until the first save.

```bash theme={null}
systemctl status vnstat
```

**3. Show the traffic**

```bash theme={null}
vnstat              # summary: today, this month
vnstat -d           # per day (last 30 days)
vnstat -m           # per month (last 12 months)
vnstat -h           # per hour
vnstat -i eth0 -m   # one interface only
```

```text theme={null}
 eth0  /  monthly

        month        rx      |     tx      |    total    |   avg. rate
     ------------------------+-------------+-------------+---------------
       2026-10     312.45 GiB |   1.08 TiB |    1.39 TiB |    4.47 Mbit/s
       2026-11      21.30 GiB |  80.12 GiB |  101.42 GiB |    2.21 Mbit/s
     ------------------------+-------------+-------------+---------------
     estimated     166.02 GiB | 624.40 GiB |  790.42 GiB |
```

vnStat only knows about traffic from the moment it was installed. Use `vnstat -l` for a live view of the current rate, and `vnstat -t` for the top traffic days.

## How to see which connections use bandwidth with iftop

> [tab] Ubuntu / Debian
>
> ```bash theme={null}
> sudo apt install iftop
> ```

> [tab] AlmaLinux / Rocky
>
> ```bash theme={null}
> sudo dnf install epel-release
> sudo dnf install iftop
> ```

```bash theme={null}
sudo iftop -i eth0 -n -P
```

`-n` shows IP addresses instead of names (faster), `-P` shows ports. Each line is a connection between your server (`=>` sent, `<=` received) and a remote address, with the average rate over 2, 10 and 40 seconds. Press **q** to quit.

For a one-off text report, for example to paste into a ticket:

```bash theme={null}
sudo iftop -i eth0 -n -P -t -s 10
```

This prints the top connections after 10 seconds and exits.

To find which program owns a busy connection, take the port from iftop and look it up:

```bash theme={null}
sudo ss -tunp | grep ':443'
```

## How to see the current speed with nload

```bash theme={null}
sudo apt install nload        # Ubuntu / Debian
sudo dnf install nload        # AlmaLinux / Rocky, needs EPEL
nload eth0
```

nload shows incoming and outgoing speed as two graphs with current, average, minimum, maximum and total. Press **q** to quit.

## How to check traffic without installing anything

```bash theme={null}
ip -s -h link show eth0
```

```text theme={null}
    RX:  bytes packets errors dropped  missed   mcast
          252M   57.0k      0       6       0       0
    TX:  bytes packets errors dropped carrier collsns
         37.5M   54.4k      0       0       0       0
```

These counters start at zero when the server boots. Rising **errors** or **dropped** values can point to a network problem.

> [!WARNING]
>
> Sudden, large outbound traffic you can't explain may mean a compromised server sending spam or attack traffic. Check with `iftop` which addresses it goes to, and see [what to do if your Linux server is hacked](https://help.freakhosting.com/portals/other/what-to-do-if-your-linux-server-is-hacked.md).

## Frequently asked questions

### Why does vnStat show "No data"?

The service hasn't saved its first sample yet, or it isn't running. Wait a few minutes and check `systemctl status vnstat`. If the interface is missing, add it with `sudo vnstat -i eth0 --add`.

### Why are vnStat's numbers different from my VPS panel?

They're measured in different places and may use different units (vnStat uses GiB/TiB by default, base 1024) and different month boundaries. Use the panel for your plan's allowance.

### How do I see bandwidth per process?

`iftop` works per connection, not per program. Match its ports to programs with `ss -tunp`. Tools such as `nethogs` show traffic per process directly.

### Does vnStat slow down the server?

No noticeable amount. It reads the kernel's interface counters at intervals rather than capturing packets.

## Related guides

> [card] [VPS and dedicated server guides](https://help.freakhosting.com/portals/other/vps-and-dedicated-server-guides.md)
>
> Every guide in this section.

> [card] [VPS traffic and bandwidth](https://help.freakhosting.com/portals/vps-panel/understanding-vps-traffic-and-bandwidth.md)
>
> Traffic history in the panel.

> [card] [Test speed with iperf3](https://help.freakhosting.com/portals/other/how-to-test-network-speed-with-iperf3.md)
>
> Measure maximum throughput.

> [card] [Monitor resources with htop](https://help.freakhosting.com/portals/other/how-to-monitor-server-resources-with-htop.md)
>
> CPU, memory and processes.

> [card] [Set up Netdata](https://help.freakhosting.com/portals/other/how-to-set-up-netdata-monitoring.md)
>
> Dashboards for network and more.

***

> [!NOTE]
>
> **Checked against the official [vnStat manual](https://humdi.net/vnstat/man/vnstat.html) and [usage guide](https://github.com/vergoh/vnstat/wiki/Usage-%23-Command-line-basics)** and the Fedora/EPEL package listings for [vnStat](https://packages.fedoraproject.org/pkgs/vnstat/vnstat/), [iftop](https://packages.fedoraproject.org/pkgs/iftop/iftop/) and [nload](https://packages.fedoraproject.org/pkgs/nload/nload/) on 4 November 2026; commands tested on Ubuntu 24.04 LTS (vnStat 2.12, iftop 1.0pre4, nload 0.7.4). Commands can differ on other distributions or releases.

> [!NOTE]
>
> ### Need Extra Help?
>
> If you encounter any issues, our support team is ready to assist:
>
> * **Live Chat:** Quick assistance via our website.
> * **Support Ticket:** [Open a Ticket](https://freakhosting.com/clientarea/submitticket.php)
> * **Discord:** [Join our Community](https://discord.gg/freakhosting)
> * **Email:** [support@freakhosting.com](mailto:support@freakhosting.com)

> [!TIP]
>
> ### Save on Your Hosting
>
> Ready to upgrade your hosting? Use code **KB20** at checkout for **20% off** your first order!

***

**Last Updated:** November 2026


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.