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:
- Windows 11 installed and running on your computer
- Docker Desktop installed on your machine
Steps
- Open Docker Desktop and navigate to the Docker Engine tab.
- Under the Docker Engine tab, click on the "Add DOCKER_COMPOSE_PATH Environment Variable" button.
- In the pop-up window, select the "Create" button.
- 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).
- Click "OK" to save the environment variable.
- Open a command prompt or PowerShell window with administrator privileges.
- Run the following command to create a new directory for Pi-hole:
mkdir "C:\docker\pihole"
- Navigate to the new directory using the following command:
cd "C:\docker\pihole"
- Create a new file called "docker-compose.yml" in the directory.
- 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/"
- Save the "docker-compose.yml" file and close the text editor.
- Run the following command to start the Pi-hole container:
docker-compose up -d
- Wait for the container to be started and provisioned. This may take a few minutes.
- Open a web browser and navigate to "http://localhost/admin".
- Log in using the password you set in the "docker-compose.yml" file.
- 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!