Usage Guide: Creating Backups
This guide shows you how to create backups using Borg Web UI. There are two main methods:
- Local Backups - Backup to storage attached to your Docker host (USB drives, NAS mounts, etc.)
- SSH/Remote Backups - Backup to remote servers via SSH
Both methods follow the same workflow, with one key difference: SSH backups require SSH key setup.
Table of Contents
- Understanding Backup Types
- Prerequisites
- Method 1: Local Backups
- Method 2: SSH/Remote Backups
- Running Your First Backup
- Scheduling Automated Backups
- Restoring from Backups
Understanding Backup Types
Local Backups
What is it? Stores backup data on storage directly accessible to your Docker host machine.
Best for:
- USB external drives
- Network-attached storage (NAS) mounted via NFS/CIFS
- Additional internal drives
- Same-machine backups
Advantages:
- ✅ Simple setup (no SSH keys needed)
- ✅ Faster backup speeds (no network overhead)
- ✅ Works offline
- ✅ Lower latency
Disadvantages:
- ❌ No off-site protection (if your machine fails, backups may be lost)
- ❌ Requires physical storage
SSH/Remote Backups
What is it? Stores backup data on a remote server accessible via SSH.
Best for:
- Remote VPS/cloud servers
- Off-site backup targets (Raspberry Pi at another location)
- Storage servers without NFS/CIFS
- Professional/enterprise setups
Advantages:
- ✅ Off-site protection (survives local disasters)
- ✅ No need to mount network drives
- ✅ Works across the internet
- ✅ Industry-standard secure protocol
Disadvantages:
- ❌ Requires SSH key setup
- ❌ Slower over internet connections
- ❌ Requires remote server access
Prerequisites
Before creating backups, ensure:
- Borg Web UI is running:
http://localhost:8081
- You’re logged in (default:
admin
/admin123
) - Container has proper permissions: Set
PUID
/PGID
if needed (see Troubleshooting > Permission Issues)
Method 1: Local Backups (Recommended for Beginners)
What You’ll Need
- A storage location on your Docker host machine
- The path to that storage (e.g.,
/mnt/usb-drive
,/mnt/nas
)
Understanding /local
Mount
Key Concept: The container automatically mounts your host filesystem at /local
.
By default:
- Host path:
/
(your entire filesystem) - Container path:
/local
This means:
- Host
/home/user/backups
→ Container/local/home/user/backups
- Host
/mnt/usb-drive/borg
→ Container/local/mnt/usb-drive/borg
You can customize this via the LOCAL_STORAGE_PATH
environment variable (see Configuration).
Step 1: Ensure Storage is Accessible
Good news: You don’t need to create directories manually! Borg automatically creates the repository directory when you initialize it.
What you DO need:
- Storage attached to your Docker host (USB drive, NAS mount, etc.)
- Your Docker user has write permissions to the parent directory
Examples of parent directories:
/mnt/usb-drive/
- For external drives (Linux/Pi)/mnt/nas/
- For NAS mounts/home/user/backups/
- For home directory (Linux)~/backups/
- For home directory (shorthand)/Volumes/MyExternalDrive/
- For external drives (macOS)
Setting permissions (if needed):
# Linux/Raspberry Pi - Make sure you own the parent directory
sudo chown -R $(id -u):$(id -g) /mnt/usb-drive
# Check permissions
ls -la /mnt/usb-drive
Tip: Ensure PUID
/PGID
in docker-compose matches your user ID. See Troubleshooting > Permission Issues.
Step 2: Create a Repository in Borg Web UI
A repository is where Borg stores your encrypted backup data.
-
Navigate to Repositories Click “Repositories” in the sidebar
-
Click “Create Repository”
-
Fill in Repository Details:
Field Example Value Description Repository Name my-laptop-backup
Friendly name for identification Repository Path /local/mnt/usb-drive/borg-backups/laptop
Path inside the container (use /local/
prefix!)Encryption Mode repokey-blake2
Recommended for best security Passphrase your-strong-password-123
Store this safely! You cannot recover data without it. Path Translation Examples:
Host Path Container Path (use this in UI) /mnt/usb-drive/borg-backups/laptop
/local/mnt/usb-drive/borg-backups/laptop
/mnt/nas/backups/myrepo
/local/mnt/nas/backups/myrepo
/home/user/backups/data
/local/home/user/backups/data
~/backups/borg-repos/myrepo
/local/home/<username>/backups/borg-repos/myrepo
- Configure Compression (Optional)
- Recommended:
lz4
(fast) orzstd,3
(balanced) - Leave default if unsure
- Recommended:
-
Add Source Paths Click “Add Source Path” and specify what to backup:
Examples:
/local/home/user/Documents
- Backup Documents folder/local/var/www
- Backup web server files/local/etc
- Backup configuration files
⚠️ Important: Use
/local/
prefix for paths inside the container! - Review and Create
- Check the auto-generated command preview
- Click “Create Repository”
- Success! You’ll see your repository listed with status “Active”
Step 3: Run Your First Backup
Now that your repository is created, let’s create your first backup (called an “archive” in Borg).
-
Navigate to Backup Tab Click “Backup” in the sidebar
-
Select Repository Choose
my-laptop-backup
from the dropdown - Optional: Add Exclude Patterns
Exclude files you don’t want to backup:
**/.git **/node_modules **/__pycache__ **/.DS_Store **/Thumbs.db
-
Click “Start Backup”
- Watch Progress in Real-Time:
- Current file being processed
- Files processed count
- Original size vs. compressed size
- Deduplicated size (space saved!)
- Speed and ETA
- Completion
Once finished, you’ll see:
- Total files processed
- Original size → Compressed → Deduplicated
- Duration and average speed
- Backup archive name (e.g.,
2025-10-22T10-30-45
)
🎉 Congratulations! Your first local backup is complete.
Customizing Local Mount
By default, the entire host filesystem (/
) is mounted at /local
. You can restrict this:
Edit docker-compose.yml
or .env
:
volumes:
# Option 1: Mount only user directories (Linux)
- /home:/local:rw
# Option 2: Mount only user directories (macOS)
- /Users:/local:rw
# Option 3: Mount only NAS
- /mnt/nas:/local:rw
Or in .env
:
LOCAL_STORAGE_PATH=/home
Then use repository paths like /local/username/backups/repo
.
Method 2: SSH/Remote Backups
What You’ll Need
- A remote server with:
- SSH access (username and IP/hostname)
- Borg installed (
sudo apt install borgbackup
or equivalent) - A directory for backups
- SSH key pair (we’ll generate this in the UI)
Step 1: Generate or Import SSH Key
SSH keys authenticate your connection to the remote server without passwords.
-
Navigate to SSH Keys Click “SSH Keys” in the sidebar
-
Generate New Key Click “Generate Key Pair”
Field Example Description Key Name backup-server-key
Friendly identifier Key Type ed25519
Recommended (secure & fast) Comment borg-ui@myhost
Optional label - Download Private Key (Optional)
- Click “Download Private Key” to save a backup
- Store safely (this is your authentication credential!)
- Copy Public Key Click “Copy Public Key” - you’ll need this for the next step
Step 2: Deploy Public Key to Remote Server
The remote server needs your public key to allow connections.
Option A: Automatic Deployment (Recommended)
-
In the SSH Keys list, click “Deploy” next to your key
-
Fill in deployment details:
Field Example Description Hostname 192.168.1.100
orbackup.example.com
IP or domain of remote server Port 22
SSH port (usually 22) Username backupuser
SSH username on remote server Password server-password
Temporary (only for deployment) -
Click “Deploy Key” The UI will automatically add your public key to
~/.ssh/authorized_keys
on the remote server. -
Success! You can now use this key for SSH repositories.
Option B: Manual Deployment
If automatic deployment fails, do this manually on the remote server:
# SSH into your remote server
ssh user@192.168.1.100
# Create SSH directory if it doesn't exist
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Add public key (paste the key you copied from UI)
echo "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... borg-ui@myhost" >> ~/.ssh/authorized_keys
# Set correct permissions
chmod 600 ~/.ssh/authorized_keys
# Exit
exit
Step 3: Test SSH Connection
Before creating a repository, verify the SSH connection works:
- In SSH Keys tab, find your key
- Click “Test Connection”
- Enter remote server details:
- Hostname:
192.168.1.100
- Port:
22
- Username:
backupuser
- Hostname:
- If successful, you’ll see: ✅ “Connection successful!”
Step 4: Ensure Remote Server is Ready
Good news: You don’t need to create directories manually! Borg automatically creates the repository directory when you initialize it.
What you DO need on the remote server:
- Borg installed
- Write permissions to the parent directory
Check and prepare the remote server:
# SSH into remote server
ssh backupuser@192.168.1.100
# 1. Ensure Borg is installed
borg --version
# If not installed: sudo apt install borgbackup
# 2. (Optional) Create a parent directory if you want to organize repos
# Borg will create the actual repo directory automatically
mkdir -p ~/borg-backups # Optional: just for organization
# 3. Verify you have write permissions
touch ~/borg-backups/test && rm ~/borg-backups/test && echo "Permissions OK"
# Exit
exit
Note: You can skip creating directories - just ensure Borg is installed and you have write access to your home directory or wherever you plan to store repos.
Step 5: Create SSH Repository in Borg Web UI
Now create a repository that uses SSH to store data remotely.
-
Navigate to Repositories Click “Repositories” in the sidebar
-
Click “Create Repository”
-
Fill in Repository Details:
Field Example Value Description Repository Name offsite-backup
Friendly name Repository Path backupuser@192.168.1.100:borg-backups/myrepo
SSH format: user@host:path
SSH Key backup-server-key
Select the key you created earlier Encryption Mode repokey-blake2
Recommended Passphrase your-strong-password-456
Store safely! SSH Path Format:
username@hostname:/absolute/path username@hostname:relative/path user@example.com:/home/user/backups/repo user@192.168.1.100:borg-backups/data
- Configure Compression (Optional)
- Over Fast Network:
lz4
(fast) - Over Slow Network:
zstd,3
(more compression = less data transferred)
- Over Fast Network:
- Add Source Paths
What to backup (same as local backups):
/local/home/user/Documents /local/var/www/html /local/etc/nginx
-
Click “Create Repository”
- Success! Repository is now active and ready for backups.
Step 6: Run Your First SSH Backup
The process is identical to local backups:
- Navigate to Backup Tab
- Select your SSH repository (
offsite-backup
) - Optional: Add exclude patterns
- Click “Start Backup”
- Watch real-time progress
Note: SSH backups may be slower than local backups due to network speed, but Borg’s deduplication minimizes data transfer after the first backup.
Commonalities Between Local and SSH Backups
Both methods share the same workflow after repository creation:
1. Backup Process (Identical)
- Select repository
- Add exclude patterns
- Start backup
- Monitor progress
- View completion statistics
2. Archive Management (Identical)
- Browse backups in Archives tab
- View archive contents
- Restore files
- Delete old archives
3. Scheduling (Identical)
- Create scheduled jobs in Schedule tab
- Set cron expressions (daily, weekly, etc.)
- Monitor execution history
4. Monitoring (Identical)
- View backup history
- Download logs
- Check repository statistics
Key Differences Summary
Feature | Local Backups | SSH/Remote Backups |
---|---|---|
Setup Complexity | ⭐ Simple | ⭐⭐ Moderate (SSH key required) |
Speed | 🚀 Fast | 🐌 Depends on network |
Off-site Protection | ❌ No | ✅ Yes |
Storage | Must be attached to host | Any SSH-accessible server |
Key Requirement | ❌ None | ✅ SSH key needed |
Path Format | /local/path/to/repo |
user@host:path/to/repo |
Running Your First Backup
Regardless of method (local or SSH), the backup process is the same:
Using the Backup Tab (Manual Backup)
- Go to Backup Tab
- Select Repository from dropdown
- (Optional) Add Exclude Patterns:
**/.git **/node_modules **/__pycache__ **/*.tmp **/*.log
- Click “Start Backup”
- Monitor Progress:
- Current file being processed
- Files processed
- Original size vs compressed vs deduplicated
- Backup speed and ETA
- Completion:
- View summary statistics
- Download logs if needed
Scheduling Automated Backups
Set up automated backups to run on a schedule:
Step 1: Navigate to Schedule Tab
Click “Schedule” in the sidebar.
Step 2: Create Scheduled Job
-
Click “Create Job”
-
Fill in details:
Field Example Description Job Name Daily Documents Backup
Descriptive name Repository my-laptop-backup
Select your repository Schedule 0 2 * * *
Cron expression (2 AM daily) Description Backup documents every night
Optional notes Enabled ✅ Start immediately - Use Preset Schedules:
Click the clock icon (⏰) to choose from presets:
- Every 5 minutes
- Every hour
- Daily at 2 AM
- Weekly on Sunday
- Monthly on 1st
- Click “Create Job”
Step 3: Monitor Scheduled Jobs
- View Next Run time
- See Last Run status
- Check Backup History for execution logs
Step 4: View Running Jobs
When a scheduled backup is running, you’ll see it in the “Running Scheduled Backups” section with real-time progress.
Restoring from Backups
Step 1: Browse Archives
- Navigate to Archives Tab
- Select Repository
- View list of backups (sorted by date)
Step 2: Browse Archive Contents
- Click “Browse” on any archive
- Navigate through directories
- Search for specific files
Step 3: Extract Files
- Select files/directories to restore
- Click “Extract Selected”
- Choose destination:
- Local:
/local/home/user/restored-files
- SSH: Restore to remote server
- Local:
- Click “Start Restore”
- Monitor progress
🎉 Files restored!
Best Practices
For Local Backups
- Use external storage - Don’t backup to the same drive as your data
- Test restores regularly - Backups are useless if you can’t restore
- Consider off-site copies - Add an SSH backup for critical data
- Monitor disk space - Set up pruning/retention policies
For SSH Backups
- Use strong passphrases - Both for SSH keys and repository encryption
- Keep SSH keys secure - Download and store private keys safely
- Test connectivity first - Use “Test Connection” before creating repositories
- Use compression - Saves bandwidth over slow connections
- Dedicated backup user - Create a separate SSH user on remote server
General
- Never lose your passphrase - Write it down, use a password manager
- Schedule backups during off-hours - Reduces impact on system performance
- Use exclude patterns - Don’t backup cache, logs, or temporary files
- Monitor backup jobs - Check logs regularly for errors
- Prune old archives - Set retention policies to manage storage
Troubleshooting
Common Issues
“Permission denied” when creating repository
Cause: Docker user doesn’t have write access to storage location.
Solution: Set PUID
/PGID
in docker-compose.yml:
environment:
- PUID=1000 # Your user ID (run: id -u)
- PGID=1000 # Your group ID (run: id -g)
Restart container: docker compose down && docker compose up -d
SSH connection fails
Causes:
- Public key not deployed correctly
- Wrong hostname/port/username
- Firewall blocking SSH
- Remote server doesn’t have Borg installed
Solutions:
- Use “Test Connection” to diagnose
- Verify
~/.ssh/authorized_keys
on remote server - Check firewall rules:
sudo ufw allow 22/tcp
- Install Borg:
sudo apt install borgbackup
Backup is very slow
For Local:
- Check disk I/O performance
- Reduce compression level
- Exclude unnecessary files
For SSH:
- Use faster compression (
lz4
ornone
) - Check network speed
- Consider initial backup over LAN, then move to remote location
“Repository not found” error
Cause: Path is incorrect or repository wasn’t created successfully.
Solution:
- Verify path format:
- Local:
/local/mnt/usb-drive/backups/repo
- SSH:
user@host:backups/repo
- Local:
- Check repository exists:
# For local docker exec borg-web-ui ls -la /local/mnt/usb-drive/backups # For SSH ssh user@host ls -la ~/backups
- Re-create repository if needed
Next Steps
- Scheduling Guide - Automate your backups
- Archives Browser - Browse and restore files
- API Documentation - Integrate with other tools
- Troubleshooting Guide - Common issues
Summary
Local Backups in 3 Easy Steps:
- Ensure storage is accessible (USB drive, NAS mount, etc.) with write permissions
- Create repository in UI using
/local/path/to/repo
- Borg auto-creates the directory! - Run backup - no SSH key needed!
SSH Backups in 6 Easy Steps:
- Generate SSH key in UI (one click)
- Deploy public key to remote server (automatic or manual)
- Test connection (verify it works)
- Ensure Borg is installed on remote server
- Create repository in UI using
user@host:path
- Borg auto-creates the directory! - Run backup
The difference? Just the SSH key setup. Everything else is identical!
Pro tip: Borg automatically creates repository directories when you initialize them - no manual mkdir
needed!
Need Help?