Howtodojo logo
  • Home 
  • About 
  • Certifications 
  • Sample Database 
  • Cheatsheet 
  • Glossary 
  • Blog 
  • Tags 
  1.   Blog
  1. Home
  2. Blog
  3. Speedtest CLI on Ubuntu [How To Install]

Speedtest CLI on Ubuntu [How To Install]

Share via
Howtodojo
Link copied to clipboard

In this tutorial, we learn how to install and use Speedtest CLI on Ubuntu. Running speedtest CLI can be beneficial in the hosting environment to check whether the provided bandwidth is as advertised.

On this page
Overview   Add Speedtest CLI repository   Install Speedtest CLI on Ubuntu   List Speedtest Command Options   Run Speedtest From Specific Server  
Speedtest CLI on Ubuntu [How To Install]

Overview  

In this tutorial, we learn how to install and use Speedtest CLI on Ubuntu. Running speedtest CLI can be beneficial in the hosting environment to check whether the provided bandwidth is as advertised.

Speedtest CLI can also be used to check our own internet connection. Running from command line should provide better test compared to browser based test since command line will have cleaner test environment, for example no browser plugins.

We will install the official speedtest command line application provided by ookla.

Add Speedtest CLI repository  

curl -s https://install.speedtest.net/app/cli/install.deb.sh | sudo bash
```bash

The output for the command above will be similar to output below.

```bash
Detected operating system as Ubuntu/focal.
Checking for curl...
Detected curl...
Checking for gpg...
Detected gpg...
Running apt-get update... done.
Installing apt-transport-https... done.
Installing /etc/apt/sources.list.d/ookla_speedtest-cli.list...done.
Importing packagecloud gpg key... done.
Running apt-get update... done.

The repository is setup! You can now install packages.

The script will do the following operations for us:

  • Detect operating systems version.
  • Check for the availability of certain tools (curl and gpg).
  • Install apt-transport-https package to enable apt download packages from package repository using https.
  • Create new repository configuration in /etc/apt/sources.list.d/ookla_speedtest-cli.list
  • Import packagecloud gpg key. This key will be used by apt to verify that the package being downloaded is the correct package created and signed by packagecloud.
  • Running apt-get update command to refresh apt package index.

Install Speedtest CLI on Ubuntu  

Now the repository configuration is ready, we can install speedtest CLI on Ubuntu using the following command.

sudo apt-get install speedtest
```bash

## Run Speedtest CLI {#run-speedtest-cli}

We can run speedtest without using any options or parameters

```bash
speedtest

Speedtest CLI will choose the closest speedtest server and start. On the first run, we have to accept EULA, terms and privacy policy.

List Speedtest Command Options  

To list speedtest CLI options we can use the --help option.

speedtest --help
```bash

<figure class="wp-block-image size-large is-style-default">
<img loading="lazy" width="750" height="400" src="https://www.howtodojo.com/wp-content/uploads/2021/05/speedtest-cli-ubuntu-6-750x400.png" alt="" class="wp-image-2721" />
</figure>

## Listing Speedtest Servers {#listing-speedtest-servers}

To get list of closest speedtest servers we can use `-L` options

```bash
speedtest -L

Run Speedtest From Specific Server  

From the output of the command above where we get a list of closest speedtest servers, copy the ID of the server that we want to use.

For example, to run the speedtest against server 14276 we can use the command below.

speedtest -s 14276
```bash

<figure class="wp-block-image is-style-default">

<img loading="lazy" width="750" height="337" src="https://www.howtodojo.com/wp-content/uploads/2021/05/speedtest-cli-ubuntu-4-750x337.png" alt="" class="wp-image-2723" /> </figure>

## Video Tutorial {#video-tutorial}

## Summary {#summary}

In this tutorial, we learn how to install and run Speedtest CLI on Ubuntu. We also learn how to get a list of the closest Speedtest servers and run speedtest from a specific server.
 How To Get Public IP From Command Line
How To Install Redis CLI on Ubuntu 
On this page:
Overview   Add Speedtest CLI repository   Install Speedtest CLI on Ubuntu   List Speedtest Command Options   Run Speedtest From Specific Server  
Follow me

We publish tutorials, tips and tricks about Linux, open source, cloud computing, and infrastructure

     
Copyright © 2012 - 2025 howtodojo.com. |
Howtodojo
Code copied to clipboard