Skip to content

How to do speed test on server

This page shows you how to measure your server's download and upload speed from the command line. Use it when your users say the connection is slow and you want to know whether the problem is the server's own bandwidth (how much data its network connection can move per second).

Most servers have no desktop or web browser, so you cannot open a speed-test website on them. Instead, you run a small test program in the server's terminal.

Before you start

  • You can connect to your server over SSH (a secure way to type commands on a remote server). If you have never done this, read How to connect to the server via SSH.
  • You are logged in as root or as a user who can use sudo.

When you log in, the Hiddify menu may open. Press Cancel (or Esc) to close it and get to the terminal. If the menu is still on the screen, type clear and press Enter.

Method 1: Ookla Speedtest

Speedtest by Ookla is the official command-line version of the speedtest.net website.

  1. Only if you installed the old speedtest-cli program in the past, remove it first. Run this on your server, over SSH:

    sudo apt-get remove speedtest-cli
    

    If it says the package is not installed, that is fine. Go to the next step.

  2. Install curl and add Ookla's package source:

    sudo apt-get install curl
    curl -s https://packagecloud.io/install/repositories/ookla/speedtest-cli/script.deb.sh | sudo bash
    
  3. Install the speedtest program:

    sudo apt-get install speedtest
    
  4. Run the test:

    speedtest
    
  5. The first time you run it, it shows the license terms and a note about the data Speedtest collects. Type yes and press Enter for each message.

    Speedtest license prompt

    Speedtest data collection prompt

  1. Wait a few seconds. You should see the ping, the download speed and the upload speed of your server.

    Speedtest result

To test again later, just run speedtest again.

Test against a specific location

By default, Speedtest picks a test server close to yours. To test against another location:

  1. List the nearby test servers:

    speedtest --servers
    

    List of Speedtest servers

  2. In the ID column, find the location you want and copy its number.

  3. Run the test against that server. Replace ID with the number you copied:

    speedtest --server-id=ID
    

    Speedtest result for a chosen server

Method 2: the bench.sh script

bench.sh is a third-party script. Besides testing speed to several locations around the world, it shows your server's hardware: CPU, disk space, RAM, processor architecture and more.

  1. Run this on your server, over SSH:

    wget -qO- bench.sh | bash
    
  2. Wait about 5 to 8 minutes. The script tests speed from several locations on different continents and then prints the results.

    bench.sh result

What the results mean

  • The speeds are much lower than your hosting plan promises: the problem is the server or its data center. Contact your hosting provider, or move to another server.
  • The speeds are good, but your users still get slow connections: the server's bandwidth is not the problem. The slowdown is more likely between your users and the server (for example, filtering or a poor route from their internet provider). See Troubleshooting connectivity issues.

Last update: October 23, 2026

Comments