Tutorial: How to Install Pi-hole on Windows 11

Introduction

Pi-hole is an open-source network-wide ad blocking solution that can be installed on a Raspberry Pi or as a virtual machine on a variety of platforms. In this tutorial, we will walk through the process of installing Pi-hole on Windows 11 using Docker.

Prerequisites

Before you begin, make sure you have the following:

Steps

  1. Open Docker Desktop and navigate to the Docker Engine tab.
  2. Under the Docker Engine tab, click on the "Add DOCKER_COMPOSE_PATH Environment Variable" button.
  3. In the pop-up window, select the "Create" button.
  4. Name the new environment variable "DOCKER_COMPOSE_PATH" and set the value to "C:\Program Files\Docker\docker-compose.exe" (or wherever Docker-compose is installed on your machine).
  5. Click "OK" to save the environment variable.
  6. Open a command prompt or PowerShell window with administrator privileges.
  7. Run the following command to create a new directory for Pi-hole: mkdir "C:\docker\pihole"
  8. Navigate to the new directory using the following command: cd "C:\docker\pihole"
  9. Create a new file called "docker-compose.yml" in the directory.
  10. Open the "docker-compose.yml" file in a text editor and add the following content:
version: "3"
services:
  pihole:
    container_name: pihole
    image: pihole/pihole:latest
    environment:
      TZ: America/New_York # Replace with your timezone
      WEBPASSWORD: YourPasswordHere # Replace with your desired password
    ports:
      - "53:53/tcp"
      - "53:53/udp"
      - "80:80/tcp"
      - "443:443/tcp"
    dns:
      - 127.0.0.1
      - 1.1.1.1 # Replace with your preferred DNS provider
    volumes:
      - "./etc-pihole/:/etc/pihole/"
      - "./etc-dnsmasq.d/:/etc/dnsmasq.d/"
  1. Save the "docker-compose.yml" file and close the text editor.
  2. Run the following command to start the Pi-hole container: docker-compose up -d
  3. Wait for the container to be started and provisioned. This may take a few minutes.
  4. Open a web browser and navigate to "http://localhost/admin".
  5. Log in using the password you set in the "docker-compose.yml" file.
  6. Optionally, configure your router or individual devices to use the Pi-hole server for DNS resolution, which will enable ad-blocking across your entire network.

Conclusion

Congratulations, you have successfully installed Pi-hole on Windows 11 using Docker. You can now enjoy ad-free browsing on all of your devices on your network.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!