How to Check Your Network Speed in the Linux Terminal

If you are managing a remote Linux server via SSH without a graphical desktop, or you are simply trying to diagnose a slow Wi-Fi connection on your Ubuntu machine, you cannot just open a web browser and visit a speed testing website. Instead, you need a way to reliably test your exact download and upload bandwidth directly from the command line. Thankfully, the official Speedtest.net service provides a brilliant, lightweight terminal tool designed exactly for this purpose.

Installing the Speedtest CLI Tool

Because this tool relies on Python, we can install the open-source speedtest-cli package directly from the standard Linux repositories.

  1. Open your terminal application.
  2. First, update your package list by typing:
    sudo apt update
  3. Press Enter and provide your password.
  4. Next, install the tool by typing:
    sudo apt install speedtest-cli
  5. Press Enter and wait a few seconds for the installation to complete.

Note: If you are using a Red Hat-based system like Fedora or CentOS, use sudo dnf install speedtest-cli instead.

Running the Speed Test

Once the tiny application is installed, running a test is incredibly simple.

  1. In your terminal, simply type:
    speedtest-cli
  2. Press Enter.

The terminal will instantly ping the nearest Speedtest.net server (often selecting the one geographically closest to your IP address) and begin testing. It will print the ping (latency) in milliseconds, followed by a live calculation of your download speed in Mbit/s, and finally your upload speed in Mbit/s. If you want the tool to generate a sharable image link containing your results to send to your internet service provider, simply add the share flag: speedtest-cli --share.

Leave a Reply

Your email address will not be published. Required fields are marked *

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.

Receive our best articles and tips delivered straight to your inbox.