How to Fix bash iperf3 command not found in Minimal Linux

The iperf3 utility is the industry-standard command-line tool used by network engineers and systems administrators to measure active network throughput, bandwidth limits, jitter, and packet loss across TCP, UDP, and SCTP connections. In testing high-speed data centres, cloud VPC tunnels, and local wireless links, iperf3 provides empirical performance metrics. However, in stripped container baselines, minimal cloud server distributions, and Alpine Linux images, executing the command produces the shell error: bash: iperf3: command not found.

Install iperf3 Across Major Linux Distributions

Because minimal operating system templates omit non-essential diagnostic tools to preserve container image efficiency, you must install the iperf3 binary using your system repository package manager.

Ubuntu, Debian, and Linux Mint

On Debian-derived distributions, install iperf3 via apt:

sudo apt update
sudo apt install -y iperf3

Confirm successful installation by querying binary version details: iperf3 --version.

RHEL, Rocky Linux, AlmaLinux, and CentOS

On Red Hat Enterprise Linux and compatible enterprise systems, install the package using dnf:

sudo dnf install -y iperf3

Alpine Linux and Minimal Containers

On Alpine Linux micro-containers, install the package using apk:

apk update
apk add iperf3

Arch Linux and Manjaro

On Arch-based platforms, synchronise and install using pacman:

sudo pacman -Sy iperf3

Verify Shell PATH Environment Variable

If you compiled iperf3 from source code or installed it inside custom system directories, ensure the binary location is exposed to your active shell session.

  1. Locate the binary on disk:
    which iperf3 || ls -l /usr/local/bin/iperf3 /usr/bin/iperf3
  2. If the binary is located in /usr/local/bin and that path is missing from your environment, append it to your ~/.bashrc:
    export PATH="$PATH:/usr/local/bin"
  3. Reload your shell profile by executing source ~/.bashrc.

Docker Container Buildfile Configuration

If you perform recurring network bandwidth benchmarking across Kubernetes clusters or automated Docker environments, include iperf3 in your Dockerfile:

FROM debian:12-slim
RUN apt-get update && apt-get install -y --no-install-recommends \
    iperf3 \
    iputils-ping \
    iproute2 \
    && rm -rf /var/lib/apt/lists/*
ENTRYPOINT ["iperf3"]

Basic iperf3 Client and Server Usage

After installation, confirm end-to-end throughput benchmarking between two network nodes:

  • On the receiving server node, start the iperf3 server daemon:
    iperf3 -s
  • On the transmitting client machine, initiate a 10-second TCP bandwidth benchmark:
    iperf3 -c 192.168.1.100
  • To test UDP bandwidth at a targeted bit rate:
    iperf3 -c 192.168.1.100 -u -b 100M

Get the best tech tips delivered straight to your inbox.

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