SpeedTest.net is an excellent website that lets you measure internet speed from your Raspberry Pi. It’s useful for checking the performance either for fault finding purposes or to see if you are getting the service promised by your ISP.

Matt Martz has created a Python project called speedtest-cli which allows you to do a basic upload/download measurement using SpeedNet’s infrastructure. It works fine on the Pi and is really easy to try out on the command line.

Installation

Downloading the utility is easy if you clone the projects git repository :

git clone https://github.com/sivel/speedtest-cli.git

Running SpeedTest with Python

To run SpeedTest on the command line you need to navigate to the directory :

cd speedtest-cli

and then run the Python script using Python 3 :

python3 speedtest.py

The script will run and you should see something like this :

Share Internet Speed Results

If you add –share to the command like this :

python speedtest_cli.py --share

it will create a link to an online image showing your results which you can share with your friends/family/enemies.

Here’s my result using WiFi on a Pi 3 :

and with Ethernet :

The improved Ethernet bandwidth of the Pi 3 B+ gives a massive difference over previous models.

Installing using Apt

It is possible to install SpeedTest using Apt. This makes it slightly easier to run from the terminal but it may not be the latest version.

You can install using:

sudo update

sudo apt install speedtest-cli

Once installed you can run it using:

speedtest

The share option can be used as shown above for the Python version:

speedtest --share

Browser-based Internet Speed Measurement

If you haven’t ever visited SpeedTest.net give it a try on your PC, Mac or laptop. Be sure to hit the oval “Begin Test” button in the centre of the page map rather than other buttons which may be adverts.