How to Test Server Network Speed with Speedtest CLI on AlmaLinux 9 and Rocky Linux 9
Measure your server's download and upload speed from the shell with the official Speedtest CLI on AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9.
This guide shows how to measure the download speed, upload speed and latency of a server from the command line on AlmaLinux 9, Rocky Linux 9 and CentOS Stream 9. At the end you will have the official Speedtest CLI installed from its package repository, know how to choose a test server, and be able to produce JSON output for scripts and monitoring.
CentOS Linux 5, 6, 7 and 8 are all end-of-life (CentOS Linux 7 was the last, on 30 June 2024); AlmaLinux and Rocky Linux are the RHEL-compatible replacements. The tool has changed too. Older tutorials download a Python script called speedtest.py from the sivel/speedtest-cli project on GitHub. That repository was archived by its owner on 30 April 2026 and is read-only, so it will not receive fixes. Ookla, the company behind speedtest.net, publishes its own native client simply called speedtest, and that is what this guide installs.
Requirements
- A server running AlmaLinux 9, Rocky Linux 9 or CentOS Stream 9.
- A user with
sudorights. - Outbound internet access. A test transfers a lot of data in a few seconds, so keep that in mind on a plan with a small traffic allowance.
Remove the old Python client if it is installed
The Python client also installs a command named speedtest, and Ookla's instructions warn that unofficial packages conflict with the official one. Check for it and remove it:
rpm -qa | grep -i speedtest
sudo dnf remove speedtest-cliIf you copied speedtest.py into your home directory or /usr/local/bin by hand, delete that file as well.
Install the official Speedtest CLI
Ookla distributes RPM packages through a packagecloud repository. Its setup script detects the distribution, writes the repository definition to /etc/yum.repos.d/ookla_speedtest-cli.repo and imports the signing key. If you prefer to read a script before running it as root, download it first:
curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.rpm.sh -o script.rpm.sh
less script.rpm.sh
sudo bash script.rpm.shThen install the package:
sudo dnf install speedtestConfirm that the binary is the Ookla client:
speedtest --versionThe output starts with Speedtest by Ookla followed by the version number (1.2.0 at the time of writing).
Install without adding a repository
Ookla also publishes the client as a standalone archive for x86_64, aarch64 and 32-bit ARM. This is handy for a one-off test on a machine you do not want to change:
curl -fLO https://install.speedtest.net/app/cli/ookla-speedtest-1.2.0-linux-x86_64.tgz
tar -xzf ookla-speedtest-1.2.0-linux-x86_64.tgz speedtest
./speedtestA binary installed this way is not updated by dnf; check the Speedtest CLI page for the current file name before you download.
Run a speed test
Run the command without arguments:
speedtestOn the first run you are asked to accept Ookla's licence and, depending on your location, its privacy notice. The acceptance is stored in your home directory, so the question is asked once per user. The client then picks a nearby server and prints the idle latency, download speed, upload speed, packet loss and a result URL you can share.
In a script or cron job nobody is there to answer the prompt. Accept the terms on the command line instead:
speedtest --accept-license --accept-gdprChoose a test server
Automatic selection picks a server that is close in network terms, which shows what the connection can do under good conditions. To test towards a particular city or carrier, list the nearby servers and pass the ID of the one you want:
speedtest --servers
speedtest --server-id 12345Replace 12345 with an ID from the first column of the list. When you compare results over time, always use the same server; otherwise you are measuring the difference between servers, not a change in your own connection.
Get machine-readable output
For logging and dashboards, ask for structured output. The client supports CSV, JSON and JSONL; results are reported in bytes per second in the bandwidth fields, so multiply by 8 to get bits per second.
speedtest --accept-license --accept-gdpr --format jsonA simple way to keep a history is a cron entry that appends one line per run to a file. Open your crontab with crontab -e and add:
15 3 * * * /usr/bin/speedtest --accept-license --accept-gdpr --format jsonl >> $HOME/speedtest.jsonl 2>/dev/nullRun speedtest --help for the full option list, including how to bind the test to a specific network interface or source address on a server with several.
Read the results sensibly
- A result describes the path between your server and one test server at one moment. Run several tests against two or three servers before you draw conclusions.
- Many VPS plans share an uplink or apply a port speed limit. A result well below the advertised port speed at busy hours and close to it at night points to contention, not to a fault in your configuration.
- CPU matters on small instances: at multi-gigabit speeds a single slow core can be the bottleneck. Watch
topin a second session while the test runs. - To measure throughput between two machines you control, for example over a private network, use
iperf3instead (sudo dnf install iperf3). It needs one side to run as a server, but it takes the public test infrastructure out of the picture.
Frequently asked questions
Can I still use the Python speedtest-cli?
EPEL 9 still carries it as the speedtest-cli package (version 2.1.3), installable with sudo dnf install epel-release followed by sudo dnf install speedtest-cli. Because the upstream project was archived in April 2026, treat it as legacy software: it works only as long as the speedtest.net interfaces it relies on stay unchanged. Do not install it alongside the Ookla package.
Is the Speedtest CLI open source?
No. The Ookla client is a closed-source binary released under Ookla's own licence, which you accept on first run and which restricts commercial use. If you need a fully open tool, use iperf3 between your own hosts.
Why do the CLI and the speedtest.net website give different numbers?
They are run from different machines. The website measures the connection of the computer your browser runs on; the CLI measures the server it is installed on. Even from the same machine, a different test server or a busy moment on the network changes the outcome.
Does the same package work on AlmaLinux 10 or Rocky Linux 10?
The standalone archive is a self-contained binary and is the quickest route on a release the repository script does not recognise. If the script reports an unsupported distribution, it tells you how to override detection with the os= and dist= variables.