Environment Variables
Borg UI supports configuration through environment variables. Most settings have sensible defaults and can be configured through the web interface.Application Settings
integer
default:"8081"
Port for the web UI to listen on.
string
default:"production"
Environment mode. Valid values:
production, development.In development mode:- Debug mode is automatically enabled
- Log level defaults to DEBUG
string
default:"host timezone"
Timezone configuration for correct timestamps in archive names and logs.Common timezones:
America/New_YorkAmerica/ChicagoAmerica/Los_AngelesEurope/LondonEurope/ParisAsia/KolkataAsia/Tokyo
string
default:"auto-generated"
Application version identifier. Auto-generated in CI/CD. Set manually for local development.
Reverse Proxy Configuration
string
default:"/"
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
integer
default:"1001"
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
integer
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
string
default:"auto-generated"
Secret key for session management and encryption. Auto-generated on first run and persisted to
/data/.secret_key.string
default:"INFO"
Application logging level. Valid values:
DEBUG, INFO, WARNING, ERROR, CRITICAL.boolean
default:"false"
Disable built-in authentication and trust reverse proxy headers.
string
default:"X-Forwarded-User"
HTTP header containing the authenticated username from the reverse proxy.Only used when
DISABLE_AUTHENTICATION=true.string
default:"none"
Set the initial admin password on first run. If not provided, a random password is generated and displayed in logs.
Host Filesystem Mount
string
default:"/"
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
string
default:"/local"
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).
integer
default:"600"
Timeout in seconds for
borg info operations (repository verification, stats).Default: 10 minutes (600 seconds)integer
default:"600"
Timeout in seconds for
borg list operations (listing archives and files).Default: 10 minutes (600 seconds)integer
default:"300"
Timeout in seconds for
borg init operations (new repository creation).Default: 5 minutes (300 seconds)integer
default:"3600"
Timeout in seconds for
borg extract operations (file restoration).Default: 1 hour (3600 seconds)integer
default:"120"
Timeout in seconds for
borg mount operations (archive browsing via FUSE).Default: 2 minutes (120 seconds)integer
default:"120"
Timeout in seconds for pre/post backup scripts.Default: 2 minutes (120 seconds)
integer
default:"3600"
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.
string
default:"none"
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
string
default:"redis"
Redis server hostname. Used if
REDIS_URL is not set.integer
default:"6379"
Redis server port. Used if
REDIS_URL is not set.integer
default:"0"
Redis database number (0-15). Used if
REDIS_URL is not set.string
default:"none"
Redis server password. Used if
REDIS_URL is not set.integer
default:"7200"
Cache time-to-live in seconds. Archive data is cached for this duration.Default: 2 hours (7200 seconds)
integer
default:"2048"
Maximum cache size in megabytes (used by in-memory fallback cache).Default: 2GB (2048 MB)
Data Directory
string
default:"/data"
Main data directory for all persistent data (database, SSH keys, logs, configs).
string
default:"sqlite:////data/borg.db"
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