Linux Tutorials

speedtest-cli – Internet Speed Test In Linux Terminal

internet speed test in terminal

I doubt there is a better alternative to Ookla’s speedtest when it comes to testing our internet speed. Once in a while, we all like to test our internet speed by visiting their website. Wouldn’t it be a lot cooler if we could test our internet speeds by using speedtest.net without having to visit their website right from the terminal?   So here we have speedtest-cli the command line utility for testing your internet speeds with speedtest.net.

How to install Speedtest CLI in Linux?

​The installation is easier than you expect. Since it is already in the official repositories, you can install it by simply typing the following command in your terminal.

sudo apt-get install speedtest-cli 
install speedtest-cli in linux

​Since the tool has been written in python and you can also install it via pip.

pip install speedtest-cli 
install speedtest-cli using pip in ubuntu

How to test Internet speed right from Terminal?

​Just fire up a terminal and type speedtest-cli and hit enter.

test internet speed from terminal

​You can also make some changes, like in the above test the values are in bits. Now you might want to read the values in bytes. To do that simply add a –bytes trailing your command.

speedtest net from linux terminal

More useful commands

Speedtest-cli offers a host of options and customization and you can check them out by simply typing in – speedtest-cli -h ​, For example, to get a list of all speedtest servers in ascending order of their distance from you. Just type in the following command –

speedtest-cli --list 

​You see those numbers to the extreme right? You can choose to run a test from that particular server simply by supplying its id using the following command –

speedtest-cli --server 12838   

Conclusion

We saw this amazing tool called speedtest-cli that can be used to test our internet speed from the terminal. It has a good amount of features and is made in python. So apart from Debian/Ubuntu, t is also available via pip as a python package.

Have you used this before? Do you like using it? Let us know in the comments section below.

Our sponsor - Deploy your server within 3 minutes


8 comments

No one December 5, 2019 at 9:46 pm

helpful post. thank you.

Reply
ITOMDave January 3, 2020 at 11:16 pm

Hi Sohail,
Interesting article.
It might be worth pointing out though that the speedtest-cli you are discussing is not the same as the official OOKLA speedtest cli that can be downloaded from : https://www.speedtest.net/apps/cli

This is a command line binary so doesn’t need Python etc to be installed. Great instructions on their web site too.

Reply
Spongman January 5, 2020 at 12:47 pm

speedtest-cli is broken (it reports wildy innacurate results) and is not fit for purpose, and the developer has acknowledged this and flatly refused to provide any fixes. avoid at all costs.

Reply
Olli January 20, 2020 at 1:30 am

Don’t use it. Shows wrong upload speed (tested on two different devices). Does anyone know an alternative for console speedtest?

Reply
Rob February 4, 2020 at 8:50 pm

What repository do we need to add to apt-get this? Not found when I apt-get. Is there a download?

Reply
Hal June 14, 2020 at 7:09 am

Interesting presentation I tried ITOMDave info above and install did not go well upon going to the url he mentioned. I am on Linux Mint 19.3. No harm re: that install I don’t have any of the speedtest-cli commands but can type in term “speedtest” and it provides a read out in term. of all the info I need.

Thanks for sharing

Reply
som February 2, 2021 at 2:53 am

very helpful post. thank you.

Reply
som February 2, 2021 at 2:55 am

thanks a lot my dear.

Reply

Leave a Comment

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More