workleast/borgserver

By workleast

Updated over 1 year ago

Borgbackup Server Container

Image
Networking
Web servers
Databases & storage
0

1.5K

workleast/borgserver repository overview

Borgbackup Server Docker

alt text

Description

Borgbackup Server Docker is a fork of the original work from Grantbevis/borg-server⁠

In this fork, I have updated all the packages to the latest version (at the time of writing) for the best of security and functionality. I also fixed permission errors that may occur on some Linux distros. For complete open source project, please visit https://github.com/workleast/borgserver-docker

Xem hướng dẫn sử dụng bằng Tiếng Việt tại đây: https://workleast.com/sao-luu-du-lieu-bang-borg-backup-docker/

Usage

docker-compose.yml
services:
  borgserver:
    restart: always
    image: workleast/borgserver
    container_name: borgserver
    volumes:
      - ${REPO_DIR}:/backups
      - ${SSH_DIR}:/home/borg/.ssh
    ports:
      - "2022:22"
    environment:
      TZ: ${TZ}
.env
TZ=Asia/Ho_Chi_Minh
REPO_DIR=path/to/repo
SSH_DIR=${PWD}/ssh
  • Change the 'TZ' variable to the time zone where you live
  • Change the 'path/to/repo' to the actual path of your Borg's repository directory (where your data will be backed up to)
ssh/authorized_keys

If you've already had your own SSH keys, place your ssh's public keys in the file 'ssh/authorized_keys'. Otherwise, you can use the built-in script to create one. Please see below for instruction.

Run

docker compose up -d
Fix permission

This container uses 'borg' user with uid(1000):gid(1000) to login and write backup data to the REPO_DIR directory on your host (defined in .env file). However, different systems usually have different uid:gid for their users which may result in permission problems. To workaround with this, I have added a script in the container which synchronizes the ownership and permission of relevant files and directories.

  • Note: If you are re-using an existing Borg's repo, you also need to run this script to fix permission errors.
docker exec -it borgserver fix-permission.sh
SSH keys auto-generate

If you are not using your own SSH keys, you can use this script to generate one. Here is how to get it done

docker exec -it borgserver gen-sshkey.sh

Connect

  • Upload the SSH's private key to the Borg Client
  • On the Borg Client, connect to the Borg Server using ssh://borg@your-server-ip:2022/backups

Tag summary

Content type

Image

Digest

sha256:61f196c8b

Size

28.1 MB

Last updated

over 1 year ago

docker pull workleast/borgserver