Skip to main content

Overview

Docker Compose is the recommended deployment method for Borg UI. It provides:
  • Automatic Redis setup for 600x faster archive browsing
  • Persistent volumes for data and cache
  • Health checks and automatic restarts
  • Easy configuration via .env file
  • Service dependencies and networking

Quick Start

1

Create docker-compose.yml

Create a docker-compose.yml file:
Replace /home/yourusername with the actual directory you want to backup.
2

Create .env file (optional)

Create a .env file in the same directory to customize settings:
3

Start the services

4

Verify it's running

Access the web interface at http://localhost:8081Default credentials: admin / admin123

Configuration

Volume Mounts

Application Data

Stores all persistent application data:
  • SQLite database
  • SSH keys and Borg encryption keys
  • Configuration files
  • Logs
  • Auto-generated SECRET_KEY

Borg Cache

Improves backup performance by caching repository metadata.

Host Filesystem

Mounting the entire root filesystem (/) should only be used for development/testing. In production, mount only the directories you need to backup.

Docker Socket (Optional)

Required only for stopping/starting Docker containers during backups via pre/post backup scripts.

Environment Variables

Core Settings

User/Group IDs

Set these to match your host user for proper file permissions.

Timezone

Ensures correct timestamps in backup archives and logs.

Security

If SECRET_KEY is not set, it will be auto-generated and persisted to /data/.secret_key.

Redis Cache

Provides 600x faster archive browsing for large repositories.

Borg Timeouts

For large repositories with long cache build times:

Disable Authentication

Only use this in secure, private networks. Not recommended for production.

Privileged Mode

Privileged mode is required only for remote-to-remote backups via SSHFS. If you only use local or direct SSH backups, you can remove this line.
This allows mounting remote SSH locations as local filesystems using SSHFS.

Redis Configuration

The included Redis service is configured for optimal caching:
  • maxmemory: Limits Redis memory usage to 2GB
  • allkeys-lru: Evicts least recently used keys when memory limit is reached
  • save "": Disables persistence (cache data doesn’t need to survive restarts)
  • appendonly no: Disables append-only file for better performance

Using External Redis

To use an external Redis instance:
Or remove the REDIS_URL and set individual parameters:
Then remove the redis service from your docker-compose.yml.

Management Commands

Start services

Stop services

View logs

Restart services

Check service status

Update to latest version

1

Pull latest images

2

Recreate containers

3

Remove old images

Rebuild from source

If using the build context instead of pre-built images:
Then rebuild:

Access container shell

View resource usage

Production Example

Complete production-ready configuration:
docker-compose.yml
.env

Troubleshooting

Services not starting

Check logs for errors:

Redis connection issues

Verify Redis is healthy:
Test Redis connection:

Permission issues

  1. Check PUID/PGID match your host user:
  2. Update .env file with correct values
  3. Recreate containers:

Port conflicts

If port 8081 is already in use, change it in .env:
Then restart:

Health check failures

Increase start_period for slower systems:

Next Steps

Reverse Proxy

Run behind Nginx or Traefik with SSL

Unraid

Deploy on Unraid with Community Applications