# Borg Backup Server — Docker Compose # # Quick start: # 1. Copy .env.example to .env and edit it: # cp .env.example .env # 2. Set APP_URL to this machine's hostname or IP (required for agents to connect) # 3. Start the container: # docker compose up -d # 4. View admin credentials: # docker compose logs bbs # # All data (database, repositories, SSH keys) is stored in the bbs-data volume. services: bbs: image: marcpope/borgbackupserver:latest # build: . # uncomment to build locally instead of pulling from Docker Hub container_name: bbs ports: # host:container. Change the left side only — the container always serves # HTTP on 80 and SSH on 22, and pointing the right side elsewhere leaves # nothing listening there. - "${WEB_PORT:-8080}:80" # Web UI - "${SSH_PORT:-2222}:22" # SSH for borg agent connections environment: - APP_URL=${APP_URL:-http://localhost:8080} - SSH_PORT=${SSH_PORT:-2222} # Passed in so the container can warn when APP_URL names a different port # from the one the web UI is published on. It does not change what the # container listens on — that is always 80. - WEB_PORT=${WEB_PORT:-8080} # Map the app user (www-data) to your host user's UID/GID. Fixes permission # issues with bind mounts, especially on btrfs filesystems (e.g. Synology). # Changing these after first run triggers an automatic ownership migration. # Find your values with: id -u && id -g # - PUID=${PUID:-33} # - PGID=${PGID:-33} # Advanced: remap MariaDB / ClickHouse UIDs too (see .env.example) # - MYSQL_PUID=${MYSQL_PUID:-100} # - MYSQL_PGID=${MYSQL_PGID:-100} # - CH_PUID=${CH_PUID:-999} # - CH_PGID=${CH_PGID:-999} # Admin password — only used on first run. Omit to auto-generate (shown in logs). # - ADMIN_PASS=${ADMIN_PASS} # Use the IP provided by a trusted proxy (e.g. caddy reverse proxy) via the # X-Forwarded-For header # - TRUSTED_PROXIES=${TRUSTED_PROXIES} volumes: - bbs-data:/var/bbs # To store backups on a specific disk or path instead of Docker's internal storage, # replace the line above with a bind mount: # - /mnt/backups:/var/bbs restart: unless-stopped # Docker's default json-file log driver has no size limit, which means # container output (mostly ClickHouse's internal warnings) will grow # unbounded over time. Cap it at ~30 MB total — plenty for recent # diagnostics, nothing close to filling a disk. Adjust if you want more # history; rotation is honored automatically. logging: driver: json-file options: max-size: "10m" max-file: "3" volumes: bbs-data: # Remove this 'volumes' section entirely if using a bind mount above