Backup strategies
Best Practices and Optimization
Web Interface Backup (Teleporter)
Access Pi-hole's built-in backup tool through the admin console at http://<Pi-hole-IP>/admin:
- Navigate to Settings > Teleporter
- Click "Backup" to download a ZIP file containing:
- Blocklists
- Whitelists and blacklists
- Custom DNS records
- DHCP configuration (if enabled)
To restore, simply upload the ZIP file through the same interface.
Command-Line System Backup
Create a complete system backup using these commands:
# Create backup directory
`mkdir -p ~/pihole-backup`
# Copy configuration files
sudo cp -r /etc/pihole ~/pihole-backup/
sudo cp -r /etc/dnsmasq.d ~/pihole-backup/
# Create compressed archive
tar -czvf pihole-backup.tar.gz ~/pihole-backup/
To restore, copy files back to their original locations and restart services:
sudo systemctl restart pihole-FTL
Automated Backups
Set up automated backups using cron:
# Edit crontab
crontab -e
# Add daily backup at 2 AM
0 2 * * * tar -czvf /home/pi/pihole-backup-$(date +\%F).tar.gz /etc/pihole /etc/dnsmasq.d
# Optional: Add remote backup
rsync -avz /home/pi/pihole-backup-*.tar.gz user@remote_server:/backup/
Version Control with Git
Track configuration changes using Git:
# Initialize repository
cd /etc/pihole
git init
git add .
git commit -m "Initial backup"
# Create automated backup script
echo 'cd /etc/pihole && git add . && git commit -m "Auto backup on $(date)"' >> ~/backup.sh
chmod +x ~/backup.sh
# Schedule automated commits
crontab -e
0 3 * * * ~/backup.sh
Backup Strategy Recommendations
- Local Backup: Suitable for systems with reliable storage
- Offsite Backup: Use rsync, SCP, or cloud storage for additional security
- Version Control: Track changes to configurations and blocklists
- Redundant Systems: Consider maintaining multiple Pi-hole instances with synchronized settings
Choose the backup method that best matches your needs for recovery time and data protection. Regular testing of your backup and restore procedures is recommended to ensure reliability.
Something here not working for you? Ask in the community — other makers and the Little Bird team read it.