Add Speedtest to Pihole WebUI

So this project is just another fun project integrating speed test to PiHole Web UI.

Note: It’s just a quick solution, nowhere near perfect. If you made it better please let me know here  Discord ( prefered ) or  Google+ Community 

It will be using on background for testing. More frequent the speed tests more data will used.

What does this mod have in extra ?

  1. Speedtest results of 1 /2 4/ 7/30  days as graph.
  2. Custom speed test server selection.
  3. Detailed speedtest results page.
  4. Ability to schedule speedtest interval.

Latest Updates will listed here :  Pihole mods Community 

Inspiration :

How to update to new version

Tested on Raspberry pi and Ubuntu PC

Needs latest pihole installed and working

Start with installing required packages on your Raspberry Pi / Linux

Find php version 

if it is 5.x

if it is 7.x

Restart Pi

You can try run it using

If Everything is ok, proceed to next step

Get the new set of admin Code from github ( New method  or try old one here)

Test its working

Go to your pihole admin page


Note : First load may be slow


Now go to settings and enable speedtest

Note: If the item does not change to option you have chose just go to dashboard and comeback, it will be fine. I am currently working on it

Now create a speedtest Manually and make sure it’s appearing on dashboard

Go back to terminal and type  Not needed  : admin will call this if there is no data 

It may take few seconds to appear , but once its loaded you can see that on dashboard.

Please consider posting a screenshot link in the comments , I would like to know how it looks on different devices.

If there are any problems , ask here :  PiHole mods G+

Will my regular updates have problems ?

If you are upgrading pihole please revert all changes back and do the upgrade. Scroll down for instructions .

Speedtest gone missing after Pi-hole update

Dont worry your data is safe , update procedure here

Can the developer held responsible if anything goes wrong.

Absolutely not ,but you can always ask for help

I lost my DB file what Should I do ?

Here is a blank one : SpeedtestDB Zip

Can i get more features added to it ?

You can ask me via this link, I will do if feasible

Can I get it via regular pihole -up

Not currently. Hope this will get integrated into the baseline. If that happens you can easily get it via regular pihole update

The time is not not showing correctly in chart 

Please get latest code via git pull

I don’t want this , I want to go back to the original version .

If you have followed all instructions correctly , the code below will revert all the changes you have done .


Just a quick solution , you should move the db file to a directory outside www folder for security reasons.

Uses codes from



Old Method for admin area

31 thoughts on “Add Speedtest to Pihole WebUI

  1. Hi, First of all Thank you this is awesome. I followed the instructions and it doesnt seem to be working the box doesnt show in the dashboard and it doesnt allow me to enable it.

    When I enter “sudo pihole -a -sn” all I get is the pihole -a help menu

    Set admin options for the web interface of pihole
    ::: Usage: pihole -a [options]
    ::: Options:
    ::: -p, password Set web interface password, an empty input will remove any previously set password
    ::: -c, celsius Set Celsius temperature unit
    ::: -f, fahrenheit Set Fahrenheit temperature unit
    ::: -k, kelvin Set Kelvin temperature unit
    ::: -h, –help Show this help dialog
    ::: -i, interface Setup interface listening behavior of dnsmasq
    ::: pihole -a -i local : Listen on all interfaces, but allow only queries from
    ::: devices that are at most one hop away (local devices)
    ::: pihole -a -i single : Listen only on one interface (see PIHOLE_INTERFACE)
    ::: pihole -a -i all : Listen on all interfaces, permit all origins

  2. great concept! i have just attempted to install it but never got it to completely work. my issues were:
    1: when clicking on speedtest in pihole after enabling it for 1hr intervals, i got an error saying that there was no data to display
    2: i rebooted, when going to http://x/admin, i only ever got the source of index.php to display – never the actual webpage.

    i reverted as per instructions and rebooted and http://x/admin displayed correctly.

  3. No issues. Instructions were perfect. Was able to install it in less than 10 minutes. Now, the only issue is that the ethernet interface of my Pi is slower than my internet connection, so i will never get the real, real results.

  4. Remove is missing a /admin

    # Note this will revert all changes including you speedtest data saved
    # Will work only If you have followed all instructions exactly

    cd /var/www/html/admin
    sudo su

    git reset –hard origin/master

    cd /opt/pihole/

  5. I keep on seeing 200 entries every time a speedtest is done in my Dashboard, which kinda pollutes the graph. Is there any way around this?

    1. You can set a custom server, it will reduce the number of queries to less than 5. Go to the settings page and enter the custom server ID

  6. Love the project, and it works great. My only issue is I have a gigabit network, but the raspberry pi only supports 100mbps. Which kills the validity of this project for me personally. If i had 100mbps or under from my isp this would be the perfect project.

  7. I’d be interested in a standalone webpage for the speedtest. (separate from the Pi-hole project)

    I’d be willing to collaborate on such a standalone webpage. I’m fairly skilled with python and shell scripting.
    If you’d be willing to do the web frontend stuff, I could help with the backend stuff, an install script, and testing.

    I’ve been looking for something like this for quite a while, and the closest I’ve found is:

    I think that we could program in some additional features, like the ability to run a manual test (versus the automatic ones). We could also theoretically make a settings page to set the frequency of the speedtests.

  8. I wish I could get this to work, All the screens are in the pihole admin page and all the options for speedtest are there, but I keep getting the error
    /var/www/html/admin/scripts/pi-hole/speedtest/ Line 328: sqlite3: Command not found

    I am running sqlite7 so I dont understand…oh well, nice try :/

  9. The graph is making me wonder….why is the right side always displaying some random number? I had at first thought that my Internet speed, which is showing up correctly on the lieft was also on the right, but today the scale is 300 100 and Zero, while the left still indicates increments of 10.

  10. is there a possibility to get the original version, whereby the hours are indicated below the graph, without the date, slanted? and a 24 hour test range instead of 1 day? I would like to have the speedtest mirror the pihole frequency of just carrying the last 24 hours of data and purging the rest. Maybe added to the option page?

  11. I’ve got PHP 7 installed, but am getting an error: Couldn’t find any package by regex ‘php7.0-sqlite’
    Any ideas? I’ve tried the standard sudo apt-get update

  12. Hi Siddhu,
    Bangin awesome project, thank you for sharing it. I’ve installed on my RPi 3 (Stretch), OPi zero (Armbian 5.38) and for giggles put it on a friends RPi 2 B (Jessie). No problems at all, thank you!


Leave a Reply

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