Speed Test Server Network via Linux Command – SpeedTest-CLI
In this tutorial we’ll test and check the server network connection speed via speedtest-cli (Speedtest by Ookla), the best thing is you can directly install the speedtest python package to your Linux distro and run the test via terminal command isn’t is awesome.
This will also help you to determine that what exactly network speed your server provider is providing. Without waiting lets get started. Difficulty level : super easy
CentOS :
To install speedtest cli on Centos RHEL based OS follow this commands :-
Install EPEL release :
yum install epel-release -y
Then install python and python-pip
yum install python python-pip -y pip install --upgrade pip
Close the ssh console and re-login to ssh
Then install Speedtest-cli package via pip :
pip install speedtest-cli
Ubuntu :
To install speedtest cli on debian/ubuntu based OS follow this commands :-
First update the packages :
apt-get update
Then install python and python pip :
apt-get install python python-pip pip install --upgrade pip
Ubuntu version 20.04 and up/python3 and pip3 needed :
apt install -y python3 python3-pip ln -s /usr/bin/python3 /usr/bin/python ln -s /usr/bin/pip3 /usr/bin/pip
Close the ssh console and re-login to ssh
Then install Speedtest-cli package via pip :
pip install speedtest-cli
All other Linux/Unix OS :
TO install speedtest-cli on different Linux distro use this procedure :-
Ensure python package is already installed on your Linux distro, download speedtest-cli :
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
Fix the permissions to execute,
chmod +x speedtest-cli
Now run below any one command to get the internet speed :
./speedtest-cli Or python speedtest-cli
Example commands for speedtest-cli :
Run the below commands in order to run the speed test of network
speedtest-cli
eg :
root@mysterydata:~# speedtest-cli Retrieving speedtest.net configuration... Testing from tzulo (107.152.32.123)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Lola Wireless (Stone Park, IL) [20.59 km]: 5.242 ms Testing download speed................................................................................ Download: 954.18 Mbit/s Testing upload speed................................................................................................ Upload: 901.60 Mbit/s
To share and generate the Speed test link use flag
--share
speedtest-cli --share
eg :
[root@srv1 ~]# speedtest-cli --share Retrieving speedtest.net configuration... Testing from tzulo (107.152.32.123)... Retrieving speedtest.net server list... Selecting best server based on ping... Hosted by Vinakom Communications (Schaumburg, IL) [22.13 km]: 7.004 ms Testing download speed................................................................................ Download: 792.71 Mbit/s Testing upload speed................................................................................................ Upload: 537.91 Mbit/s Share results: http://www.speedtest.net/result/7360604912.png