Docker deployment
One-liner install (recommended)
The fastest way to get started is to use the interactive install script. It fetches the latest release, prompts you for your settings, and sets everything up automatically.
curl -fsSL https://raw.githubusercontent.com/Ravinou/borgwarehouse/main/docker/install.sh | bash
bash, curl, docker and openssl to be installed. It is supported on Debian, Ubuntu, RHEL/CentOS/Fedora and Arch.Manual setup
- Get the latest BorgWarehouse docker image from the docker hub.
docker pull borgwarehouse/borgwarehouse:latest
- Get the
docker-composefile from the github repository and adapt it to your needs.
services:
borgwarehouse:
container_name: borgwarehouse
image: borgwarehouse/borgwarehouse
ports:
- "${WEB_SERVER_PORT:?WEB_SERVER_PORT variable missing}:3000"
- "${SSH_SERVER_PORT:?SSH_SERVER_PORT variable missing}:22"
env_file:
- .env
volumes:
- ${CONFIG_PATH:?CONFIG_PATH variable missing}:/home/borgwarehouse/app/config
- ${SSH_PATH:?SSH_PATH variable missing}:/home/borgwarehouse/.ssh
- ${SSH_HOST:?SSH_HOST variable missing}:/etc/ssh
- ${BORG_REPOSITORY_PATH:?BORG_REPOSITORY_PATH variable missing}:/home/borgwarehouse/repos
# Apprise is used to send notifications, it's optional. http://apprise:8000 is the URL to use in BorgWarehouse.
apprise:
container_name: apprise
image: caronc/apprise
user: "www-data:www-data"
Pick the .env.sample (rename it to .env) and adapt to your needs :
## Required variables section ##
# Host port mappings
WEB_SERVER_PORT=3000
SSH_SERVER_PORT=2222
# Hostname and URL
FQDN=your.domain.com
BETTER_AUTH_URL=https://your.domain.com
# Secrets
BETTER_AUTH_SECRET=your-secret
CRONJOB_KEY=your-other-secret
# PUID/PGID: the user and group ID the app will run as inside the container.
# Must match the owner of your volume directories on the host.
PUID=1000
PGID=1000
# Config and data folders (volume mounts)
# The host folders must be owned by the user with PUID and PGID specified above
CONFIG_PATH=./config
SSH_PATH=./ssh
SSH_HOST=./ssh_host
BORG_REPOSITORY_PATH=./repos
## Optional variables section ##
# LAN feature
FQDN_LAN=
SSH_SERVER_PORT_LAN=
# SMTP server settings
MAIL_SMTP_FROM=
MAIL_SMTP_HOST=
MAIL_SMTP_PORT=
MAIL_SMTP_LOGIN=
MAIL_SMTP_PWD=
MAIL_REJECT_SELFSIGNED_TLS=
# OAuth providers (optional) โ see https://borgwarehouse.com/docs/admin-manual/oauth-oidc/
# GITHUB_CLIENT_ID=
# GITHUB_CLIENT_SECRET=
# GOOGLE_CLIENT_ID=
# GOOGLE_CLIENT_SECRET=
# OIDC_CLIENT_ID=
# OIDC_CLIENT_SECRET=
# OIDC_ISSUER_URL=
PUID and PGID must match the owner of your volume directories on the host. To find them, run id in your terminal.- Create the 4 volumes on the host and set the correct permissions.
mkdir config ssh ssh_host reposchown -R YOUR_PUID:YOUR_PGID config ssh ssh_host repos
- Launch the docker-compose file with
docker compose up -d. - Set your scheduled tasks
Scheduled tasks
As a reminder, 2 important tasks require regular API calls to be triggered :
- checking repository status, and sending alerts.
- storage verification.
Since version 2.1.0, the cron service is no longer included with the container. This gives you full control over the schedule.
Option 1 โ Supercronic (recommended for Docker)
Since v3.2.0, docker-compose.yml includes a ready-to-use commented cron service using Supercronic, a production-ready cron for containers.
- Copy the example crontab file:
cp crontab.example crontab
Edit
crontabto adjust the schedule if needed (default: every hour).Uncomment the
cronservice indocker-compose.ymland restart:
docker compose up -d
Option 2 โ System cron (baremetal / external scheduler)
You can trigger the cron endpoints from any external cron service:
0 * * * * curl --request POST --url 'http://localhost:3000/api/v1/cron/status' --header 'Authorization: Bearer YOUR_CRONJOB_KEY'
0 * * * * curl --request POST --url 'http://localhost:3000/api/v1/cron/storage' --header 'Authorization: Bearer YOUR_CRONJOB_KEY'
YOUR_CRONJOB_KEY with the same key you provided in the .env file.Do not put any quotes around this key in the curl command.
Example :
[...] --header 'Authorization: Bearer 46ds546ds96qdsf'Manual refresh
Since v3.2.0, a refresh button (โป) is available in the repository list UI. Clicking it triggers a status and storage update immediately without waiting for the next cron run. This is useful for quick checks but does not replace the scheduled cron โ in particular, it does not send alerts.