βLocal HTTPS π
Formerly pihole-https
Automatic local HTTPS certificates for Pi-hole, Technitium DNS, Tailscale and homelabs
Local Root CA, trusted certificates, automatic renewal and service deployment
Β Β Β Β Β
Β Β Β Β Β
local-https automatically sets up and renews trusted HTTPS certificates for local web interfaces, so you do not have to manually create, deploy or renew certificates.
It creates a local Root CA and automatically configures supported services:
- β
Pi-hole - FTL webserver on Pi-hole 6+ or Lighttpd on older installations
- β
Technitium DNS - automatic deployment of a password-protected
.pfx certificate
- β
Tailscale - automatically adds your Tailscale DNS hostname to the certificate SANs
- β
Other services - generated PEM/PFX certificates can be used manually with Nginx, Grafana and more
After trusting the Root CA on your devices, you can access supported local web interfaces over HTTPS without browser certificate warnings.
Officially supported on Debian, Ubuntu, Raspberry Pi OS and Armbian. Other Linux distributions may work but are not officially supported.
π One-Step Install / Update
curl -fsSL https://raw.githubusercontent.com/luizbizzio/local-https/main/install.sh | sudo bash
The installer downloads and verifies the latest local-https, then installs it to /usr/local/sbin/local-https.
On a new installation, or if the initial setup was never completed, it asks whether you want to start the setup. If local-https is already configured, running the same command only updates the program and keeps your existing certificates and configuration.
Important
After installation, trust rootCA.crt on your devices to avoid browser certificate warnings.
Tip
Run sudo local-https --status at any time to check the installed version, current certificate status and last run information.
β¨ What it does
- π Creates (or reuses) a local Root CA (
rootCA.crt)
- πͺͺ Issues a server certificate (default: 40 days) with SANs for:
- hostname
- relevant LAN IPs (filtered)
- a configurable domain name (default
pi.hole)
- Tailscale DNS name when available
- π¦ Generates:
server.pem (cert + key, for services like Pi-hole)
server.pfx (password-protected, for services like Technitium)
- π Can enable automatic renewal via systemd timer (or cron fallback)
- β¬οΈ Can check GitHub for a newer version and update itself with
--update
- π§ On renewal, it only βdeploys/restartsβ if a new cert was actually created (unless forced)
π‘ Demo
π§ Usage
| Command |
What it does |
local-https --version / --v / -V |
Prints the installed local-https version |
sudo local-https --update |
Checks GitHub for a newer version and asks before updating |
sudo local-https --update --yes |
Updates without asking for confirmation |
sudo local-https --install |
Full setup (Root CA, server cert, PEM/PFX, permissions, auto-renew, optional Pi-hole deploy, Technitium TLS if detected) |
sudo local-https --renew |
Renew if needed (near expiry window). If nothing to do, exits fast |
sudo local-https --renew --force-renew |
Forces a new server certificate + rebuilds PFX + restarts detected services |
sudo local-https --status |
Shows the installed version, current status, and last run info |
sudo local-https --check |
Exit code indicates if renewal is needed |
sudo local-https --configure |
Re-run deploy steps for Pi-hole / Technitium without reinstalling everything |
sudo local-https --print-ca |
Prints rootCA.crt (useful to copy to devices) |
sudo local-https --print-pfx-pass |
Prints the PFX password (stored in a root-only file) |
sudo local-https --rotate-pfx-pass |
Rotates PFX password, rebuilds PFX, updates Technitium TLS settings |
sudo local-https --uninstall [--yes] [--purge-certs] |
Removes installed files and optionally deletes generated certs |
β¬οΈ Updating later
Once installed, you can check for a newer version without using the full curl command again:
sudo local-https --update
If a newer version is available, local-https shows the current and latest versions and asks before installing it. The update only replaces the program itself; your existing Root CA, certificates, state, and service configuration are kept.
For non-interactive updates:
sudo local-https --update --yes
βοΈ Reconfigure services
Use --configure when you want to re-detect and reapply supported service integrations without reinstalling local-https.
sudo local-https --configure
This re-checks Pi-hole and Technitium, reapplies certificate permissions and TLS deployment, and keeps your existing Root CA and installation.
This is useful after installing or changing Pi-hole or Technitium, or when you want to run the integration setup again.
π Custom domain
The certificate includes a friendly domain name (default pi.hole). If your network uses a different local domain, you can configure it. The chosen domain is added to the certificate SANs and is remembered across renewals (stored in the state file).
The domain is resolved with the following precedence (highest first):
- CLI flag β
--domain (works with --install, --configure, and --renew):
sudo local-https --install --domain home.lan
sudo local-https --configure --domain dns.home
sudo local-https --renew --force-renew --domain home.lan
- Environment variable β
LOCAL_HTTPS_DOMAIN:
sudo LOCAL_HTTPS_DOMAIN=home.lan local-https --install
- Persisted state β whatever was chosen on the previous run (so renewals stay consistent).
- Pi-hole auto-detection β on a fresh install, if Pi-hole is detected the script reads its configured
webserver.domain (via pihole-FTL --config, falling back to /etc/pihole/pihole.toml) and uses that as the default.
- Default β
pi.hole.
During an interactive --install/--configure you are also prompted, pre-filled with the resolved value (press Enter to keep it).
To change the domain on an existing install, run sudo local-https --configure --domain <name> (or sudo local-https --renew --force-renew --domain <name>). The Root CA stays the same, so there is nothing new to trust on your devices.
π Auto-renew (how it works)
- π
The server certificate is issued for 40 days.
- β³
--renew only renews when the cert is close to expiry (default window: 7 days).
- π§© If you enable systemd timer, it runs daily (with randomized delay).
Check the timer:
systemctl list-timers | grep local-https
systemctl status local-https-renew.timer --no-pager
See logs:
journalctl -u local-https-renew.service -n 100 --no-pager
Force-run via systemd (without editing unit files):
sudo systemd-run --unit=local-https-renew-force --service-type=oneshot /usr/local/sbin/local-https --renew --force-renew
π§© Service support
π¦ Pi-hole
- Detects Pi-hole automatically.
- Supports:
- FTL webserver TLS (Pi-hole 6+)
- Lighttpd TLS (older setups)
- On renew (when a new cert is created), it restarts the correct service so the new cert is used.
π© Technitium DNS
- If Technitium is detected, the script can configure Technitium Web UI TLS to use:
server.pfx + the stored password
- Supports both legacy Technitium Linux installations running as root and newer non-root installations.
- If the Technitium
dns-server account exists, it is automatically granted access to the certs group. Custom non-root Technitium service users are supported as well.
- If the Technitium systemd service restricts filesystem access,
local-https automatically creates a systemd drop-in granting read-only access to server.pfx.
- On renew (when a new cert is created), it restarts the Technitium service so the new cert is loaded.
πͺ Tailscale
- If
tailscale and jq are available, the script adds your Tailscale DNS name (like host.ts.net) to the certificate SANs.
βοΈ Other services (Grafana, Nginx, etc.)
Any service that needs to read the certificate files can be granted access by adding its user to the certs group:
sudo usermod -aG certs grafana
sudo usermod -aG certs nginx
Group membership is preserved across renewals, once added, the service will continue to have access after every certificate rotation without any manual intervention.
Note
Hardened systemd services may restrict filesystem access and require an explicit ReadOnlyPaths= rule for the certificate files.
π¦ Files created
Default certificate directory:
Main files:
rootCA.crt
rootCA.key
server.crt
server.key
server.pem
server.pfx
.pfx-pass
State:
/var/lib/local-https/state.env
Warning
Keep rootCA.key private. Anyone with access to this key can issue certificates trusted by your local Root CA.
π±π» Install the Root CA on your devices
You must trust rootCA.crt on your device to avoid HTTPS warnings.
Get the certificate from the server:
- Print in terminal:
sudo local-https --print-ca
- Or copy the file:
/etc/ssl/servercerts/rootCA.crt
πͺ Windows
- Copy
rootCA.crt to your PC.
- Double-click it β Install Certificate
- Choose Local Machine
- Put it in Trusted Root Certification Authorities
- Reopen the browser.
π macOS
- Open Keychain Access
- Drag
rootCA.crt into System keychain
- Open the cert β set Trust to Always Trust
π± iOS / iPadOS
- AirDrop/email the
rootCA.crt to the device, open it
- Settings β General β VPN & Device Management β install profile
- Settings β General β About β Certificate Trust Settings β enable full trust
π€ Android
- Copy
rootCA.crt to the phone
- Settings β Security β Encryption & credentials β Install a certificate β CA certificate
- Note: some apps ignore user-installed CAs.
π§ Linux (Debian/Ubuntu)
sudo cp rootCA.crt /usr/local/share/ca-certificates/local-https-rootCA.crt
sudo update-ca-certificates
Why 40-day certificates
Public TLS Certificate Authorities and browser policies now favor shorter lifetimes (around 40β45 days) for security reasons. Our default 40-day validity matches this industry trend and avoids issues with browser trust and automated renewals. See SSL.comβs discussion on ~47-day certificates:
https://www.ssl.com/article/preparing-for-47-day-ssl-tls-certificates/
π Notes
- π·οΈ When reporting an issue, include the output of
local-https --version.
- π§± This is a local CA. It is for your own network and devices, not public HTTPS.
- π§ͺ If you are testing renew: use
sudo local-https --renew --force-renew and confirm the new notAfter date with OpenSSL.
- π§ Pi-hole Lighttpd mode may install
lighttpd-mod-openssl via apt-get.