Skip to content
How to Test Your Internet Speed on Linux with Speedtest‑CLI
Operations 4 min read

How to Test Your Internet Speed on Linux with Speedtest‑CLI

This guide explains why traditional Speedtest.net requires a graphical interface, introduces the command‑line tool speedtest‑cli, and provides step‑by‑step instructions for installing it on Linux, running basic tests, sharing results, listing servers, and selecting specific servers for precise bandwidth measurements.

MaGe Linux Operations
MaGe Linux Operations
MaGe Linux Operations

Why use speedtest-cli?

When you notice a slowdown in internet speed, you usually test the connection between your computer and the ISP ("last mile") using websites like Speedtest.net. However, Speedtest.net relies on JavaScript and a graphical interface, which is unavailable when you are logged into a server via SSH or using a headless OS.

Installing speedtest-cli

speedtest-cli is a lightweight command‑line tool written in Python that works with Python 2.4‑3.4. It uses Speedtest.net’s infrastructure to measure upload and download rates. Installation is straightforward: download the Python script and run it.

Installation illustration
Installation illustration

Running a basic test

Simply execute speedtest-cli without any arguments. The tool automatically finds the nearest Speedtest.net server, performs the test, and prints the upload and download speeds.

Test result
Test result

Sharing results

Use the --share option to upload the result to Speedtest.net and obtain a shareable image.

Shared result
Shared result

Listing and selecting servers

The --list option displays all available Speedtest.net servers sorted by distance, each with an ID. To test against a specific server, append its ID to the command, e.g., speedtest-cli --server 935 for a server in Washington DC.

Server list
Server list
Selecting a specific server
Selecting a specific server
Original Source

Signed-in readers can open the original source through BestHub's protected redirect.

Sign in to view source
Republication Notice

This article has been distilled and summarized from source material, then republished for learning and reference. If you believe it infringes your rights, please contactadmin@besthub.devand we will review it promptly.

Linuxnetwork testingbandwidthspeedtest-cli
Reader feedback

How this landed with the community

Sign in to like

Rate this article

Was this worth your time?

Sign in to rate
Discussion

0 Comments

Thoughtful readers leave field notes, pushback, and hard-won operational detail here.