While facing slow internet access speed on your systems, the first thing we want to do is check the internet speed in order to troubleshoot slow connectivity issues. Checking internet speed also comes in handy when you have switched to a new internet connection and you want to assure if you are actually getting what the provider is offering. We all know how speedtest.net is the ultimate solution for checking the speed through a web-browser. In this article, however, we will be making use of a command-line tool called speedtest-cli. This tool, written in python, uses the same speedtest.net website for checking bandwidth by uploading and downloading data from and to your system. This tutorial has been tested on Ubuntu 18.04 and Ubuntu 20.04.

Installing speedtest-cli

Open the Ubuntu Terminal by pressing Ctrl+alt+T or through the Dash. Then enter the following command to install python.

Ubuntu 18.04:

$ sudo apt-get install python-pip

Ubuntu 20.04:

$ sudo apt-get install python3-pip

Install Speedtest CLI on Ubuntu 20.04

Once python is successfully installed, use the following command to install the speedtest-cli tool.

Ubuntu 18.04:

$ sudo pip install speedtest-cli

Ubuntu 20.04:

$ sudo pip3 install speedtest-cli

The tool will be installed in your system.

Install Speedtest Tool

Checking Your Internet Speed

Now you can enter the following command to test your internet speed:

$ speedtest-cli

Run internet speed test

Sharing your Internet Speed Test Results

The speedtest-cli also lets you share your internet speed by providing a link on the speedtest.net website through the following command:

$ speedtest-cli --share

Speedtest share image

This command generates a link that you can share and open through your browser to get an image like this:

Speedtest graphic has been generated

Through this simple tool described in this tutorial, you can check and share your internet connection speed by avoiding the graphical interface altogether!

Test your Internet Speed through Ubuntu Command Line
Avatar

Karim Buzdar

About the Author: Karim Buzdar holds a degree in telecommunication engineering and holds several sysadmin certifications. As an IT engineer and technical author, he writes for various web sites. He blogs at LinuxWays.