THOSTHelp guides

Storage Box

Back up to a Storage Box with BorgBackup or restic

Make encrypted, deduplicated backups to your THOST Storage Box with BorgBackup or restic, keep a sensible history on a schedule, and restore files.

Checked against the live THOST dashboard on

BorgBackup and restic both deduplicate, compress and encrypt on your machine before anything is uploaded, so the Storage Box only ever sees encrypted data. Borg is the classic choice on Linux and macOS servers; restic is a single program that also runs on Windows.

Before you start

  • Install borg on the computer or server you are backing up (sudo apt install borgbackup on Debian and Ubuntu, brew install borgbackup on macOS).
  • Or install restic (restic.net; sudo apt install restic, brew install restic, or the Windows download).
  • Add an SSH key to the box, and the thost-box entry to ~/.ssh/config, so backups run without a password.

Steps (BorgBackup)

  1. Point borg at the box: (Without the config entry: ssh://bx1a2b3@storage.t-host.co.uk:21234/./repo with your username and port.)
    export BORG_REPO=ssh://thost-box/./repo
  2. Create the repository and choose a strong passphrase:
    borg init --encryption=repokey
  3. Export the key and keep it safe, off the box. Without the key and passphrase nobody, including THOST, can read the backups:
    borg key export "$BORG_REPO" ~/thost-borg-key.txt
  4. Make your first backup:
    borg create --stats ::'{hostname}-{now}' ~/Documents ~/Pictures
  5. Keep a sensible history: Recent borg versions also need borg compact now and then to free the space.
    borg prune --keep-daily 7 --keep-weekly 4 --keep-monthly 6
  6. Schedule it. Put steps 4 and 5 in a script and run it daily from cron or a systemd timer, with BORG_PASSPHRASE set in the script's environment (readable only by you).

Restore with borg

borg list
borg extract ::ARCHIVE-NAME path/to/file

Run borg extract in an empty folder: it restores into the current directory. Vorta gives borg a desktop interface on Linux and macOS.

Steps (restic)

  1. Point restic at the box: (Or with the port in the address: sftp://bx1a2b3@storage.t-host.co.uk:21234/restic, using your username and port.)
    export RESTIC_REPOSITORY=sftp:thost-box:restic
  2. Create the repository and choose a strong password. Keep it somewhere safe: without it the backups cannot be read.
    restic init
  3. Back up:
    restic backup ~/Documents ~/Pictures
  4. Keep a sensible history:
    restic forget --keep-daily 7 --keep-weekly 4 --keep-monthly 6 --prune
  5. Schedule it with cron, a systemd timer or Windows Task Scheduler, with RESTIC_PASSWORD_FILE pointing at a file only you can read.

Restore with restic

restic snapshots
restic restore latest --target ~/restore

Questions

Is borg safe if my server is hacked?

An attacker on your server could delete the repository using the same SSH key. The Storage Box also keeps seven nightly read-only snapshots, which cannot be deleted from your side, so the last seven nights are still there. See restore from snapshots.

How much space will it use?

Borg deduplicates and compresses, so a year of nightly backups of a server usually takes little more than one full copy.

restic says it cannot parse the port.

Older restic versions and some GUI clients cannot take the port in the address. Add Host, HostName, User and Port to ~/.ssh/config as above and use sftp:thost-box:restic.

Can I see restic's history?

Yes: restic snapshots lists them. The Storage Box's own nightly snapshots are extra protection on top.

Did this not solve it? Open a support ticket and tell us which guide you followed. We answer every ticket ourselves.