Speedtest.net is a service to test the speed of your Internet connection. It uses a nearby speedtest.net server to download a file on the computer and calculate Internet speed. The tool speedtest-cli allows you to access this service from the Linux command line as well.

Installation

To install speedtest-cli on Ubuntu and Debian, run:

sudo apt install speedtest-cli

Note: Use apt-get instead of apt on older Ubuntu versions (version 14.04 and below).

To install speedtest-cli on CentOS, Fedora, and other Red Hat based distributions, we have to manually download speedtest-cli, as well as its dependency, python:

yum install python3
wget -O speedtest.cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py

Then give execute permissions to the downloaded file:

chmod +x speedtest-cli

Using Speedtest-cli

To run speedtest-cli with nearest speedtest.net server, simply run:

speedtest-cli

To run speedtest with a particular server, specify the speedtest.net server number using the --server flag:

speedtest-cli --server 17277

Speedtest.net also allows users to host a ‘mini’ server locally. To test speed using such a mini server, run:

speedtest-cli --mini <URL>

Here, <URL> can be the IP Address or domain name based URL of the Mini server. Check out the Speedtest documentation on Mini Servers for more information.


🍻 Cheers!