content/blog/2026-04-22-self-hosting-zerobyte.org

2272f4bf412ab26c57517e9c369f8859cd269bb1
cleberg.net/content/blog/2026-04-22-self-hosting-zerobyte.org rendered · source · history · blame · raw

182 lines · 5536 bytes

8 symbols in this file

Automating Backups with Zerobyte & Cloudflare R2

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.

Installation

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.

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.

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.

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_01
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!

volumes_02
Volume Configuration

Finally, you can inspect the files within your volume.

volumes_03
Volume Files

Repositories

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

repositories_01
Repositories List

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

repositories_02
Repository Configuration

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

repositories_03
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.

repositories_04
Snapshot Details

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
backups_01
Backup Jobs

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

backups_02
Backup Job Details

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.

notifications
Notification Settings