๐ Nebula Sync
![]()
Nebula Sync keeps two or more Pi-hole v6 instances identical. One Pi-hole is the primary, all others are replicas: on a schedule they take over block lists, allow/deny lists, groups, clients and (optionally) DNS settings from the primary โ using the official Pi-hole v6 API.
It replaces the old Gravity Sync, which was built for Pi-hole v5 and copies the database files directly. With Pi-hole v6 that can leave a broken gravity.db behind, and then the Pi-hole silently blocks nothing.
๐ท๏ธ Category: Network, Tools
๐ณ Image: ghcr.io/lovelaze/nebula-sync:latest
โ ๏ธ Requires: Pi-hole v6 on all instances ยท an app password per Pi-hole ยท webserver.api.app_sudo = true on every Pi-hole
๐ Links
| ย | ย |
|---|---|
| ๐ฆ Project | github.com/lovelaze/nebula-sync |
| ๐ Support | GitHub Issues |
๐ Network
| Setting | Value |
|---|---|
| Network mode | bridge |
| Ports | none โ the container only makes outgoing connections to the Pi-hole APIs |
๐พ Volumes
None. Nebula Sync is stateless.
โ๏ธ Environment Variables
| Variable | Default | Masked | Description |
|---|---|---|---|
PRIMARY | http://192.168.1.2\|APP_PASSWORD | โ | Primary Pi-hole: http://IP\|app-password |
REPLICAS | http://192.168.1.3\|APP_PASSWORD | โ | Replica(s), several separated by a comma |
CRON | */15 * * * * | โ | Sync schedule |
TZ | Europe/Vienna | โ | Timezone |
RUN_GRAVITY | true | โ | Rebuild gravity on the replicas after a sync |
FULL_SYNC | false | โ | true = full Teleporter sync (whole config incl. webserver/TLS); false = only the parts below |
SYNC_CONFIG_DNS | true | โ | Upstreams, local DNS records, CNAMEs |
SYNC_CONFIG_DHCP / NTP / RESOLVER / DATABASE / MISC / DEBUG | false | โ | Host-specific settings โ usually keep them per Pi-hole |
SYNC_GRAVITY_GROUP / AD_LIST / AD_LIST_BY_GROUP | true | โ | Groups and block lists |
SYNC_GRAVITY_DOMAIN_LIST / DOMAIN_LIST_BY_GROUP | true | โ | Allow/deny lists (exact + regex) |
SYNC_GRAVITY_CLIENT / CLIENT_BY_GROUP | true | โ | Clients and their groups |
SYNC_GRAVITY_DHCP_LEASES | false | โ | DHCP leases |
๐ Setup
- On every Pi-hole: Settings โ Web interface / API โ Expert โ Configure app password โ copy it โ Enable new app password. Note: a Pi-hole has only one app password. Other tools that use it (e.g. the Home Assistant Pi-hole integration) need the new one, too.
- On every Pi-hole allow the app password to change settings:
pihole-FTL --config webserver.api.app_sudo true - Install the template and fill in
PRIMARYandREPLICAS, e.g.http://192.168.1.2|<app password of Pi-hole 1>. - Check the log:
docker logs Nebula-SyncA successful run ends with
Sync completed.
From now on, make changes only on the primary โ the replicas are overwritten on the next run.
๐ ๏ธ Troubleshooting
| Problem | Fix |
|---|---|
401 / unauthorized | Wrong app password, or a new one was generated after setup |
403 / forbidden when writing | webserver.api.app_sudo is not true on that Pi-hole |
| Replica settings keep changing back | Thatโs expected โ edit the primary instead |
| Migrating from Gravity Sync | Disable it first on all Pi-holes: systemctl disable --now gravity-sync.timer โ never run both |
๐ก Best Practices
- Use app passwords, not the web login password
- Keep
FULL_SYNC=falseunless the Pi-holes are truly identical (TLS certificates and webserver settings are host-specific) - Monitor the replicas (e.g. Home Assistant Pi-hole integration: alert when domains being blocked drops)