This repository provides a Docker image for running a BorgBackup server with SSH access. It is based on Alpine Linux and is designed for secure, containerized backup operations using Borg.
- BorgBackup installed in a chroot environment for enhanced security
- SSH server for secure remote access
- Customizable SSH authorized keys for user authentication
- Easy integration with Docker Compose
Use the prebuilt image from GitHub Container Registry:
services:
borgbackup-server:
image: ghcr.io/pm-dennis/borgbackup-server:latest
environment:
- SSH_AUTHORIZED_KEYS=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@host
ports:
- "2222:22"
volumes:
- ./data:/chroot/home- Replace the value of
SSH_AUTHORIZED_KEYSwith your public SSH key(s). - Mount your backup data to
/chroot/home.
If you need to customize the BorgBackup server (e.g., change the username), you can build the image yourself:
docker build -t borgbackup-server .BORG_USER(default:borgbackup): The username for the BorgBackup server. Set as a build argument.
Example:
docker build --build-arg BORG_USER=myuser -t borgbackup-server .Then use your custom image in docker-compose.yml:
services:
borgbackup-server:
image: borgbackup-server
environment:
- SSH_AUTHORIZED_KEYS=ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... user@host
ports:
- "2222:22"
volumes:
- ./data:/chroot/home