Pi-hole 2.0: Web Interface Dashboard

Similar to how you would log into a router to adjust settings, I want to have a Web interface for the Pi-hole.  You could log in to view stats, update the list of domains, and restart the device.  I made a demo of the interface.

The demo doesn’t do anything–it’s just there for display purposes, so you will see placeholder numbers and stats (although, you can use the donate button if you like what you see ?).  You can view a demo of the interface here, which is based off of AdminLTE.


I would like for the interface to use PHP to somehow query some basic stats found in this script and then be displayed in the colored boxes, but I don’t know enough about coding PHP yet, so if you have any suggestions, please let me know by making a pull request.  I would like to incorporate a lot of what Anon135813 has done but would prefer the more flat looking interface of AdminLTE.

27 Replies to “Pi-hole 2.0: Web Interface Dashboard”

  1. One way to do what you are trying to achive is to rewrite a version of the bash script you into a php script. It should be easy enough, as all you are doing in the bash script is just string/text processing. Reading /var/pi-hole.log file. and some basic arithmetic to calculate %. All of this functionallities are available on php. Once you done all these just print the resulted string into the adminLTE squares. For this you will probably need to know how adminLTE is written. Reading adminLTE coes on git will help you with that. php.net has all the resource/documentation/examples you will ever need to working with php. Forking the adminLTE will be a good starting point.

    1. I was hoping to do something like this, but didn’t have enough PHP knowledge and it also got more complex than I wanted to start out with. Eventually, I would like to be able to manage everything from the dashboard, but for now, displaying some stats is good enough.

      For the time being, I just have PHP running some of my bash commands, but I would like to learn how to do everything in PHP–I still have a lot to learn!

  2. Why don’t you use this web interface with the 2,8 LCD with real time stadistics? I think it’s a good idea.

    Regards and good work.

    1. It might work, but you may also lose some performance by enabling the GUI. I’m not quite sure how to refresh the data though… I still have more to learn in PHP before I can do that.


  3. What is the current status of the dashboard? I only ask because the version I have looks like a cut down version of the demo, i.e. no restart/update option, ‘more info’ options don’t do anything. Is there a more recent version or am I up-to-date? I like what I’m seeing with this project so I can see myself donating!

    1. A couple of weeks ago, I removed the restart/update buttons from the Web interface because they were pretty slow and didn’t provide the user with any feedback. I’m working on something that will show the same output in the browser that you see when running the script from the command line. If you want those features back, just copy the index.php at the link provided and replace it with what’s on your Pi.

      I would also like to add some historical information such as how many ads have been blocked since the Pi-hole was activated.

  4. Jacob, If you can make this into a Router OS. I’m sure this will improve the utility of the Raspberry Pi 2.

  5. The webUI isn’t working for me. I’m on DietPi v 93 and I used the image file but when going to it says it doesn’t exist, but then when i just go to it says blocked by pi-hole

  6. Really like the Web Interface Dashboard! But the “Ads Blocked Today” doesn’t reset each day. Instead, the number of ads blocked just keep adding to the previous days. I tried truncating the pihole.log and the time and date is correct. Any ideas on a fix for this?

  7. Feature Suggestion:
    autotruncate but then everyday it collections the data from the current day and adds them to some nice statistics/graphs 🙂

  8. When I fire up the Web Interface, it reports no stats at all, although I queried pi-hole and the log file is reporting blocking ads. Thoughts? Help?

        1. OK. DietPi is pretty outdated. It’s a fork of the Pi-hole and it uses some slightly different software. I would suggest installing Raspbian Lite, and then running our install command: curl -L install.pi-hole.net | bash

          1. Oh. One of the reasons I installed DietPi is that it had the web interface already installed in it. If I wipe clean, what are the step by step instructions to do so and install whatever you recommend? Kep in mind I am not as technically adept as you guys 🙂

          2. Also, the DietPi Image I installed was “Jessie” which is the same as Raspian, right?

          3. I would just avoid the DietPi all together as we can’t actively update it.

            Our installer now installs the Web interface by default, plus you will always be able to continue to get updates.

          4. Also, since the web interface was preinstalled, I’m trying to figure out why it won’t work.

          5. Coming from the dietpi image, how do I go about setting the static IP and setting up dnsmasq (if I need to). Dietpi would not respond to dns requests and any webpage would say that the DNS probe failed, even though dnsmasq was running on the raspi. I’m a bit over my head with this, but the chromecast and android ads are starting to get to me.

Leave a Reply