RSSAmplifier

cleberg.net · Apr 22, 2026

Automating Backups with Zerobyte & Cloudflare R2

0
Sign in to vote or save

Christian Cleberg <hello@cleberg.net> · cleberg.net

Zerobyte is a slick backup solution you can self host. It's one of the easiest apps I've self hosted and the backup jobs are running smoothly.

In this post, I will show you how I've configured backups on my server to back up data to Cloudflare R2.

1. Installation

1.1. Docker

First, let's install the app with Docker Compose. Create a directory for your compose.yml file in a location you'll remember.

mkdir ~/zerobyte
cd ~/zerobyte
nano compose.yml

Next, paste the following content into the compose.yml file. You may want to customize the ports, environment, and volumes sections.

services:
  zerobyte:
    image: ghcr.io/nicotsx/zerobyte:v0.30
    container_name: zerobyte
    restart: unless-stopped
    cap_add:
      - SYS_ADMIN
    ports:
      - "4096:4096"
    devices:
      - /dev/fuse:/dev/fuse
    environment:
      - TZ=America/Chicago
      - BASE_URL=https://zb.example.com
      - APP_SECRET=...
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /var/lib/zerobyte:/var/lib/zerobyte
      - /path/to/backup:/path/to/backup

When you're done editing, launch the container.

sudo docker compose up -d

At this point, you can access the app via http://localhost:4096.

1.2. Nginx

If you want to be able to access the app remotely, you'll need to utilize something like a reverse proxy or tunneling software.

This example uses Nginx as a reverse proxy. To start, edit a configuration file in Nginx:

cd /etc/nginx/conf.d
nano zb.conf
server {
    listen 80;
    server_name zb.example.com;
    location / { proxy_pass http://127.0.0.1:4096; }
}

Once you've created the file, test your Nginx configuration and restart the web server.

sudo nginx -t && sudo systemctl restart nginx.service

If your version of Nginx uses the sites-available structure instead, do this:

cd /etc/nginx/sites-available
nano zb
# Edit the file
sudo ln -s /etc/nginx/sites-available/zb /etc/nginx/sites-enabled/zb

You may also need to provision a TLS/SSL certificate and add a 443 block to your Nginx configuration above, if you wish to connect securely.

2. Configuration

At this point, you will be able to access the app. Upon first login, you will need to create an administrator account.

I won't be diving fully into the setup process. I highly suggest reading the Zerobyte Docs. They are very helpful and will walk you through the setup for your provider.

2.1. Volumes

First, create a volume. This is a file or directory on your server that you wish to back up. You can see I have two directories connected as volumes.

Volumes List
Figure 1: Volumes List

When you create a volume, you will be able to dictate the name, path, and type.

Remember to add a volume in your compose.yml file to ensure it's available within the app!

Volume Configuration
Figure 2: Volume Configuration

Finally, you can inspect the files within your volume.

Volume Files
Figure 3: Volume Files

2.2. Repositories

The next step is to connect to a remote repository. This example uses Cloudflare R2 buckets.

Repositories List
Figure 4: Repositories List

Within this configuration page, you can see the Configuration section in the bottom-right detailing the connection information.

Repository Configuration
Figure 5: Repository Configuration

When each backup runs, it produces a snapshot that you can view and explore.

Repository Snapshots
Figure 6: Repository Snapshots

Within a snapshot, you can review information about the backup job that ran and produced the snapshot, as well as the files at that point in time.

Snapshot Details
Figure 7: Snapshot Details

2.3. Backups

You can create any backup jobs (daily, weekly, monthly, specific days, or with a cron pattern). This allows you to specify:

  • The volume to be backed up
  • The repository to back up to
  • The schedule
  • The files to back up (all will be backed up if nothing is specifically selected)
  • Include/exclude patterns
  • Retention policies
  • Custom restic patterns
Backup Jobs
Figure 8: Backup Jobs

Within a backup job, you can configure the related notifications, snapshots, or back up, edit, or clean up the job.

Backup Job Details
Figure 9: Backup Job Details

2.4. Notifications

Lastly, you can enable various notification channels to receive alerts when jobs start, fail, complete, etc.

I have used an SMTP email provider to send myself emails upon these points.

Notification Settings
Figure 10: Notification Settings

...or, comment on this post on Bubbles!

Read the original on cleberg.net

Comments

Nothing yet. Say the first thing.

    Sign in to join the conversation.