LibrePortal
Sponsor Get started

Hetzner Storage Box

How to use a Hetzner Storage Box as the outside place for your backups: order it, give each server its own login and folder, and connect it in LibrePortal.

On this page
  1. Why one login for each server
  2. 1. Order a Storage Box
  3. 2. Switch on SSH
  4. 3. Make one sub-account for each server
  5. 4. Let the server in with its key
  6. 5. Connect it in LibrePortal
  7. Let LibreBackup do it

For a LibreBackup server, LibreBackup does steps 3 to 5 for you. Link Hetzner once, add a location, tick the sources, and each one gets its own login. Jump to Let LibreBackup do it. Not tested yet against a live Hetzner account.

A Storage Box is online storage that Hetzner rents out by the month. It has no programs and no screen. It only keeps files, and it is built to be reached over SSH, which is exactly what LibrePortal's backups use. That makes it a good outside place for your backups: it is in a different building from your server, it costs a fixed small amount, and nobody else's software runs on it.

Your backups are encrypted before they leave the server, so Hetzner only ever sees scrambled files.

Why one login for each server#

A Storage Box has one main login. Do not give that to your servers. Make a sub-account for each server instead:

  • Each server gets its own folder and cannot see the others.
  • If one server is ever lost or taken over, you delete just its sub-account and the rest stay safe.
  • The main login stays with you, in your password manager.

1. Order a Storage Box#

  1. Sign in to your Hetzner account and open Storage Boxes.
  2. Choose a size that fits your backups. Start small, you can grow it later.
  3. Pick a place for it and order it. It is ready in a minute or two.

2. Switch on SSH#

  1. Open your Storage Box and go to its Settings.
  2. Turn on SSH support.
  3. Leave External reachability on if your server is not at Hetzner. A server inside Hetzner's own network does not need it.

3. Make one sub-account for each server#

  1. In the Storage Box, open Sub-accounts and press Create.
  2. Give it a home directory of its own, for example /backups/my-server. The folder is made for you.
  3. Set a password and write it down for now.
  4. Turn on SSH support, and External reachability if needed. Leave Read only off, or the server cannot write its backups.
  5. Save. Hetzner shows its user name, which looks like u123456-sub1.

4. Let the server in with its key#

On the server, add its key to the sub-account. Replace the user name and the address with the ones Hetzner shows you:

ssh-keygen -t ed25519 -f ~/.ssh/storagebox -N ""
cat ~/.ssh/storagebox.pub | ssh -p 23 u123456-sub1@u123456.your-storagebox.de install-ssh-key

It asks for the sub-account password once. After that the server logs in with its key and the password is not needed any more. Port 23 is the Storage Box's SSH port, not 22.

5. Connect it in LibrePortal#

  1. Open Backups, then Locations, and add a new location.
  2. Choose SFTP.
  3. Fill in the address (u123456.your-storagebox.de), port 23, the user name (u123456-sub1) and the folder.
  4. Save. LibrePortal tests the connection and makes the first backup there.

Do the same for each server, with its own sub-account and folder. Remember to save each location's repository password. See Backups and restore.

Let LibreBackup do it#

A LibreBackup server does the sub-account steps for you. You only order the box (step 1) and make one API token. In the LibreBackup panel:

  1. Companies. Open Companies and press Link Hetzner. In the Hetzner Console open your project, then Security, then API Tokens, make a token with read and write access, and paste it. LibreBackup checks it, lists your Storage Boxes and asks which one to use. The token stays on the backup server and is never shown again.
  2. Locations. Still on Companies, press Add location and choose Hetzner Storage Box. A location is an outside place backups are sent to. The words are the same as in LibrePortal under Backups, Locations.
  3. Tick the sources. Open a source, then its Locations tab, and tick the location. For this server itself, tick it on the Companies page. Each ticked source gets its own sub-account, with its own folder (libreportal/<source>), its own random password and only SSH switched on. LibreBackup installs its key there, runs a test copy, and says how it went.
  4. Check. Each source then shows Outside copy: Hetzner box, last copy .... The Vault spare copy tick is there but says Coming soon.

If a sub-account for a source already exists (the label libreportal-source marks it), LibreBackup reuses it and gives it a new password instead of making a second one. Removing a tick stops the copies and leaves what is already at Hetzner. Delete the sub-account in the Hetzner Console if you want it gone.

On the command line the same steps are librebackup company link hetzner, librebackup location add hetzner and librebackup source locations <source> --add hetzner-1, each with --json. The LibrePortal app uses these.

Back to Backups and restore.

Next steps