How to speed test your server/vps bandwidth

Most folk have encountered the tool speedtest.net for testing broadband bandwidth speeds. To test your debian linux server/vps bandwidth speed using the same service via CLI do the following:

SSH to your server as root or use sudo

Download the speed test python script

wget https://raw.github.com/sivel/speedtest-cli/master/speedtest.py

Set permissions to allow it to be executed

chmod a+rx speedtest.py

At this point you could just run it from where you downloaded it. Personally I think it’s a useful utility to have on the server so do the following to make it a system wide application.

mv speedtest.py /usr/local/bin/speedtest

Set permissions on the binary

chown root:root /usr/local/bin/speedtest

Now you can perform a speed test of your bandwidth by doing the following

speedtest

NB if you get the error /usr/bin/env: ‘python’: No such file or directory

Installing Python minimal should resolve

apt install python-minimal

To share the result to speedtest.net (for example to show your provider) enter

speedtest --share

To see all options

speedtest /?

How speedtest your server/vps bandwidth using the speedtest.net service.