31.01.2026

How to Test Internet Speed on Ubuntu 20.04 with Speedtest-CLI (Step-by-Step Guide)

When working with a server, it’s often necessary to quickly check internet connection speed, bandwidth, and latency. On desktop systems, this can be done using browser-based tools, but on Ubuntu Server 20.04, a command-line solution is required.

In this step-by-step guide, you’ll learn how to test internet speed on Ubuntu 20.04 using Speedtest-CLI, a lightweight command-line tool by Ookla. We’ll cover installation, running speed tests, selecting test servers, and interpreting download and upload results.

Install Speedtest-CLI on Ubuntu 20.04

To test internet speed from the command line, we will install Speedtest CLI by Ookla, the official and most up-to-date command-line tool. This method works well on Ubuntu Server and desktop systems.

Step 1. Update the package index

First, update the local package list to ensure you install the latest available versions:

sudo apt update

Step 2. Install required dependencies

Install curl, which is used to download the official Speedtest repository installation script:

sudo apt install -y curl

Step 3. Add the official Speedtest CLI repository

Run the following command to add Ookla’s official repository to your system:

curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash

This script automatically:

Step 4. Install Speedtest CLI

Once the repository is added, install the Speedtest CLI package:

sudo apt install speedtest

Step 5. Verify the installation

After installation, confirm that Speedtest CLI is installed correctly:

speedtest --version

If the command returns the version number, Speedtest CLI is ready to use.

Internet connection speed test

To run a simple Internet speed test, run:

speedtest-cli

Read the license and accept it.

Do you accept the license? [type YES to accept]:

You will see the results when the test is complete:

Speedtest by Ookla
Server: Some Server
ISP: Your ISP
Latency: 1.22 ms (0.04 ms jitter)
Download: 82.59 Mbps (data used: 41.5 MB)
Upload: 91.69 Mbps (data used: 41.3 MB)
Packet Loss: 0.0%
Result URL: https://www.speedtest.net/result/c/4f200375-d643-...

You can share the result using the Result URL.
You can choose another server to test the speed. Enter this command to see the nearest servers:

speedtest -L

To select one of them, enter the following command with the server ID instead of "1111":

speedtest -s 1111

To see all available options, enter:

speedtest --help

Conclusion

Testing internet speed on Ubuntu 20.04 using Speedtest-CLI is a fast and reliable solution, especially for server environments without a graphical interface. With this tool, you can measure download and upload speeds, monitor latency, and troubleshoot network performance issues.

By selecting specific test servers or automating speed checks, Speedtest-CLI becomes a powerful utility for maintaining optimal bandwidth and connectivity on Ubuntu servers.

FAQ