How to perform Internet speed test on Raspberry Pi - Linux Tutorials - Learn Linux Configuration

Performing an internet speed test from your Raspberry Pi is a good way to confirm that you are getting the expected download and upload speeds to your device. If you suspect that websites or other external connections are loading slower than they should be, performing a speed test is the first troubleshooting step to take, and allows us to see if our suspicions are correct. After the speed test, we can pinpoint the source of slow downs as either the connection to a router or other local device, or perhaps the ISP itself is the problem. In this tutorial, you will learn how to perform an internet speed test on any Raspberry Pi model, whether you are using an ethernet or Wi-Fi connection. This will include a GUI method as well as a command line option, in case, for example, you only have an SSH connection to your Raspberry Pi.

In this tutorial you will learn:

  • How to download speedtest command line tool
  • How to perform an internet speed test from command line
  • How to perform an internet speed test from GUI
How to perform Internet speed test on Raspberry Pi Software Requirements and Linux Command Line Conventions Category Requirements, Conventions or Software Version Used System Raspberry Pi Software curl Other Privileged access to your Linux system as root or via the sudo command. Conventions # – requires given linux commands to be executed with root privileges either directly as a root user or by use of sudo command $ – requires given linux commands to be executed as a regular non-privileged user

Perform Internet speed test on Raspberry Pi step by step instructions

For those with command line only access, or in case you just prefer using the command line instead of GUI, follow the steps below to perform an internet speed test.
DID YOU KNOW?There are many websites online that allow you to test the speed of your internet connection. Perhaps the most popular one is SpeedTest.net. This is the one we will be using to perform our speed test, as they have many server mirrors and support both a command line and GUI functionality for testing. You can use some other site if you choose, or simply attempt to download a large file (like a Linux ISO file download) and measure your speed in a more manual way.
  1. Let’s start by opening a command line terminal and updating the system’s cache of package information. Then, install the curl command on your system in case you do not already have it.
    $ sudo apt update
    $ sudo apt install curl
    
  2. Next, download the Bash script provided on the SpeedTest.net download page. This will add a new repository to our system’s package manager, allowing us to easily install the speed test tool.
    $ curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
    
  3. Now we can install the speedtest tool via apt package manager:
    $ sudo apt install speedtest
    
  4. To get started with performing the speed test, we will use the speedtest-cli command. Use the command with no further options and a speed test will be performed:
    $ speedtest
    

    Performing a speed test on Raspberry Pi via the command line

  5. To see your speed in megabytes instead of the default megabits, you can append the -u MB/s option to your command, like this:
    $ speedtest -u MB/s
    
    Showing our speed test results in megabytes instead of megabits
  6. If you need to share your speed test results, such as with an internet service provider to prove to them that you are not getting the speeds you are paying for, then you can use the link from your speed test output which should be in your terminal: The command generates a nifty screenshot that makes it a breeze to share out speed test results with someone

Internet Speed Test – GUI Method

The GUI method works pretty much the same, except the test is performed in your browser instead of the command line terminal. Head over to SpeedTest.net and click on the big button that says “GO.” The nearest server will automatically be selected for you, and then a ping, download, and upload test will be performed. The results will show on your screen when the test is completed.

Using the GUI method to perform speed test online

Closing Thoughts

In this tutorial, we saw how to perform an internet speed test on a Raspberry Pi system. This can be done from either command line or GUI, and the test itself is carried out with SpeedTest.net. Note that there are other sites available for speed tests, including Google, but the results should be about the same between all of them. Performing such a test helps us verify whether we are getting the expected download and upload speeds. If not, check your local network configuration or contact the internet service provider for further troubleshooting.

This is a companion discussion topic for the original entry at https://linuxconfig.org/how-to-perform-internet-speed-test-on-raspberry-pi

“sudo apt install speedtest” did not work for me:

asdasd@octoprint:~ $ sudo apt install speedtest
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
E: Unable to locate package speedtest

I had to modify to:
“sudo apt install speedtest-cli”
and it worked:

asdasd@octoprint:~ $ sudo apt install speedtest-cli
Reading package lists… Done
Building dependency tree… Done
Reading state information… Done
The following NEW packages will be installed:
speedtest-cli
0 upgraded, 1 newly installed, 0 to remove and 154 not upgraded.
Need to get 24.6 kB of archives.
After this operation, 106 kB of additional disk space will be used.
Get:1 http ://quantum-mirror.hu/mirrors/pub/raspbian/raspbian bullseye/main armhf speedtest-cli all 2.1.3-2 [24.6 kB]
Fetched 24.6 kB in 0s (55.4 kB/s)
Selecting previously unselected package speedtest-cli.
(Reading database … 51496 files and directories currently installed.)
Preparing to unpack …/speedtest-cli_2.1.3-2_all.deb …
Unpacking speedtest-cli (2.1.3-2) …
Setting up speedtest-cli (2.1.3-2) …
Processing triggers for man-db (2.9.4-2) …