Slow downloads, choppy calls, or provider handoffs need a measurement taken from the affected Linux host, not only from a phone or browser on another network. A terminal speed test shows latency plus download and upload throughput from the same path that remote shells, backups, package downloads, or application traffic use.
The speedtest-cli package uses the Speedtest.net measurement network from the shell. Its --simple output keeps the result to Ping, Download, and Upload, while --secure makes the client use HTTPS when talking to Speedtest.net-operated servers.
Speed-test results change with Wi-Fi signal, VPN tunnels, traffic shaping, background transfers, and the selected test server. Run the test when the link can briefly carry download and upload traffic, and compare repeated runs only when the command, test direction, server choice, and time window are similar.
Steps to test internet speed with speedtest-cli in Linux:
- Install speedtest-cli from the distribution package repository when the command is not already available.
$ sudo apt install speedtest-cli
The package is available in current Ubuntu and Debian repositories. On other distributions, use the native package manager when it ships speedtest-cli instead of mixing it with the official Ookla speedtest package, which uses a different command name.
- Run a simple speed test over HTTPS.
$ speedtest-cli --simple --secure Ping: 12.522 ms Download: 621.56 Mbit/s Upload: 250.94 Mbit/s
Ping is the round-trip delay to the selected test endpoint. Download and Upload are reported in megabits per second, not megabytes per second.
- Compare the measured rates with the expected link or service plan.
A test far below the expected rate is stronger evidence when the host is on wired Ethernet, no VPN is active, and other large transfers are stopped during the run.
- List available Speedtest.net servers when repeated tests need the same endpoint.
$ speedtest-cli --list Retrieving speedtest.net configuration... 12108) Example ISP (Example City, US) [16.50 km] 57457) Example Exchange (Example City, US) [16.87 km] 28451) Example Mobile (Example City, US) [16.97 km] 45610) Example Broadband (Example City, US) [16.97 km] ##### snipped #####
The closest or lowest-latency server is not always the best comparison point. Use a server that matches the provider edge, city, or remote path being investigated.
- Run the test against a chosen server ID when comparisons must stay consistent.
$ speedtest-cli --server 12108 --simple --secure Ping: 12.901 ms Download: 612.40 Mbit/s Upload: 247.83 Mbit/s
Keep the same server ID, connection type, and time window when comparing changes across days or after provider work.
- Repeat the same test after network changes or during the suspected slow period.
If Ping rises or upload drops only during busy hours, the result points toward congestion or shaping. If Ping is already unstable before the speed test, check latency and packet loss before blaming throughput.
Related: How to check network latency in Linux
Mohd Shakir Zakaria is a cloud architect with deep roots in software development and open-source advocacy. Certified in AWS, Red Hat, VMware, ITIL, and Linux, he specializes in designing and managing robust cloud and on-premises infrastructures.