Table of Contents
TODO
To get a local copy up and running follow these example steps.
- Clone
git clone --recurse-submodules URL
Create a .env file at stage2-custom/00-docker/files, with a structure as follows:
| Variable | Description |
|---|---|
| DEVICE_IP | IP address of the device |
| WIREGUARD_HOST | The public hostname of the VPN server[1] |
| WIREGUARD_PASSWORD | Password for the WireGuard Web UI[1] |
| WIREGUARD_PORT | The host public UDP port for WireGuard[1] |
| PIHOLE_PASSWORD | Password for Pi-hole Web UI[2] |
| PIHOLE_PORT | Port for Pi-hole Web UI[2] |
| PIHOLE_API_KEY | API key for Pi-hole[2] |
| HOMEPAGE_PORT | Port for the homepage WEB UI[3] |
Note: The variable PIHOLE_API_KEY is set only after containers have been created, by generating the key at Pi-hole WEB UI -> Settings -> API -> Show API token.
Create a .config file in the root directory, with a structure as explained in the Pi-gen documentation
Note: A configuration file example is provided in the root directory as .config.example, which can be renamed to .config, and used as is after editing the empty variables.
| Variable | Description |
|---|---|
| PUBKEY_SSH_FIRST_USER | SSH public key for the user |
| SSH_PORT | SSH port |
Create the image
./build-image.shFlash the image to an SD card using a tool such as Raspberry Pi Imager or balenaEtcher and insert it into the Raspberry Pi.
- Router configuration
- Set device IP to
DEVICE_IPas static - Port forward the
DEVICE_IPin your router to access Wireguard for an external network.
- Set device IP to
- RaspberryPi configuration
- You will be prompted to configure the keyboard layout, user and password on first boot.
Edit the SSH port by runningsudo nano /etc/ssh/sshd_configand changing the line#Port 22toPort SSH_PORT.
- Create the containers
- Run
docker compose up -din~/project/dockerto create the containers. - Generate the API key for Pi-hole at
Pi-hole WEB UI -> Settings -> API -> Show API tokenand set it in the.envfile. - Restart the containers by running
docker compose restartin~/project/dockerto apply the changes.
- Run
Access at the homepage at http://DEVICE_IP:HOMEPAGE_PORT, from where you can access the Pi-hole and Wireguard WEB UIs.
- Edit SSH port directly in
stage2-custominstead of post setup
Distributed under the MIT License. See LICENSE.txt for more information.
Contact me for any questions or suggestions at LinkedIn