How To Test Internet Connection Speed via Command Line

Test Internet Connection Speed via Command Line

In this tutorial, we will show you how to Test Internet Connection Speed via Command Line on Linux. For those of you who didn’t know, Speedtest.net is a pretty good place to check your internet speeds. But there is an even simpler way. Using the speedtest-cli command-line app, you can actually check your current broadband speeds via Terminal. For those of you who didn’t know, speedtest-cli is a simple CLI client written in Python for measuring bidirectional Internet bandwidth by using Speedtest.net infrastructure. It works with Python 2.4-3.4. Installing the latest speedtest-cli is nothing more than downloading the Python script.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step-by-step installation Speedtest on Linux systems.

Prerequisites

  • A server running one of the following operating systems: Linux OS.
  • It’s recommended that you use a fresh OS install to prevent any potential issues.
  • A non-root sudo user or access to the root user. We recommend acting as a non-root sudo user, however, as you can harm your system if you’re not careful when acting as the root.

Test Internet Connection Speed via Command Line

Step 1. First, let’s start by ensuring your system is up-to-date.

sudo dnf clean all
sudo dnf update

Step 2. Installing speedtest-cli on Linux.

Run the following command to install the speedtest:

wget https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli

Once successfully installed, Run an internet speed test with the following command:

./speedtest-cli.py

If you want to share the speed test result, you can use “–share” option, which will allow you to share speed test result with others in an image format via Speedtest.net.

./speedtest-cli.py --share

Test Internet Connection Speed via Command Line

The utility supports a few other parameters, and you can view them by running the speedtest-cli.py –help command.

./speedtest_cli.py --help
Usage: speedtest_cli.py [options]

Command line interface for testing internet bandwidth using speedtest.net.
--------------------------------------------------------------------------

https://github.com/sivel/speedtest-cli

Options:
  -h, --help       show this help message and exit
  --share          Generate and provide a URL to the speedtest.net share
                   results image
  --simple         Suppress verbose output, only show basic information
  --list           Display a list of speedtest.net servers sorted by distance
  --server=SERVER  Specify a server ID to test against
  --mini=MINI      URL of the Speedtest Mini server
  --source=SOURCE  Source IP address to bind to
  --version        Show the version number and exit

Congratulations! You have successfully Tested Internet Connection Speed. Thanks for using this tutorial for Test Internet Connection Speed via CLI on the Linux system. For additional help or useful information, we recommend you check the official speedtest website.

[su_box title=”VPS Manage Service Offer” style=”bubbles” box_color=”#000000″ radius=”10″]If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal![/su_box]

r00t is a Linux Systems Administrator and open-source advocate with over ten years of hands-on experience in server infrastructure, system hardening, and performance tuning. Having worked across distributions such as Debian, Arch, RHEL, and Ubuntu, he brings real-world depth to every article published on this blog. r00t writes to bridge the gap between complex sysadmin concepts and practical, everyday application — whether you are configuring your first server or optimizing a production environment. Based in New York, US, he is a firm believer that knowledge, like open-source software, is best when shared freely.

Related Posts