Install Speedtest-cli On a CentOS / RHEL / Fedora Linux To Check Internet Speed

I do not want to use Adobe flash based speed testing site due to security concern on my desktop. How do I install Speedtest-cli on a CentOS Linux or Fedora Linux or Red Hat Enterise Linux (RHEL) for checking the Internet speed?

Tutorial details
DifficultyEasy (rss)
Root privilegesYes
Adobe Flash vulnerabilities are a major security issue for Linux users and use Adobe Flash. But, you can check the Internet speed with Python based CLI tool called Speedtest-cli. In this quick tutorial you will learn how to install speedtest-cli on a CentOS/RHE/Fedora/Scientific Linux desktop server or or laptop computer.


Install Speedtest-cli on a Linux

The speedtest-cli written in Python. So make sure Python installed and working correctly:
python --version
python3 --version
lsb_release -a

How to install speedtest-cli on a Linux

Step 1: Install python

Type the following yum command to install Python on a CentOS/RHEL/Scientific Linux:
$ sudo yum install python
CentOS / RHEL 8 user type the following command to install Python 3 or 2:
$ sudo yum install python3
$ sudo yum install python2

Run the following dnf command to install Python on a Fedora Linux v22+:
$ sudo dnf install python
$ sudo dnf install pytho3

Step 2: Download

Type the following wget command to grab the client:
$ wget -O speedtest-cli
$ chmod +x speedtest-cli

Fig.01: Grab

Fig.01: Grab

Step 3: Check the Internet speed

Simply type the following command:
$ ./speedtest-cli
$ python speedtest-cli
Sample outputs:

Retrieving configuration...
Retrieving server list...
Testing from nixcraft Dutch Holdings BV (5.151.xx.yyy)...
Selecting best server based on latency...
Hosted by SoftLayer Technologies, Inc. (Amsterdam) [6.45 km]: 2.317 ms
Testing download speed........................................
Download: 925.88 Mbit/s
Testing upload speed..................................................
Upload: 105.69 Mbit/s

To see speed values in bytes instead of bits pass the --bytes option:
$ ./speedtest-cli --bytes
To generate and provide a URL to the share results image pass the --share option:
$ ./speedtest-cli --share
Of course, you can combine both the options:
$ ./speedtest-cli --share --bytes
Sample outputs:

Gif.01: in action

Gif.01: in action

How do I specify a server ID to test against?

First, grab a server list, enter:
$ wget
To view a server ID, enter:
$ more speedtest-servers.php
To search a server ID, enter:
$ grep 'city-name' speedtest-servers.php
$ grep 'country-name' speedtest-servers.php
$ grep 'Tampa, FL' speedtest-servers.php

<server url="" lat="27.9709" lon="-82.4646" name="Tampa, FL" country="United States" cc="US" sponsor="Hivelocity Hosting" id="2137"  host="" />
<server url="" lat="27.9709" lon="-82.4646" name="Tampa, FL" country="United States" cc="US" sponsor="Rapid Systems" id="1296"  host="" />

OR just display a server ID:
$ grep 'Tampa, FL' speedtest-servers.php | egrep -o 'id="[0-9]{4}"'
Sample outputs:


Next use the server ID 2137:
$ ./speedtest-cli --server 2137
Sample outputs:

Fig.02: speedtest-cli in action

Fig.02: speedtest-cli in action

Not a fan of

No worries. Try wget, lftp or specilized tool like iperf on a Linux to test the Internet or Intranet speed from the command line.


You learned how to install speedtest-cli command line interface for testing internet bandwidth using on a CentOS/RHEL/Fedora Linux. For more information see this page here.

🐧 Get the latest tutorials on SysAdmin, Linux/Unix, Open Source/DevOps topics:
CategoryList of Unix and Linux commands
File Managementcat
Network Utilitiesdig host ip nmap
Package Managerapk apt
Processes Managementbg chroot disown fg jobs killall kill pidof pstree pwdx time
Searchinggrep whereis which
User Informationgroups id lastcomm last lid/libuser-lid logname members users whoami who w

6 comments… add one

Leave a Reply

Your email address will not be published.

Use HTML <pre>...</pre>, <code>...</code> and <kbd>...</kbd> for code samples.