Jump to content

pi-hole on Windows

 Share

This thread isn't about WHY you would run pi-hole on Windows, there are plenty of reasons why and why not, this is a guide for those that want to have pi-hole running on their Windows PC for one reason or another.

 

logo.png

 

 

We will be installing pi-hole on Windows, using Docker and WSL.

 

Requirements ;

  • Windows 10/11
  • WSL
  • Docker
  • Static IP on your local network for the PC you're installing this on
  • A router or DHCP server where you can modify the default DNS IP on your network (but that can be done manually if needed).

----------------------------------------------------

 

 

1. Activating Linux subsystems ;

 

click the start menu and search for "turn win" to get the "features" control panel application ;

Spoiler

image.png

 

In the Windows features, scroll down to "Windows Subsystems for Linux" and activate it (restart required).

Spoiler

image.png

 

Once restarted, you'll need to install the WSL 2 kernel from the link below ;

https://aka.ms/wsl2kernel

 

Download and run the wsl_update_x64.msi (no need to restart)

Spoiler

image.png

----------------------------------------------------

 

 

2. installing Docker;

 

With Docker, as requirement, you'll also need to enable virtualization in your BIOS ! Refer to your MB manual to make sure it's activated.

 

Docker installer ;

https://www.docker.com/products/docker-desktop/

 

Leave the options WSL 2 by default ;

Spoiler

image.png

Once installed, you'll ne to restart again

Spoiler

image.png

 

If you have a warning message about WSL 2 or about virtualization, it means you haven't one of the previous steps including activating virtualization in your BIOS, take the time to review everyting.

----------------------------------------------------

 

 

3. installing Pi-hole

 

Now that Docker is installed, you can install pi-hole by opening a command prompt and typing the following command ;

docker pull pihole/pihole

 

Once done, you should get the following ;

Spoiler

image.png

 

 

image.png

 

Don't click RUN right away, we need to configure your pi-hole first.

 

Open a command prompt, modify the following command and run it ;

docker run -d --name pihole -e ServerIP=*.*.*.* -e WEBPASSWORD=password -e TZ=America/Montreal -e DNS1=127.17.0.1 -e DNS2=8.8.8.8 -e DNS3=1.1.1.1 -p 80:80 -p 53:53/tcp -p 53:53/udp -p 443:443 --restart=unless-stopped pihole/pihole:latest

 

  • ServerIP needs to be the IP of the computer you're running Docker on, and as I mentioned earlier, it needs to be a static IP, meaning you'll have to get your router to reserve a specific IP for that PC. There are many ways to do that and many types of router, so if you're not sure, typing in Google you router model + reserve IP should give you instructions on how to accomplish that.
  • WEBPASSWORD is the admin password you want to have on your p-ihole
  • TZ is the timezone, the time zone formats are available here ; https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
  • DNS1 is your pi-hole localhost IP, then DNS2 and 3 are alternate DNS, I have put Cloudflare and Google DNS but you can put any other public DNS, or you can put your ISP DNS.

 

You can also use your pi-hole as a DHCP server, if that's the case, you'll need to modify the above command to include that, so here's the github for Docker pi-hole ;

https://github.com/pi-hole/docker-pi-hole

----------------------------------------------------

 

4. setting your pi-hole

 

Now your pi-hole should be running, and going to the URL 127.0.0.1/admin (or from another PC you can type you PC's IP instead of 127.0.0.1) sould bring you to your pi-hole webpage ;

Spoiler

image.png

 

You can click Login on the left, and from there modify the settings if needed, if you want to set up your pi-hole as a DHCP server, this is where you can do the setup.

----------------------------------------------------

 

 

5. Fix your router DNS

 

You last step is to go to your router settings and change the DNS, of if you're using your pi-hole as a DHCP server, change the DNS to your pi-hole static IP address, and don't forget to add a secondary DNS (like Cloudflare, Google, or OpenDNS), this in case your pi-hole has a problem, this will make sure your internet doesn't drop if something happens to your pi-hole or the PC it's running on.

 

If you need help with your forum account, please use the Forum Support form !

Link to comment
Share on other sites

Link to post
Share on other sites

Word of warning. Don't get overzealous with blocklists.

 

If you're the only person using the computer, ie it's not a family computer, then sure have at it.

 

Here's my pihole instance running on a Synology NAS. I do have to Whitelist some random-ass website for no known reason. Even rather well-known websites about IT or whatever.

 

I did tell my wife to let me know if any website isn't loading. She only asked once and I'm 99% sure she just forgets to ask and doesn't care why some sites aren't loading.

 

image.thumb.png.4d3629fc0853079c1abc9c477d7dbd23.png

 

 

CPU R7 1700    Motherboard Asus Prime X370 Pro  RAM  24GB Corsair LPX 3000 (at 2933Mhz)    GPU EVGA GTX1070 SC  Case Phanteks Enthoo Pro M    

Storage 1 x 1TB m.2, 1x 500GB SSD, 1x 1TB HDD, 1x 8TB HDD  PSU Corsair RM1000  Cooling Thermalright Macho Rev B (tower)

Synology NAS 1 x 4TB 1 x 8TB

Link to comment
Share on other sites

Link to post
Share on other sites

  • 4 months later...
2 hours ago, DesktopECHO said:

I have an install script that works in WSL1, no Docker or virtualization needed (or Linux kernel for that matter)

Pi-hole binaries show up in Task Manager just like any other Windows app:

 

https://github.com/DesktopECHO/Pi-Hole-for-WSL1

 

Just run PH4WSL1.cmd and in a few minutes you're good to go.

 

image.thumb.png.a485c025f687f363f67b5624255c2f35.png

 

how long did you use this blocklist for? just so people know if its not too fresh and thus may cause false positive blockings.

CPU R7 1700    Motherboard Asus Prime X370 Pro  RAM  24GB Corsair LPX 3000 (at 2933Mhz)    GPU EVGA GTX1070 SC  Case Phanteks Enthoo Pro M    

Storage 1 x 1TB m.2, 1x 500GB SSD, 1x 1TB HDD, 1x 8TB HDD  PSU Corsair RM1000  Cooling Thermalright Macho Rev B (tower)

Synology NAS 1 x 4TB 1 x 8TB

Link to comment
Share on other sites

Link to post
Share on other sites

On 9/20/2022 at 7:09 AM, FIXXX said:

how long did you use this blocklist for? just so people know if its not too fresh and thus may cause false positive blockings.

My post was regarding a Pi-hole installer for Windows 10 -- I just use the blocklist shipped with the upstream Pi-hole installer as it's enough for my needs.

Occasionally I'll run Gravity Update to update the blocklist. 

 

image.thumb.png.5c1ee0f1a417c304fba445414d71b3c3.png

 

image.png.667cac93a1477ef160d6504d14f4c54d.png

 

Link to comment
Share on other sites

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share


×