Press ESC to close

How to make an internet speed test on a Raspberry Pi

Hello!

In today’s world, where high-speed Internet access is crucial, monitoring and optimizing network speeds is becoming increasingly important. In this tutorial, we’ll take a look at how to use the speedtest-cli tool on the popular Raspberry Pi to conduct an effective test of Internet access speed.

Learn how to quickly and easily install and configure this tool to get valuable information on the performance of your local network. Discover how to track download and upload speeds, which can be useful for monitoring your Internet connection.

What is speedtest-cli?

Speedtest-cli is a command line interface (CLI) tool for conducting Internet speed tests without using a browser GUI. It was created by Matt Martz, who is a software developer and an active member of the open source community. It is a simple, easy-to-use application that allows users to quickly and conveniently check the download speed, upload speed and latency of their Internet connection.

The speedtest-cli tool uses Speedtest.net, a popular platform for measuring Internet speeds. During the test, the tool establishes a connection to the nearest Speedtest.net server, uploads and downloads data, and then presents results such as download speed (download), upload speed (upload) and latency (ping).

Preparation

Before we start checking the speed of the Internet, it is a good idea to properly prepare our device – I will use Raspberry Pi version 4B for the tutorial. We will issue commands to our device via SSH.

  • Currently, you can already use the commercially available Raspberry Pi 5, however, its availability is very low. I recommend using rpilocator.com to see where you can currently get a reasonably priced device;
  • For Microsoft Windows operating system I recommend PuTTY, while for Apple macOS operating systems I recommend Termius.

Step 1 – Update package list and upload updates

  • Launch PuTTY (Windows OS) or Termius (macOS), then connect to your device,
  • Enter the following command to update the package list and install available updates:
sudo apt-get update && sudo apt-get upgrade -y

Step 2 – Install the speedtest-cli package

  • Enter the following command to update the speed measurement package:
sudo apt-get install speedtest-cli -y
  • Wait a short while until the package installation process is complete. Once successfully installed, you can move on to the next command you will execute on the command line.

How to measure internet speed with speedtest-cli on Raspberry Pi

  • To check your internet speed, use the following command to launch the application:
speedtest-cli
  • After entering the above command, you will receive a report of the measurement of the speed of your Internet connection in a short time. Below you will find an example of the measurement result:
Retrieving speedtest.net configuration...
Testing from YOUR ISP NAME (XXX.XXX.XXX.XXX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by TOM MEDIA (Dabrowa Górnicza) [248.38 km]: 9.454 ms
Testing download speed................................................................................
Download: 527.30 Mbit/s
Testing upload speed......................................................................................................
Upload: 165.59 Mbit/s

In the above result, you can see the results of internet speed, taking into account both downloading and uploading data. If you prefer to display the output in bytes instead of bits, use the following command:

speedtest-cli --bytes
  • After entering the above command, you will receive a report of the measurement of the speed of your Internet connection in a short time. Below you will find an example of the measurement result:
Retrieving speedtest.net configuration...
Testing from YOUR ISP NAME (XXX.XXX.XXX.XXX)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by KSU Provector (Gorzow Wielkopolski) [393.08 km]: 10.081 ms
Testing download speed................................................................................
Download: 66.01 Mbyte/s
Testing upload speed......................................................................................................
Upload: 20.38 Mbyte/s

Read also:

Filip Chochół

Filip Chochol runs two blogs: personal “chochol.io” and together with his girlfriend “Warsaw Travelers” about travel. He specializes in IT resource management and technical support, and has been active in the field of cyber security awareness for almost two years. A proponent of open-source technologies, he previously worked in the film and television industry in the camera division (2013-2021). After hours, he develops interests in smart homes and networking.

Comments (1)

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.