Backup and restore procedures
Maintenance and Monitoring
1. Backing Up Pi-hole Settings
Using the Web Interface
- Navigate to Settings > Teleporter
- Click "Backup" to download a .tar.gz file containing:
- Blocklists
- Whitelists and blacklists
- Custom DNS entries
- DHCP settings (if enabled)
Using the Command Line
Run the following command:
pihole -a -t
This will generate a downloadable backup file.
2. Restoring Pi-hole Settings
Using the Web Interface
- Navigate to Settings > Teleporter
- Click "Restore" and upload your previously backed-up .tar.gz file
Manual Restore via Command Line
- Transfer the backup file to your Pi-hole server
- Extract the backup:
bash tar -xvzf <backup_file>.tar.gz -C /etc/pihole/ - Restart Pi-hole services:
bash sudo service pihole-FTL restart
3. Full System Backup (Optional)
To create a complete backup of the Pi-hole server using tar:
sudo tar -czvf pihole_backup.tar.gz /etc/pihole /etc/dnsmasq.d
Restoring a Full System Backup
sudo tar -xzvf pihole_backup.tar.gz -C /
sudo service pihole-FTL restart
Best Practices
Automate regular backups using a cron job:
echo "0 3 * * * pihole -a -t" | crontab -This schedules a backup every day at 3 AM.
Store backups in a separate location, such as cloud storage or external media.
Periodically test your backup restores on a secondary system to ensure they work correctly.
Something here not working for you? Ask in the community — other makers and the Little Bird team read it.