What Directories need to Persist when reinstalling (or recreating a container)?

I've just started using Pi-hole and I am running it in a LXD container. I need to be able to drop and recreate the container so I would like to persist necessary directories outside the container so they survive a destroy/create.

In my particular case, the container is a vanilla upstream image (Alpine) into which I put setupVars.conf and a script that clones Pi-hole and runs the unattended installer.

I can see the Docker image persists /etc/pihole and /etc.dnsmasq.d. Are these all that need to be mounted into a clean container prior to running the unattended installer ? And, if I am not using dhcp, is persisting /etc/dnsmasq.d necessary or would only /etc/pihole be sufficient ?

I did find the FAQ What files does Pi-hole use? which would be a good place to cover this kind of thing. I expect that a lot of the files and directories it lists would be recreated by the install and therefore do not need to be persisted.

I'd already read that and checked what the compose file had. I'm just looking for a confirmation that /etc/pihole is all I need (as I am not using dhcp) and that the installer will provide everything else. Just incase it wasn't clear above... I'm using LXD (Linux Containers) not Docker :slight_smile:

You'll need both, even if you are not using dhcp. The pihole-FTL configuration files are in /etc/dnsmasq.d.

1 Like

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.