How to test your connection speed using the terminal with Speedtest

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"

Hello, friends. Today, I will show you a small utility that will allow us to measure our bandwidth. This little trick is very useful for both desktop users and more advanced users. So, in this post, I will show you how to test your connection speed using the terminal with Speedtest.

Speedtest is a platform that allows us to measure the speed of our internet connection. It is well known worldwide because it has several servers located in different places so its measurements, although not perfect, are quite reliable.

To access it, you have to do it via the web and using a browser. However, if we work with servers or we like the terminal, what solution do we have? Well, we have SpeedTest-Cli

The definition of this tool can be found in its Github profile and it’s very simple

Command-line interface for testing internet bandwidth using speedtest.net

So there is no more trick. It is a terminal tool that makes use of the Speedtest infrastructure to measure our bandwidth.

The application on a more technical level is OpenSource released under the Apache license and created in Python. It is developed specifically for Linux, although as it is created in Python we can install it on other systems such as macOS or Windows.

So let’s go for it.

Install Speedtest-cli on Debian / Ubuntu

As we need Python in the first place, we have a way done because most Linux distributions have it by default.

So, let’s install Python PIP on Debian / Ubuntu which is a package manager for Python applications. With it, we will install Speedtest-cli.

Open a terminal or via SSH and update the whole operating system.

sudo apt update
sudo apt upgrade

Next, install PIP.

sudo apt install python3-pip

Once installed, the next step is to upgrade to the latest stable version.

sudo -H pip3 install pip -U
Successfully installed pip-21.3.1

With PIP ready to do battle, we can then install Speedtest-cli.

sudo -H pip install speedtest-cli
Collecting speedtest-cli
  Downloading speedtest_cli-2.1.3-py2.py3-none-any.whl (23 kB)
	 Installing collected packages: speedtest-cli
	 Successfully installed speedtest-cli-2.1.3

Now we can use it on the system.

Test your connection speed using the terminal with Speedtest

Now that we have the program installed, we can first find out what speed we have.

speedtest-cli --version
speedtest-cli 2.1.3
Python 3.8.10 (default, Sep 28 2021, 16:10:42) [GCC 9.3.0]

To get all the information about how to use the tool, just run

speedtest-cli -h

And you will get an output screen similar to this one.

1.- SpeedTest Cli help
1.- SpeedTest Cli help

To do the test just run

speedtest-cli

The script will automatically search for the closest server to where you are and you will get the following results.

2.- Test your connection speed using the terminal
2.- Test your connection speed using the terminal

With the --server option you can specify a server to test on.

Also, with the --exclude option you can exclude servers from the test.

So, using the tool is very easy and quite useful.

Conclusion

SpeedTest is an excellent service but we have to access it via the web but with this tool, we can do it from the terminal on any Linux distribution.

Everything Linux, A.I, IT News, DataOps, Open Source and more delivered right to you.
Subscribe
"The best Linux newsletter on the web"
Angelo
Angelo
I am Angelo. A systems engineer passionate about Linux and all open-source software. Although here I'm just another member of the family.

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest articles

Join us on Facebook