All apps · 0 apps
BorgWarehouse
OfficialDocker app from jamesfreeman959's Repository
Overview
Readme
View on GitHubBorgWarehouse for Unraid
A Community Applications template for BorgWarehouse, a web interface for running your own BorgBackup server. With it, your Unraid server becomes the destination for Borg backups from your other machines (borg, Vorta, borgmatic).
The template uses the official borgwarehouse/borgwarehouse image unchanged. This repository only holds the
Unraid template, a User Scripts script for the scheduled checks, and these notes.
Install
Search for BorgWarehouse in the Apps tab (Community Applications).
Before you click Apply, fill in:
| Setting | What to put |
|---|---|
SSH port / SSH_SERVER_PORT |
The same port in both. The default is 2222, because Unraid's own SSH uses 22. |
FQDN |
The hostname or IP your clients use to reach Unraid, e.g. tower.local. |
BETTER_AUTH_URL |
The main URL you open the web UI at, e.g. https://borg.example.com or http://192.168.1.10:3000. If you also use other addresses (say both the proxy domain and the IP), list them in BETTER_AUTH_TRUSTED_ORIGINS. Otherwise logins from them fail and the log shows Invalid origin. |
BETTER_AUTH_SECRET, CRONJOB_KEY |
Two different random values. In the Unraid terminal run openssl rand -base64 32 twice. |
| Repositories | A share for the backups themselves, /mnt/user/borgwarehouse/ by default. Don't use appdata: backups get large. |
Then open the web UI and create the admin account.
Known issue in BorgWarehouse 3.7.0: on a brand new install, the first start fails with
Database schema mismatch ... table account has no column named issuerand the web UI returns error 500. Restart the container once and it works. This is an upstream bug (3.6.3 starts cleanly). Existing installs upgrading from 3.6.x hit a related problem, tracked in Ravinou/borgwarehouse#723.
Scheduled checks (User Scripts)
BorgWarehouse doesn't schedule its own status and storage checks. Something outside the container has to call them, otherwise the dashboard never updates "last backup" times or storage usage, and late-backup alerts are never sent. On Unraid, use the User Scripts plugin:
- Install User Scripts from the Apps tab.
- Settings → User Scripts → Add New Script, and name it
borgwarehouse-checks. - Edit the script and paste in
scripts/borgwarehouse-cron.sh. - Set the schedule to Custom,
0 * * * *(hourly).
The script runs the checks inside the container using the CRONJOB_KEY from the template, so the key isn't copied
anywhere else. If you renamed the container, change CONTAINER= at the top of the script.
Single sign-on (OIDC)
Under Show more settings:
OIDC_ISSUER_URL: your provider's issuer, e.g.https://auth.example.com/application/o/borgwarehouse/for Authentik orhttps://kc.example.com/realms/homefor Keycloak.OIDC_CLIENT_ID,OIDC_CLIENT_SECRET: from the provider (confidential client).OIDC_PROVIDER_NAME: label on the login button (optional).- Redirect URI at the provider:
<BETTER_AUTH_URL>/api/auth/callback/oidc, e.g.https://borg.example.com/api/auth/callback/oidc. BorgWarehouse always builds it fromBETTER_AUTH_URL, so scheme, host and port must match that exactly, whichever address you started from. If the provider reports a redirect URI mismatch, theredirect_uriparameter in the address bar of its error page shows what was sent. - Start SSO logins from the
BETTER_AUTH_URLaddress. Starting from another trusted address (e.g. the IP) can fail on the way back, because the login state cookie belongs to the address you started from.
SSO only signs in existing users. Set your BorgWarehouse account's email to the one your provider sends, sign in
with SSO, then optionally set DISABLE_PASSWORD_LOGIN to true.
GitHub, Google, Microsoft and GitLab login are also supported upstream. Add the variables with Add another
Path, Port, Variable… (GITHUB_CLIENT_ID/GITHUB_CLIENT_SECRET, etc.). See the
upstream docs.
Notes
- SSH host keys are kept in
appdata/borgwarehouse/ssh_host. Keep that folder, otherwise clients get a host key changed warning after reinstalling. - Permissions: the container runs as
PUID/PGID(99:100 by default) and fixes the ownership of the mapped folders when it starts. PUID or PGID 0 (root) is refused. - Can't log in,
Invalid originin the log: the address in your browser isn'tBETTER_AUTH_URLor listed inBETTER_AUTH_TRUSTED_ORIGINS. Scheme, host and port must all match. After several failed attempts the login is also rate limited for a while; restarting the container clears that. - Reverse proxy: set
BETTER_AUTH_URLto the proxied URL. If you also use the directhttp://IP:3000address, add it toBETTER_AUTH_TRUSTED_ORIGINS. Only the web UI goes through the proxy: Borg traffic is SSH on the SSH port, so forward that port on your router if clients back up from outside your network. - Extra storage locations (
STORAGE_TARGETS): add each path as a Path mapping too. - Notifications: BorgWarehouse can use an Apprise API server. Run the Apprise container and point BorgWarehouse at it in the web UI.
Support
Questions and help on Unraid: the support thread on the Unraid forums. Bugs in the template (defaults, descriptions, the User Scripts script): open an issue here. Problems with BorgWarehouse itself: upstream.
Repository layout
| Path | Purpose |
|---|---|
templates/borgwarehouse.xml |
Unraid Docker template. This is the canonical copy: Unraid fetches template updates from here (<TemplateURL>), and the Community Applications feed in unraid-plugins carries an identical copy |
scripts/borgwarehouse-cron.sh |
User Scripts script for the scheduled checks |
icon.svg, icon.png |
Icon (BorgWarehouse's own logo, from the upstream repository) |
Testing the template before it is in CA
Copy the template onto the flash drive, then add the container from it:
wget -O /boot/config/plugins/dockerMan/templates-user/my-BorgWarehouse.xml https://raw.githubusercontent.com/jamesfreeman959/unraid-borgwarehouse/main/templates/borgwarehouse.xml
Then go to Docker → Add Container and pick BorgWarehouse from the template list.
Releasing a template change
Edit templates/borgwarehouse.xml here, then copy it to templates/borgwarehouse.xml in
unraid-plugins. That repository's Validate workflow fails
if the two copies differ.
License
The template and script are MIT licensed (see LICENSE). BorgWarehouse and its logo are by Ravinou, under the AGPL-3.0.
Requirements
Categories
Download Statistics
Related apps
Explore more like this
Explore allLinks
Details
borgwarehouse/borgwarehouseRuntime arguments
- Web UI
http://[IP]:[PORT:3000]/- Network
bridge- Shell
bash- Privileged
- false
Template configuration
Port for the BorgWarehouse web interface.
- Target
- 3000
- Default
- 3000
- Value
- 3000
Port Borg clients connect to over SSH. Unraid's own SSH uses 22, so pick another port. SSH_SERVER_PORT below must match this value.
- Target
- 22
- Default
- 2222
- Value
- 2222
Where the Borg repositories are stored. Backups can be large, so use a share on the array (or a pool sized for it) rather than appdata.
- Target
- /home/borgwarehouse/repos
- Default
- /mnt/user/borgwarehouse/
- Value
- /mnt/user/borgwarehouse/
Application config and user database.
- Target
- /home/borgwarehouse/app/config
- Default
- /mnt/user/appdata/borgwarehouse/config/
- Value
- /mnt/user/appdata/borgwarehouse/config/
Client public keys managed by BorgWarehouse (authorized_keys).
- Target
- /home/borgwarehouse/.ssh
- Default
- /mnt/user/appdata/borgwarehouse/ssh/
- Value
- /mnt/user/appdata/borgwarehouse/ssh/
The server's SSH host keys, generated on first start. Keep this so clients don't see a host key warning after an update.
- Target
- /etc/ssh
- Default
- /mnt/user/appdata/borgwarehouse/ssh_host/
- Value
- /mnt/user/appdata/borgwarehouse/ssh_host/
Hostname or IP address that Borg clients use to reach this server. It appears in the backup commands BorgWarehouse shows you, e.g. tower.local or backup.example.com.
Must match the SSH host port above. It appears in the backup commands BorgWarehouse shows you.
- Default
- 2222
- Value
- 2222
The main URL you open BorgWarehouse at, including http:// or https:// and any port, e.g. https://borg.example.com or http://192.168.1.10:3000. Logins from any other address are refused (Invalid origin in the log), so add the others to BETTER_AUTH_TRUSTED_ORIGINS under Show more settings.
Secret used to sign login sessions. Generate with: openssl rand -base64 32. If empty, a new one is made at every restart and everyone is logged out.
Key for the scheduled status and storage checks. Generate with: openssl rand -base64 32. The User Scripts script reads it from the container, so you don't need to copy it anywhere.
User ID the app runs as. 99 is Unraid's nobody user. Must not be 0.
- Default
- 99
- Value
- 99
Group ID the app runs as. 100 is Unraid's users group. Must not be 0.
- Default
- 100
- Value
- 100
OIDC issuer URL (Authentik, Keycloak, Zitadel, ...), without /.well-known/openid-configuration. Set the redirect URI at your provider to BETTER_AUTH_URL/api/auth/callback/oidc. Users must already exist in BorgWarehouse with the same email; SSO doesn't create accounts.
OIDC client ID.
OIDC client secret.
Label on the SSO login button. Defaults to SSO.
Allow SSO login only. Only takes effect when an SSO provider is configured.
- Default
- false|true
- Value
- false
Passphrase required to complete the first-run setup wizard. Recommended if the web UI is reachable from the internet before you've created the admin account.
Other URLs you open BorgWarehouse at besides BETTER_AUTH_URL, comma separated, e.g. http://192.168.1.10:3000 when BETTER_AUTH_URL is your reverse proxy domain. Without this, logins from those addresses fail with Invalid origin.
Login session lifetime in seconds. Defaults to 3600 (1 hour).
Optional local hostname or IP. BorgWarehouse then also shows backup commands for clients on your LAN.
SSH port for the LAN commands, if different.
Leave the port out of the commands BorgWarehouse shows (e.g. when clients set it in ~/.ssh/config).
- Default
- false|true
- Value
- false
SMTP server for email alerts.
SMTP port. Defaults to 587.
SMTP username.
SMTP password.
From address for alert emails.
Set to false to accept a self-signed certificate on the SMTP server.
- Default
- true|false
- Value
- true
Turn off API tokens (integrations).
- Default
- false|true
- Value
- false
Prevent anyone from deleting a repository.
- Default
- false|true
- Value
- false
Prevent anyone from compacting a repository.
- Default
- false|true
- Value
- false
Extra storage locations selectable per repository, comma separated, optionally path|name (e.g. /mnt/offsite|Offsite disk). Each path must also be added as a Path mapping to this container.
1 turns off Next.js anonymous telemetry.
- Default
- 1
- Value
- 1