Backing Up Your NAS

Backing Up Your NAS to Backblaze B2 with Duplicacy

One of the core goals of a well-designed home server environment is resilience. RAID protects against drive failure. A UPS protects against power events. But none of that is a replacement for real, off-site backups. Today we’re setting up that final pillar: backing up your NAS to the cloud using Duplicacy—a fast, deduplication-focused, encrypted backup tool that’s ideal for small servers and home labs.

We’ll walk through installing Duplicacy, configuring a Backblaze B2 bucket, connecting it all together, and scheduling automated versioned backups.


Why Duplicacy?

Although many NAS platforms include their own backup solutions, Duplicacy stands out in a few key areas:

  • Global deduplication: It avoids re-uploading identical blocks across folders, drives, and even across different machines if you want multiple systems backed up to the same B2 bucket.
  • Efficient encryption: All data is encrypted client-side, meaning Backblaze never sees your unencrypted files.
  • Cross-platform: Works well on Unraid, TrueNAS, Synology, Docker, Windows, Linux.
  • Fast incremental backups: After the initial upload, backups are delightfully quick.

For a home server holding terabytes of photos, documents, containers, and media metadata, this efficiency matters.


Create a Backblaze B2 Bucket

Before configuring Duplicacy, we need a destination repository in Backblaze B2 Cloud Storage.

1. Log into Backblaze

Go to your Backblaze account dashboard and open the B2 Cloud Storage section.

2. Create a Bucket

  • Click Create Bucket.
  • Choose a name (e.g., home-nas-backup).
  • Set visibility to Private.
  • Leave other options at defaults unless you have specific lifecycle rules in mind.

3. Create Application Keys

Duplicacy will connect using its own set of B2 credentials.

  • Under App Keys, click Add a New Application Key.
  • Give it a name like duplicacy-nas-key.
  • Limit access to only the bucket you just created.
  • Copy:
    • KeyID
    • ApplicationKey

Keep these secure—you’ll need them during setup.


Install Duplicacy

You can install Duplicacy in several ways: native packages, CLI, or Docker. For modern NAS setups, Docker is often the easiest and cleanest.

Below is a typical setup using a Docker container.

On Unraid (or similar Docker-based NAS):

  1. Open your Docker management UI.
  2. Search for Duplicacy Web Edition (often from saspus/duplicacy-web or similar).
  3. Install with the following common mappings:
    • /config → Appdata folder (e.g., /mnt/user/appdata/duplicacy)
    • /storage → The directories you want backed up (e.g., /mnt/user)
  4. Expose port 3875 (Duplicacy Web UI) to LAN.

Once deployed, navigate to:

http://<NAS-IP>:3875

The first run will request a password and will initialize the management dashboard.


Initialize Your Backup Repository

Once inside Duplicacy’s Web UI:

1. Add a Storage

This tells Duplicacy where to upload the backup.

  • Click StorageAdd Storage.
  • Choose Backblaze B2.
  • Enter:
    • Bucket Name
    • Key ID
    • Application Key
  • Set a storage name (e.g., b2-cloud).
  • Choose encryption (highly recommended).
  • Select a local working directory (e.g., /config or /storage/.duplicacy depending on your layout).

2. Add a Backup

Now that storage is defined:

  • Click BackupsAdd Backup.
  • Choose the folder you want to back up (e.g., /storage/photos, /storage/documents, or entire /storage).
  • Assign this backup to the b2-cloud storage location.

Duplicacy will scan and index your data, preparing the initial snapshot.


Scheduling and Retention Policies

Backups are only useful if they happen automatically and keep a manageable number of restore points.

Set Up a Backup Schedule

  • Go to Schedules.
  • Create a new schedule:
    • Action: Backup
    • Backup: Select your NAS backup job
    • Frequency: Daily or every few hours depending on your needs
    • Time: Off-peak hours (e.g., 2:00 AM)

Duplicacy will now run incremental backups reliably in the background.

Configure Pruning

Retain a sensible history while avoiding runaway storage costs.

A common retention policy:

  • Keep hourly backups for 24 hours
  • Keep daily backups for 30 days
  • Keep monthly backups for 12 months

Duplicacy’s prune system can express policies like:

-keep 0:30    # Keep all revisions for 30 days
-keep 7:365   # Keep weekly snapshots for 1 year
-keep 30:1800 # Keep monthly snapshots for ~5 years

Add this as a Prune action in your schedule, usually right after each backup.


Testing Your Backup

Never trust backups you haven’t tested.

1. Run a Restore Test

  • Create a temporary restore folder.
  • Choose Restore.
  • Select a recent snapshot.
  • Restore a small subset of files to confirm:
    • Decryption works
    • File integrity is intact
    • Permissions look correct

2. Check Backblaze Usage

Backblaze’s dashboard will show growing object counts and storage usage as Duplicacy uploads blocks.

If you see activity there—success!


Tips for Optimization

Exclude Large, Unnecessary Datasets

Avoid backing up:

  • Cache directories
  • VM images you can rebuild
  • Temp folders
  • Bulk media libraries you have elsewhere

Duplicacy supports a simple filters file to include/exclude paths.

Monitor Your Backup Health

Duplicacy Web includes:

  • Logs for each run
  • Snapshot browser
  • Storage integrity checks

Running a periodic Check job is a very good idea.

Bandwidth Control

Backblaze does not throttle uploads, so you may want to:

  • Limit Duplicacy’s upload threads
  • Schedule backups during nighttime hours

With Duplicacy backing up your NAS to Backblaze B2, you now have a secure, encrypted, versioned off-site backup protecting your most important data. This setup strikes an ideal balance between performance, cost-efficiency, and reliability—perfect for a home server that’s grown into a central part of your digital life.

Up next, we’ll explore restoring from snapshots, disaster recovery planning, and how to monitor backup health over time.