Installation
Zerobyte runs as a Docker container and requires Docker and Docker Compose to be installed on your server.Prerequisites
Install Docker
Ensure Docker is installed on your server. Visit docs.docker.com for installation instructions for your platform.
Install Docker Compose
Docker Compose is required for orchestration. It’s included with Docker Desktop or can be installed separately on Linux servers.
Basic Installation
The standard installation includes remote mount support (NFS, SMB, WebDAV, SFTP) and requires elevated container capabilities.1. Create docker-compose.yml
Create adocker-compose.yml file with the following configuration:
docker-compose.yml
2. Configure Environment Variables
Update the environment variables in yourdocker-compose.yml:
Required Environment Variables
| Variable | Description | Example |
|---|---|---|
BASE_URL | Required. The base URL where Zerobyte will be accessed. Used for cookie security and CORS. | http://localhost:4096 or https://zerobyte.example.com |
APP_SECRET | Required. A 32+ character random secret for encrypting sensitive data in the database. Generate with openssl rand -hex 32. | 94bad46...c66e25d5c2b |
TZ | Recommended. Timezone for accurate backup scheduling. | Europe/Paris, America/New_York, UTC |
The
BASE_URL determines cookie security behavior:- HTTP or IP addresses: Secure cookies disabled (allows local access)
- HTTPS with domain: Secure cookies enabled (required for production)
Optional Environment Variables
| Variable | Description | Default |
|---|---|---|
PORT | Port the web interface listens on inside the container | 4096 |
RESTIC_HOSTNAME | Hostname used by Restic in snapshots | zerobyte |
TRUSTED_ORIGINS | Comma-separated list of additional trusted CORS origins | (none) |
LOG_LEVEL | Logging verbosity: debug, info, warn, error | info |
SERVER_IDLE_TIMEOUT | Server idle timeout in seconds | 60 |
RCLONE_CONFIG_DIR | Path to rclone config directory inside container | /root/.config/rclone |
3. Configure Volume Mounts
The essential volume mount stores Zerobyte’s data:TrueNAS Users: The This ensures your configuration, encryption keys, and database persist across upgrades.
/var/lib path is ephemeral on TrueNAS and resets during system upgrades. Instead, create a dedicated ZFS dataset:4. Start Zerobyte
Start the container using Docker Compose:5. Access the Web Interface
Once the container is running, access Zerobyte at the URL you specified inBASE_URL:
Simplified Installation (No Remote Mounts)
If you only need to back up locally mounted directories and don’t require remote share mounting (NFS, SMB, WebDAV, SFTP), you can use a reduced-privilege deployment:docker-compose.yml
- ✅ Improved security by removing
SYS_ADMINcapability - ✅ Support for local directories mounted into the container
- ✅ All repository types still supported (local, S3, GCS, Azure, rclone)
- ❌ Cannot mount remote shares (NFS, SMB, WebDAV, SFTP) from within Zerobyte
If you need remote mount capabilities later, you can update your
docker-compose.yml to add back the cap_add: SYS_ADMIN and devices: /dev/fuse:/dev/fuse directives.Mounting Local Directories
To back up directories from your host system, mount them into the container:/photos, /documents, /media).
Advanced Configuration
Using Docker Secrets for Sensitive Data
Zerobyte supports reading secrets from environment variables or Docker secrets files instead of storing them encrypted in the database:docker-compose.yml
env://S3_SECRET_KEY- Reads from environment variableS3_SECRET_KEYfile://smb_password- Reads from/run/secrets/smb_password
Mounting rclone Configuration
To use rclone-based repositories (Google Drive, Dropbox, OneDrive, etc.), mount your rclone configuration:
Your rclone remotes will now be available when creating repositories in Zerobyte.
Reverse Proxy Setup
When running Zerobyte behind a reverse proxy (Nginx, Traefik, Caddy):- Set
BASE_URLto your HTTPS domain:https://zerobyte.example.com - Ensure your proxy passes the
X-Forwarded-Protoheader - Secure cookies will automatically be enabled based on the
https://prefix
- Nginx
- Caddy
- Traefik
nginx.conf
Updating Zerobyte
To update to a new version:Always check the release notes before updating, especially for v0.x.x versions which may include breaking changes.
Troubleshooting
Container Won’t Start
- Check logs:
docker compose logs zerobyte - Verify
APP_SECRETis set and at least 32 characters - Ensure
/var/lib/zerobytedirectory has correct permissions - Verify port 4096 is not already in use:
netstat -tuln | grep 4096
Permission Issues
If you encounter permission errors:Cannot Mount Remote Shares
Ensure your container has the necessary capabilities:Logs
View detailed logs with:Next Steps
Now that Zerobyte is installed, proceed to the Quick Start guide to configure your first backup:Quick Start Guide
Set up your first volume, repository, and backup job
