Sometimes when you try to update your system or install new software, you may find that it takes way too long. In such situations, speed testing your internet can help determine if the issue lies on your end or is a server-side issue.

Let's learn how you can easily speed-test your internet from the Linux terminal.

What Is Speed Testing, and Why Is It Important?

Speed testing, as the name hints, is the process of testing the speed of your internet connection. Your computer sends a few packets to a remote server. The number of packets sent per second, and each transfer's latency is then benchmarked.

Speed testing your internet tells you whether your ISP provides the internet speed promised in your subscription. It can also sometimes be useful in troubleshooting networking problems in applications, as speed testing tells you if a certain app is having connection issues or your internet connection is running slow.

Test Your Internet Speed From the Linux Terminal Using Speedtest CLI

speedtest-cli sample run

speedtest.net by Ookla is a popular internet speed testing website. You probably have used it every time you needed to test your internet.

Did you know that it has an official CLI application that does everything the website can do but from the comfort of your Linux terminal? Well, now you do. Testing internet speed from the Linux terminal is a quick and easy process that can be done using a few simple commands.

As a preliminary step, update your system using the package manager on your distro.

On Ubuntu/Debian derivatives, run:

        sudo apt update && sudo apt upgrade
    

On Arch-based systems, run:

        sudo pacman -Syu
    

On Fedora, CentOS, and RHEL, issue the following command:

        sudo dnf update
    

Now that your system has been updated, proceed with the installation of the speedtest-cli package using the package manager on your distribution.

On Ubuntu/Debian derivatives, type in:

        sudo apt install speedtest-cli
    

On Arch-based systems, run:

        sudo pacman -S speedtest-cli
    

To install Speedtest CLI on Fedora, CentOS, and RHEL, issue the following command:

        sudo dnf install speedtest-cli
    

Now Speedtest CLI has been installed on your system. To test your internet speed, simply type in speedtest-cli and hit Enter.

The tool should automatically find the optimal server for speed testing and return desired results, including your internet speed in megabits per second (Mbps). Along with basic internet speed tracking, Speedtest CLI offers a few extra options worth checking out.

If you want to test your internet speed with a specific server, you can use the --server flag followed by the server ID. Here's an example:

        speedtest-cli --server 69420
    

You can specify the number of bytes to transfer during the speed test using the --bytes flag. For example:

        speedtest-cli --bytes 1337
    

To save the speed test results to a file, you can use the --output flag followed by the filename. Here's how the command should look:

        speedtest-cli --output results.txt
    

To get a comprehensive guide of all the features of the speedtest-cli tool, use the man speedtest command to read through its manual page. Or, check out a web-based alternative to the man command.

Now You Know How to Speed Test Your Internet on Linux

Speed testing your internet helps diagnose network issues and track the network performance in general. With Speedtest CLI you can easily test your internet directly from the terminal without opening a browser. This can be quite useful when working with headless servers or command line-dependent systems, which, in most cases, are servers.

If you need to install a graphical user interface on your server, you can do that too.