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
How to Test Your Internet Speed on Linux with Speedtest‑CLI

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
Linuxnetwork testingBandwidthspeedtest-cli
MaGe Linux Operations
Written by

MaGe Linux Operations

Founded in 2009, MaGe Education is a top Chinese high‑end IT training brand. Its graduates earn 12K+ RMB salaries, and the school has trained tens of thousands of students. It offers high‑pay courses in Linux cloud operations, Python full‑stack, automation, data analysis, AI, and Go high‑concurrency architecture. Thanks to quality courses and a solid reputation, it has talent partnerships with numerous internet firms.

0 followers
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.