A minimalist rendering of an empty room bathed in a light purple glow. In the room are two rack-server units on the floor, stacked on top of each-other, while a single cable with a spiral glowing pattern exits from the back off to the right of the screen. Image created by TechSquidTV in Blender.

How To Speed Test Your VPS

2m read

When looking for a VPS (virtual private server) provider, many list the specs and features publicly but often neglect to share the network speed. That’s probably fair since it’s really difficult to give an accurate “speed” when servers are often located all over the world and so are your users.

It might be helpful to test out the network speed to some of the locations you’ll expect users to connect from. And, thanks to GitHub user @Sivel we can use their python-based CLI for the popular website speedtest.net – speedtest-cli.

Install speedtest-cli

If Python is installed…

You can install the speedtest-cli via pip

Terminal window
pip install speedtest-cli


Terminal window
wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py
chmod +x speedtest-cli

Of course, all of the instructions are provided in the documentation on GitHub where you can find the additional usage flags.

To run a basic speed test you can simply run:

Terminal window

You can watch an example of installing and running these commands below. This is running on a VPS provided by Vultr.

After the speedtest-cli has completed you’ll receive output similar to the following, containing the server you have connected to and your download and most-importantly, upload speed.

Terminal window
Testing from Choopa, LLC (45.76.xxx.xxx)...
Retrieving speedtest.net server list...
Selecting best server based on ping...
Hosted by Speedtest.net (Atlanta, GA) [6.39 km]: 1.365 ms
Testing upload
speed...................Download: 551.92 Mbits
Testing upload speed....Upload: 251.37 Mbits
root@vultr:~/speedtest# exit

One trick that may make this tool more useful for your real-world testing may be to provide the —server argument where you can supply a known SpeedTest.net server ID to test against. this may be useful if you know a large portion of your users will be connecting from known locations or if you want to deliberately test against multiple nodes.

And finally, if you are truly passionate about testing you may also export to a CSV file using —csv so you can capture your findings.


Let's stay in touch! Get notified of new posts and videos

Your email will never be shared. 1-2 emails per month max