How to Fix bash: iperf3: command not found in Minimal Linux

Network engineers, cloud architects, and system administrators rely on iperf3 as the industry-standard benchmark tool for measuring maximum achievable network bandwidth across IP networks. By establishing client-server test streams, iperf3 calculates precise TCP throughput, UDP packet loss, jitter, and buffer limits across 1 GbE, 10 GbE, and 100 GbE connections. However, when connecting to newly deployed minimal cloud servers, lightweight VPS droplets, or Docker containers, executing the command frequently yields the error: bash: iperf3: command not found.

Why Is iperf3 Missing on Minimal Linux Systems?

The iperf3 utility is an optional third-party benchmarking tool that is excluded from default operating system baselines. Common causes include:

  • Omission from Minimal OS Cloud Images: Standard distribution images (such as Ubuntu Minimal, Debian-slim, or Alpine Linux) exclude performance benchmarking tools to minimize attack surfaces and disk footprints.
  • Confusion Between iperf (Version 2) and iperf3 (Version 3): Legacy iperf and modern iperf3 are separate packages with incompatible network protocols; installing iperf does not provide the iperf3 command.
  • EPEL Repository Prerequisite on Enterprise Linux: Red Hat Enterprise Linux, CentOS, AlmaLinux, and Rocky Linux require the EPEL repository to access iperf3.
  • PATH Environment Omission: The binary is placed inside /usr/bin/iperf3 or /usr/local/bin/iperf3, which may be excluded in restricted shell profiles.

Method 1: Install iperf3 on Ubuntu, Debian, and Linux Mint

On Debian-based distributions, iperf3 is available in primary APT software repositories.

  1. Update your local package index:
    sudo apt update
  2. Install the iperf3 package:
    sudo apt install -y iperf3
  3. Verify successful installation by checking the version:
    iperf3 -v
  4. To start an iperf3 server listening on default port 5201:
    iperf3 -s
  5. To run a bandwidth test against a remote server as a client:
    iperf3 -c <server_ip_address>

Method 2: Install iperf3 on RHEL, CentOS, Rocky Linux, and AlmaLinux

On Red Hat enterprise distributions, enable the EPEL repository before installing.

  1. Install and enable the EPEL (Extra Packages for Enterprise Linux) repository:
    sudo dnf install -y epel-release
    (On legacy CentOS 7, execute sudo yum install -y epel-release).
  2. Install iperf3 via DNF:
    sudo dnf install -y iperf3
  3. Verify that the binary operates cleanly:
    iperf3 -h

Method 3: Install iperf3 on Alpine Linux and Docker Containers

Alpine Linux maintains iperf3 in its primary repository branch.

  1. Update Alpine package repositories:
    apk update
  2. Install iperf3:
    apk add iperf3
  3. Test running the client:
    which iperf3

Method 4: Run iperf3 via Standalone Docker Container

If you cannot install packages directly on the host operating system, execute iperf3 inside a temporary Docker container.

  1. To run an ephemeral iperf3 server on port 5201:
    docker run --rm -it --network=host networkstatic/iperf3 -s
  2. To run an ephemeral iperf3 client test:
    docker run --rm -it --network=host networkstatic/iperf3 -c <server_ip>
  3. The --network=host flag ensures the container directly benchmarks host physical network adapters without virtual NAT overhead.

Method 5: Verify Binary Path in Shell Environment

Ensure your active shell PATH includes the standard binary directories.

  1. Check if the binary exists on the disk:
    whereis iperf3
  2. If the binary is located at /usr/local/bin/iperf3, check your PATH:
    echo $PATH
  3. If necessary, append the folder to your PATH:
    export PATH=$PATH:/usr/local/bin:/usr/bin
  4. Add the export command to ~/.bashrc to persist the setting across terminal sessions.

Get the best tech tips delivered straight to your inbox.

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