How to perform an Internet Speed test on Linux Terminal

How to Use `curl` to Run a Speed Test

If you’re looking to quickly check your internet speed using `curl`, we have the easiest method for you. Just run this command:

curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -

This command pulls a Python script from GitHub and runs it immediately, giving you a quick and straightforward way to test your internet speed. But for those who want to understand a bit more about how this works and what else you can do, let’s dig deeper into using `speedtest-cli`.

What is speedtest-cli?

Speedtest-cli is a simple command-line interface for testing your internet speed using Speedtest.net. It allows you to measure your download and upload speeds, as well as other network performance metrics, directly from your terminal.

Running a Speed Test with curl

To run a speed test using `curl`, the command mentioned above is the simplest method. Here’s a breakdown of what the command does:

  • `curl -s`: This part of the command fetches the speedtest.py script from GitHub.
  • `https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py`: This is the URL of the script.
  • `| python3 -`: This pipes the script to Python 3, which executes it.

When you run this command, you should see something like this:

[root@g7cloud ~]# curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -
Retrieving speedtest.net configuration...
Testing from G7Cloud Servers (31.132.2.0)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by YouFibre (London) [1.30 km]: 6.128 ms
Testing download speed................................................................................
Download: 8208.97 Mbit/s
Testing upload speed......................................................................................................
Upload: 9763.51 Mbit/s

Installing speedtest-cli

While the above method is quick and easy, installing `speedtest-cli` locally offers more flexibility and avoids the need to fetch the script every time you want to run a test.

Installation on Linux

To install `speedtest-cli`, you’ll first need Python and pip (Python’s package installer). If you don’t have them, you can install them with the following commands:

For Debian-based distributions (e.g., Ubuntu):

sudo apt update

sudo apt install python3 python3-pip

For Red Hat-based distributions (e.g., Fedora):

sudo dnf install python3 python3-pip

Once you have Python and pip installed, you can install `speedtest-cli` using pip:

pip install speedtest-cli

Running speedtest-cli

With `speedtest-cli` installed, running a speed test is as simple as entering the following command in your terminal:

speedtest

You can also use `speedtest-cli` with additional options for more detailed results or specific configurations. Here are some examples:

  • Simple speed test: `speedtest`
  • Detailed output: `speedtest –verbose`
  • List available servers: `speedtest –list`

But remember, the goal here is to keep things simple. For most users, just running `speedtest` will provide all the information you need.

Conclusion

Running an internet speed test using `curl` and `speedtest-cli` is a straightforward process that anyone can do from the terminal. Whether you choose to use the quick command or install `speedtest-cli` for more flexibility, you’ll be able to gauge your network’s performance easily.

Start testing your internet speed now and take control of your network performance!

Ready to get started? Open your terminal and try the command:

curl -s https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py | python3 -

Happy testing!

Elastic Hosting

Scalable hosting tailored to your website’s needs—no more frequent plan upgrades. With our elastic hosting, you only pay for the resources you actually use.

WordPress Hosting

Trusted by some of the worlds largest WooCommerce and WordPress sites, there’s a reason thousands of businesses are switching to G7