IAmStoxe / wirehole

WireHole is a combination of WireGuard, Pi-hole, and Unbound in a docker-compose project with the intent of enabling users to quickly and easily create a personally managed full or split-tunnel WireGuard VPN with ad blocking capabilities thanks to Pi-hole, and DNS caching, additional privacy options, and upstream providers via Unbound.
https://iamstoxe.com
Other
4.63k stars 312 forks source link
ad-blocking adblock dns dns-provider docker pi-hole pihole unbound vpn wireguard

What is this?

WireHole is a docker-compose project that combines WireGuard, PiHole, and Unbound to create a full or split-tunnel VPN that is easy to deploy and manage. This setup allows for a VPN with ad-blocking via PiHole and enhanced DNS privacy and caching through Unbound.

Author

👤 Devin Stokes

🤝 Contributing

Contributions, issues, and feature requests are welcome! Feel free to check the issues page.

Show your support

Give a ⭐ if this project helped you!

Buy Me A Coffee


Supported Architectures

The image supports multiple architectures such as x86-64, arm64, and armhf. The linuxserver/wireguard image automatically selects the correct image for your architecture.

The architectures supported by this image are:

Architecture Tag
x86-64 amd64-latest
arm64 arm64v8-latest
armhf arm32v7-latest

Quickstart

To begin using WireHole, clone the repository and start the containers:

#!/bin/bash

# Clone the WireHole repository from GitHub
git clone https://github.com/IAmStoxe/wirehole.git

# Change directory to the cloned repository
cd wirehole

# Update the .env file with your configuration
cp .env.example .env
nano .env  # Or use any text editor of your choice to edit the .env file

# Replace the public IP placeholder in the docker-compose.yml
sed -i "s/REPLACE_ME_WITH_YOUR_PUBLIC_IP/$(curl -s ifconfig.me)/g" docker-compose.yml

# Start the Docker containers
docker compose up

Remember to set secure passwords for WGUI_SESSION_SECRET, WGUI_PASSWORD, and WEBPASSWORD in your .env file.


Environment Configuration Details

The .env file contains a series of environment variables that are essential for configuring the WireHole services within the Docker containers. Here is a detailed explanation of each variable:

General Settings

User / Group Identifiers

Network Settings

WireGuard Settings

WireGuard-UI Settings

Pi-hole Settings

Remember to replace any default or placeholder values with secure, unique values before deploying your services.


Recommended Configuration / Split Tunnel

For a split-tunnel VPN, configure your WireGuard client AllowedIps to 10.2.0.0/24, which will route only the web panel and DNS traffic through the VPN.


Accessing the Web Panel (WireGuard-UI)

Manage your WireGuard VPN through the WireGuard-UI at:

http://{YOUR_SERVER_IP}:5000

Log in with the WGUI_USERNAME and WGUI_PASSWORD you have set in your .env file.

Features of WireGuard-UI


Access PiHole

Connect to WireGuard and access the Pi-hole admin panel at http://10.2.0.100/admin. The login password is the one set as WEBPASSWORD in your .env file.


Dynamic DNS (DDNS)

Configure DDNS by setting WG_HOST in your .env file to your DDNS URL.

wireguard:
  environment:
    - WG_HOST=my.ddns.net

Configuring / Parameters

Explain all the environment variables from your .env file here. (Refer to the previous section where we provided a table of explanations for each variable.)


Additional Settings and Considerations

Discuss any additional settings such as Docker secrets, umask settings, user/group identifiers, adding clients, modifying DNS providers, and networking considerations. Make sure to update any instructions to match the current setup.


Support and Updates

Provide information on how to access the shell while the container is running, view logs, update containers, and handle frequently asked questions. Ensure all the commands and steps are updated to reflect the current versions and practices.


Acknowledgements

Credit to LinuxServer.io for their maintenance of the Wireguard image and other contributions to the project.