Robin Gierse
Systems Administrator

Today I learned

How to use BorgBackup with rsync.net

4 min read

Today I learned: How to use BorgBackup with rsync.net. Actually I learned two ways to do it, but will focus on the usage of Borg through Vorta, because client backup is my primary goal.

What is rsync.net?

rsync.net is a storage provider that offers storage space at a considerable price in locations in the US, Switzerland and Hong Kong and accessible from all over the world through a plethora of protocols.

What is BorgBackup?

To quote their website:

BorgBackup (short: Borg) gives you:

    - Space efficient storage of backups.
    - Secure, authenticated encryption.
    - Compression: LZ4, zlib, LZMA, zstd (since borg 1.1.4).
    - Mountable backups with FUSE.
    - Easy installation on multiple platforms: Linux, macOS, BSD, ...
    - Free software (BSD license).
    - Backed by a large and active open source community. 

Simply put: Borg is a kick-ass backup tool, that keeps your data safe while preserving bandwidth and storage space.

What is Vorta?

Vorta is a client for Mac and Linux, that facilitates Borg to perform backups of your clients. The upside here is a nice interface that enables easy configuration and scheduling of backups.

What you need to get started

To get started, you need your rsync.net account set up. Be sure to change the default passwords as soon as you receive your welcome mail! Next you should enable key based authentication. It is a breeze with their howto. Obviously you also need Vorta installed. You can find setup information on their website, but you will likely find it in the software sources of your favorite Linux distribution anyway.

Getting started

Now we can get started. Fire up Vorta and start configuring. Vorta uses profiles, depending on what you want to do, one will suffice. Now you need to configure the repository URL, passphrase and encryption. Make sure to use a strong passphrase for authentication. The repository URL has the following format:

$USER@$ACCOUNT.rsync.net:$REPO_PATH

At rsync.net the values for $USER and $ACCOUNT should be the same. You can find them in your welcome email. $REPO_PATH is the relative path in your storage account. You could just use my_borg_backup as the folder name.

As encryption you have two good options: repokey and keyfile. Both provide secure encryption, although repokey stores the key for encryption in the repository, which leaves only the passphrase to protect your data. With keyfile the key will be stored in your local home directory. That way even on untrusted storage, no one can peek at your data.

Keep in mind to store that key somewhere else too, in case the backed up system dies!

After you initialized your repo like this, it is time to create your first and initial backup.

Hitting a bump

Well, not quite.

When I tried to initialize the repository, I got arbitrary error messages from Vorta. So I started debugging, tried to run Borg manually on command line, which eventually gave me the following error message:

Connection closed by remote host. Is borg working on the server?

This was about the time when I became suspicious: Did I misunderstand something here? So I reached out to rsync.net support, and boy do I like that experience! I asked the questions I had towards Borg on rsync.net and within one and a half hour I had a response, they were apologizing for the inconvenience, they already fixed the issue and left me with some more hints towards Borg. Awesome! Thanks for that great support experience!

After this the initialization went smoothly and I could do my initial backup.

Wrapping up

I am very happy with my initial experience with rsync.net. I have been using Borg and Vorta for some time now, so I am already very fond of that pieces of software. But rsync.net left a very pleasant first impression. My server backup is also running as I am writing this.

I might do a follow-up in the future, telling you if the experience stayed as good and how my server backup worked out. Stay tuned!