Pi-hole HTTPS Setup π
This repository automates the setup of a secure HTTPS connection for your Pi-hole server, including automatic detection and support for Tailscale. It supports both older Pi-hole versions (using Lighttpd) and Pi-hole 6.0+ (using the built-in FTL webserver).
Features π
- Automatically generates SSL certificates and configures your Pi-hole for HTTPS.
- Detects Tailscale setup and includes it in the SSL configuration.
- Supports both Lighttpd (pre-6.0) and FTL webserver (6.0+).
- Certificate works seamlessly with Windows, Linux, Android, MacOS, and iOS.
- Simplifies the process with a single command.
Single Command Setup β
Secure your Pi-hole with HTTPS in just one simple command:
curl -fsSL https://raw.githubusercontent.com/luizbizzio/pihole-https/main/pihole-https.sh | sudo bash
What Happens Next? π
- π No manual setup needed: The script detects your environment and applies the SSL certificate.
- π Supports Tailscale: If Tailscale is installed, it will include its DNS in the SSL configuration.
- π HTTPS applied: Your Pi-hole admin interface will be secured with HTTPS.
- β‘ Supports both Pi-hole 6.0+ and older versions: Automatically detects whether to configure Lighttpd or FTL webserver.
π Support the Project
If this script saved you time or solved a headache, consider dropping a star on the repo!
It helps others discover the project and keeps the motivation going π
Thanks for the support! π
Result Preview ποΈ
Hereβs how your Pi-hole interface will look with HTTPS enabled and a valid certificate:

How It Works π οΈ
-
Hostname and IP Detection:
- Detects your Pi-hole's hostname and IP addresses automatically.
- If Tailscale is installed, it also includes the Tailscale DNS in the SSL configuration.
-
SSL Certificate Generation:
- Creates an SSL certificate for your Pi-hole server, valid for 10 years.
-
Webserver Configuration:
- If Pi-hole pre-6.0 is detected, Lighttpd is configured for HTTPS.
- If Pi-hole 6.0+ is detected, the new built-in FTL webserver is configured for HTTPS.
-
Certificate Accessibility:
- The certificate is saved locally and ready for use on all major platforms.
Installing the Certificate on Devices π±π»
Once the script completes, you'll need to install the certificate on your devices for secure access.
Windows πͺ
- Download the certificate file.
- Open the certificate by double-clicking it.
- Click Install Certificate, choose Local Machine, and proceed.
- Select Trusted Root Certification Authorities and complete the wizard.
- Restart your browser or application to apply the changes.
Linux π§
- Copy the certificate to
/usr/local/share/ca-certificates/
.
- Rename the file with a
.crt
extension if necessary.
- Run:
sudo update-ca-certificates
- Restart your browser or application to apply the changes.
Android π±
- Download the certificate file to your device.
- Go to Settings > Security > More security & Privacy > Install a Certificate.
- Select the file and follow the instructions.
- Restart your browser or application to apply the changes.
MacOS π
- Download the certificate file.
- Open Keychain Access.
- Drag the certificate into the System keychain.
- Right-click the certificate, select Get Info, and set Trust to Always Trust.
- Restart your browser or application to apply the changes.
iOS π±
- Download the
.crt
file to your iPhone or iPad.
- Open the Settings app.
- Go to General > VPN & Device Management > Certificate.
- Select the certificate file from your Downloads.
- Install the certificate and confirm when prompted.
- After installation, go to Settings > General > About > Certificate Trust Settings.
- Enable trust for your new certificate.
- Restart your browser or application to apply the changes.
Notes π
- The script automatically detects whether Lighttpd (pre-6.0) or FTL webserver (6.0+) is in use and configures HTTPS accordingly.
- The script skips Tailscale detection if it is not installed.
- Compatible with most major browsers and operating systems.
- Not compatible with Docker. β
- If you donβt use the
pi.hole
domain or you use custom ports in Lighttpd, itβs recommended that you download the pihole-https.sh
file and adjust it to match your setup. β οΈ
License π
This repository is licensed under the MIT License.
Enjoy secure Pi-hole browsing! π