Environment Variables
Borg UI supports configuration through environment variables. Most settings have sensible defaults and can be configured through the web interface.Application Settings
Port for the web UI to listen on.
Environment mode. Valid values:
production, development.In development mode:- Debug mode is automatically enabled
- Log level defaults to DEBUG
Timezone configuration for correct timestamps in archive names and logs.Common timezones:
America/New_YorkAmerica/ChicagoAmerica/Los_AngelesEurope/LondonEurope/ParisAsia/KolkataAsia/Tokyo
Application version identifier. Auto-generated in CI/CD. Set manually for local development.
Reverse Proxy Configuration
Base path for running behind a reverse proxy in a subfolder.Requirements:
- Must start with
/(e.g.,/borgnotborg) - No trailing slash (e.g.,
/borgnot/borg/) - Requires rebuild:
docker-compose up -d --build
User/Group ID Configuration
User ID for the container process. Set this to match your host user’s UID for proper file permissions.Find your UID:
id -uCommon values:- Linux:
1000 - macOS:
501(varies, runid -u) - Default:
1001
Group ID for the container process. Set this to match your host user’s GID for proper file permissions.Find your GID:
id -gCommon values:- Linux:
1000 - macOS:
20(varies, runid -g) - Default:
1001
Security Settings
Secret key for session management and encryption. Auto-generated on first run and persisted to
/data/.secret_key.Application logging level. Valid values:
DEBUG, INFO, WARNING, ERROR, CRITICAL.Disable built-in authentication and trust reverse proxy headers.
HTTP header containing the authenticated username from the reverse proxy.Only used when
DISABLE_AUTHENTICATION=true.Set the initial admin password on first run. If not provided, a random password is generated and displayed in logs.
Host Filesystem Mount
Host filesystem path to mount inside the container at Creating repositories:
/local.Default: Entire host filesystem (/) is mounted to /local in the container.Examples:- macOS:
/local/Users/username/backups/my-repo - Linux:
/local/home/username/backups/my-repo - Custom:
/local/path/to/your/backup/location
Comma-separated list of container paths where host directories are mounted.Used for file browser detection and highlighting.
Borg Operation Timeouts
Increase these timeouts for very large repositories (e.g., 830TB repositories with 166-minute cache build times).
Timeout in seconds for
borg info operations (repository verification, stats).Default: 10 minutes (600 seconds)Timeout in seconds for
borg list operations (listing archives and files).Default: 10 minutes (600 seconds)Timeout in seconds for
borg init operations (new repository creation).Default: 5 minutes (300 seconds)Timeout in seconds for
borg extract operations (file restoration).Default: 1 hour (3600 seconds)Timeout in seconds for
borg mount operations (archive browsing via FUSE).Default: 2 minutes (120 seconds)Timeout in seconds for pre/post backup scripts.Default: 2 minutes (120 seconds)
Timeout in seconds for
du-based source size calculation (large datasets).Default: 1 hour (3600 seconds)Redis Cache Configuration
Redis cache provides 600x faster archive browsing. Configure via Settings → Cache tab in the UI (recommended) or use environment variables for initial defaults.
External Redis connection URL. Takes precedence over
REDIS_HOST/REDIS_PORT.Formats:- TCP:
redis://hostname:port/db - TCP with password:
redis://:password@hostname:port/db - TLS:
rediss://hostname:port/db - Unix socket:
unix:///run/redis.sock?db=0
Redis server hostname. Used if
REDIS_URL is not set.Redis server port. Used if
REDIS_URL is not set.Redis database number (0-15). Used if
REDIS_URL is not set.Redis server password. Used if
REDIS_URL is not set.Cache time-to-live in seconds. Archive data is cached for this duration.Default: 2 hours (7200 seconds)
Maximum cache size in megabytes (used by in-memory fallback cache).Default: 2GB (2048 MB)
Data Directory
Main data directory for all persistent data (database, SSH keys, logs, configs).
Database connection URL. Auto-derived from
DATA_DIR.Complete Example
.env
Repository Types
Local (Mounted): Store repositories on host filesystem via
/local mount (recommended)Local (Container): Store within container (limited to container storage)SSH: Access remote repositories via SSH (for remote servers)Recommended Setup
- Set
LOCAL_STORAGE_PATHto your desired host directory (e.g.,/Usersor/home) - Set
PUIDandPGIDto match your host user:id -u && id -g - Configure timezone with
TZ - Restart container:
docker-compose down && docker-compose up -d - Create “local” repositories at
/local/...in the UI - Your backups are stored on the host and survive container rebuilds