Use Speedtest.net from your vps without using vnc

Wouldn’t it be nice to be able to test your upload/download speed from your VPS and share the “famous” picture from speedtest.net ?

Speedtest.net uses Flash to test upload/download speed which is a hassle on most VPS.
The long way to get this is to install VNC and run it from a browser, but that is no longer necessary.
We can now useย Matt Martz python script speedtest-cli to accomplish this from the commandline.

 

Prerequisites:

  • Pythonย 2.4-2.7 or 3

After you have installed Python on your vps download the speedtest-cli file from github.

when the download is complete, make the file executable with:

and then run it with:

after the test are run you will get the url to your speedtest.net image.

heres an example ran from a Securedragon VPS

51 comments for “Use Speedtest.net from your vps without using vnc

  1. Ray
    February 25, 2013 at 22:19

    Thanks for the post – very helpful!

  2. February 26, 2013 at 07:45

    Just tried on my amazon e3 micro
    http://www.speedtest.net/result/2535062237.png

    • June 6, 2014 at 14:58

      An FtpIt VPS surely can beat Amazon then. ๐Ÿ˜€

  3. Yumii
    February 26, 2013 at 09:33

    Colocrossing 696 Mb/s o_O
    http://www.speedtest.net/result/2533328874.png

    how to choose a server location? @_@

    • February 27, 2013 at 15:01

      u might nid to edit the script in order to do so
      idk how btw, idk about python ~

    • February 27, 2013 at 15:07

      i just look into the script

      “parser.add_argument(‘–server’, help=’Specify a server ID to test against’)”

      the script alrd well written to be modifiable

      serverlist : http://speedtest.net/speedtest-servers.php

      just go through the script and u will find a lot more that can customize

    • February 28, 2013 at 07:31

      I just notice this

      Options:
      -h, –help show this help message and exit
      –share Generate and provide a URL to the speedtest.net share
      results image
      –simple Suppress verbose output, only show basic information
      –list Display a list of speedtest.net servers sorted by distance
      –server=SERVER Specify a server ID to test against

  4. February 27, 2013 at 15:02

    lovely script btw ~

    tested on one of my frantech vps
    http://www.speedtest.net/result/2538158963.png

  5. March 2, 2013 at 06:06

    I used to do that VNC thing… Not anymore! Thanks for the info.. When I first tried I got this http://pastebin.com/Lm4kA7eu

    I moved to a different VPS and it worked perfectly.
    http://www.speedtest.net/result/2544318087.png (RamNode)

    • March 28, 2017 at 06:01

      Here is another one after Linode upgraded their network resources:

      Download is freaking awesome.

  6. March 16, 2013 at 02:31

    just tested your tutorial. nice
    http://www.speedtest.net/result/2576952696.png | Ramnode

  7. April 2, 2013 at 12:52

    My speedtest on a Colocrossing vps http://www.speedtest.net/result/2616958871.png

    • April 2, 2013 at 17:44

      Good download speed. Where do you have your server?

  8. Robert
    May 13, 2013 at 19:02

    My speedtest using SecuredSpeed.com VPS: http://www.speedtest.net/result/2705460994.png

    Looks like securedSpeed.com is based out of OC3 Networks/Quadranet…

    • May 21, 2013 at 20:03

      Nice!

    • Cas de Reuver
      January 6, 2014 at 17:24

      Which host :O

  9. dani st
    June 28, 2013 at 11:04
  10. Deeeebs
    September 24, 2013 at 20:28

    [root@ns1 ~]# wget https://raw.github.com/sivel/speedtest-cli/master/speedtest-cli-3 –no-check-certificate -O speedtest-cli.py
    –2013-09-24 14:28:20– https://raw.github.com/sivel/speedtest-cli/master/speedtest-cli-3
    Resolving raw.github.com… 199.27.72.133
    Connecting to raw.github.com|199.27.72.133|:443… connected.
    HTTP request sent, awaiting response… 404 Not Found
    2013-09-24 14:28:21 ERROR 404: Not Found.

  11. Alexey
    November 2, 2013 at 19:41

    FreeBSD9.1, Python 2.7:

    root@timeisall:/home/*** # ./speedtest-cli.py –share
    Retrieving speedtest.net configuration…
    Retrieving speedtest.net server list…
    Testing from ISPsystem, cjsc (188.120.229.149)…
    Selecting best server based on ping…
    Traceback (most recent call last):
    File “./speedtest-cli.py”, line 549, in
    main()
    File “./speedtest-cli.py”, line 543, in main
    speedtest()
    File “./speedtest-cli.py”, line 465, in speedtest
    best = getBestServer(servers)
    File “./speedtest-cli.py”, line 326, in getBestServer
    uh = urlopen(‘%s/latency.txt’ % url)
    File “/usr/local/lib/python2.7/urllib2.py”, line 127, in urlopen
    return _opener.open(url, data, timeout)
    File “/usr/local/lib/python2.7/urllib2.py”, line 404, in open
    response = self._open(req, data)
    File “/usr/local/lib/python2.7/urllib2.py”, line 422, in _open
    ‘_open’, req)
    File “/usr/local/lib/python2.7/urllib2.py”, line 382, in _call_chain
    result = func(*args)
    File “/usr/local/lib/python2.7/urllib2.py”, line 1214, in http_open
    return self.do_open(httplib.HTTPConnection, req)
    File “/usr/local/lib/python2.7/urllib2.py”, line 1184, in do_open
    raise URLError(err)
    urllib2.URLError:

    • Alexey
      November 2, 2013 at 19:48

      ./speedtest-cli.py –server 2061
      Retrieving speedtest.net configuration…
      Retrieving speedtest.net server list…
      Testing from ISPsystem, cjsc (188.120.229.149)…
      Traceback (most recent call last):
      File “./speedtest-cli.py”, line 549, in
      main()
      File “./speedtest-cli.py”, line 543, in main
      speedtest()
      File “./speedtest-cli.py”, line 427, in speedtest
      servers))
      File “./speedtest-cli.py”, line 326, in getBestServer
      uh = urlopen(‘%s/latency.txt’ % url)
      File “/usr/local/lib/python2.7/urllib2.py”, line 127, in urlopen
      return _opener.open(url, data, timeout)
      File “/usr/local/lib/python2.7/urllib2.py”, line 404, in open
      response = self._open(req, data)
      File “/usr/local/lib/python2.7/urllib2.py”, line 422, in _open
      ‘_open’, req)
      File “/usr/local/lib/python2.7/urllib2.py”, line 382, in _call_chain
      result = func(*args)
      File “/usr/local/lib/python2.7/urllib2.py”, line 1214, in http_open
      return self.do_open(httplib.HTTPConnection, req)
      File “/usr/local/lib/python2.7/urllib2.py”, line 1184, in do_open
      raise URLError(err)
      urllib2.URLError: urlopen error [Errno 8] hostname nor servname provided, or not known

      • Alexey
        November 3, 2013 at 19:53

        Sorry for false alarm. The problem is not in the script. It seems that my ip is banned with some of speedtest servers from the list.

  12. mlody.1039
    November 10, 2013 at 23:25

    just test it on 1gb/s but only 500 mb and upload bad
    http://www.speedtest.net/result/3092380632.png

  13. Secrets.100
    November 17, 2013 at 16:05
  14. zax
    November 26, 2013 at 18:45
  15. wpbest.net
    November 29, 2013 at 05:50
  16. mitchell thompson
    December 24, 2013 at 08:53

    Easiest way to do this is by following this guide http://vpstip.com/how-to-speed-test-vps-in-linux/

    • December 27, 2013 at 10:32

      Interesting, exactly the same thing I wrote but in other words and another provider used for the example.

      Nice to see that people find it useful.

  17. mlody
    December 31, 2013 at 18:31
    • January 1, 2014 at 11:22

      I would say it’s good enough. ๐Ÿ˜‰

  18. krozden
    January 11, 2014 at 17:24

    Its say no file or directory if i run with ./speedtest-cli.py –share
    But solved with removing the extention .py

    http://www.speedtest.net/result/3224206882.png

    • January 12, 2014 at 15:46

      I guess you got the first command wrong and saved your file without the .py extension

  19. LivingSouL
    January 23, 2014 at 15:27
  20. illucentinfo
    February 24, 2014 at 21:49
  21. Arief Pratama
    March 9, 2014 at 15:29
  22. October 13, 2014 at 03:45

    http://www.speedtest.net/result/3827361639.png

    time to start VPN hosting ๐Ÿ˜€

  23. January 11, 2015 at 17:07

    How to do the same ping for ipv6?

  24. January 27, 2015 at 15:16

    http://www.speedtest.net/result/4093304254.png
    Mine is also too fast. ๐Ÿ™‚

  25. seiya
    March 18, 2015 at 10:14

    wget -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
    –2015-03-18 04:13:22– https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py
    Resolving raw.github.com… 23.235.46.133
    Connecting to raw.github.com|23.235.46.133|:443… connected.
    ERROR: certificate common name www.github.com' doesn't match requested host name raw.github.com’.
    To connect to raw.github.com insecurely, use `–no-check-certificate’.

    what’s wrong?

    • March 18, 2015 at 15:32

      Try this:
      wget โ€“no-check-certificate -O speedtest-cli https://raw.github.com/sivel/speedtest-cli/master/speedtest_cli.py

      wget gets redirected and the certificate is not correct for the site that you are redirected to.

  26. March 29, 2015 at 02:27

    This post is worth everyone’s attention. Where can I
    find out more?

  27. DumasLinux
    April 13, 2015 at 21:53

    If you do not have python in OS:

    Another way to test the speed at Speedtest.net servers from Linux CLI (without python) :

    http://www.sysadmit.com/2015/04/linux-speedtestnet-cli.html

  28. kemengfa.com
    April 19, 2015 at 14:19

    I love what you guys are up too. Such clever work and coverage!

    Keep up the amazing works guys I’ve incorporated you guys to blogroll.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.