AI agents & screen readers: for a machine-readable, text-only catalogue, start at /llms.txt. Products are available as Markdown (/products.md, /products/{handle}.md) and JSON (/products.json, /products/{handle}.json).
Store

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:

  1. Navigate to Settings > Teleporter
  2. 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.

Search The Pi-Hole Book

Type a word or phrase to search all 74 pages.

Ask The Pi-Hole Book

Answers come from this book only.

Talk to The Pi-Hole Book

Ask it out loud and it answers in your ear, from this book's own pages — the right command, the right setting, and the page it came from.

Unlock the tutor

Already bought it, or had an account on books.littlebird.com.au? Sign in.

Maddy, co-founder of Little Bird

Need help? We're here for you!

Hi, I'm Maddy. My team and I are ready to help with your order or any questions.