this post was submitted on 25 Feb 2025
59 points (95.4% liked)

Selfhosted

49434 readers
902 users here now

A place to share alternatives to popular online services that can be self-hosted without giving up privacy or locking you into a service you don't control.

Rules:

  1. Be civil: we're here to support and learn from one another. Insults won't be tolerated. Flame wars are frowned upon.

  2. No spam posting.

  3. Posts have to be centered around self-hosting. There are other communities for discussing hardware or home computing. If it's not obvious why your post topic revolves around selfhosting, please include details to make it clear.

  4. Don't duplicate the full text of your blog or github here. Just post the link for folks to click.

  5. Submission headline should match the article title (don’t cherry-pick information from the title to fit your agenda).

  6. No trolling.

Resources:

Any issues on the community? Report it using the report flag.

Questions? DM the mods!

founded 2 years ago
MODERATORS
 

How would or do you backup your home server? I don't have enough physical storage (for now) at home to store some backups, so I want to upload it to the cloud. Of course I want the backup to be encrypted, but I don't want to enter the password every time by server does a backup. I am currently using borg on my PC and do it manually. How do I create a encrypted backup without entering the key manually? Do I hardcode it somewhere? Don't really like that. I am also fine with trying other backup software.

top 25 comments
sorted by: hot top controversial new old
[–] chameleon@fedia.io 17 points 4 months ago

Borg or the like with 'hardcoded' plaintext/regularly full-disk-encrypted key is acceptable. Someone that has your unencrypted private key sitting on your server has almost certainly already obtained access to the entire set of data you're backing up, with the backup key itself only meaningfully guarding access to older backups.

The more important thing is to securely keep extra copies in case the server fails. I keep mine in a group in my password manager, one per repo.

[–] dan@upvote.au 7 points 4 months ago* (last edited 4 months ago)

I use Borgbackup, with borgmatic to configure and periodically run it. I have two storage VPSes "in the cloud", and back up to both of them. My main storage VPS is a HostHatch one with 10TB space for $10/month. I got it during Black Friday sales in 2021.

If you do back up to multiple destinations, Borgbackup's devs recommend configuring two separate backups, rather than doing a backup to one server then syncing it to the second one. This is to handle the case where one of the backups becomes corrupted.

Hetzner have decent deals on their "storage boxes". You don't get root access, but they support Borgbackup, restic and rclone in addition to the regular protocols (SFTP, FTPS, WebDAV, SMB).

Make sure you configure the SSH key to only allow it to run borgbackup in "append only" mode, so that malware/ransomware on the client system can't delete the backups. This is a common issue with other backup solutions like rsync - the client has full access to the server, so a malicious user/code could delete the whole backup.

[–] conrad82@lemmy.world 5 points 4 months ago

I run proxmox, and proxmox backup server in a vm. PBS backup is encrypted locally, and I upload the backup to backblaze b2 using rclone in a cron job. I store the decryption key elsewhere

It has worked ok for me. I also upload a heartbeat file, it is just a empty file with todays date (touch heartbeat), so that I can easily check when the last upload happened

[–] ocean@lemmy.selfhostcat.com 5 points 4 months ago (1 children)

How many tb? It may be cheaper even within a year to just purchase another hard drive

[–] hendu@lemmy.dbzer0.com 1 points 4 months ago (1 children)

An extra hard drive doesn't save you from something like your house burning down. Off-site backups are important!

[–] ocean@lemmy.selfhostcat.com 2 points 4 months ago

Send it to your parents and work is what I do :)

[–] sxan@midwest.social 3 points 4 months ago

Restic to BackBlaze. B2 support is built in to restic, so all you need is an account and credentials.

Most of my home data - servers, PCs - I back up to HD and B2. I have a few VPS I only back up to B2.

[–] MangoPenguin@lemmy.blahaj.zone 3 points 4 months ago

I use backblaze b2 and https://github.com/garethgeorge/backrest

Backrest is by far the best restic manager I've found, easy webUI, with built in support for healthchecks.

[–] nick_99@sh.itjust.works 2 points 4 months ago

For servers autorestic just worked. It's a wrapper for restic. I sent data to backlaze B2 and StorJ. Now that I have a couple proxmox hosts in a colo, I have an off-site PBS running in ZFS.rent.

First VMs back up to local PBS , then nightly that's synced to ZFS.rent. I have PVE set to do encrypted backups to PBS so it's all encrypted.

[–] just_another_person@lemmy.world 2 points 4 months ago (1 children)

It'll cost you more storing it in cloud than just buying more drives. If you're already in a spot where that's a problem, this is not a solution for you.

[–] Linsensuppe@feddit.org 3 points 4 months ago (2 children)

Yes, but I use the cloud for other purposes too and have enough storage for a backup, also even if I were to buy another drive, I would like to store one copy offsite without having to buy two drives

[–] just_another_person@lemmy.world 2 points 4 months ago (1 children)

I'd calculate your total cost then, and figure out ingress and egress costs depending on the provider. Cloudflare with R2 is the only "cloud" storage service I'm aware of that doesn't charge for either right now. They may in the future so check out your costs.

[–] dan@upvote.au 2 points 4 months ago* (last edited 4 months ago)

is the only "cloud" storage service I'm aware of that doesn't charge for either right now

Hetzner doesn't either for their storage boxes. They support Borgbackup, restic, rclone, SFTP, FTPS, WebDAV and SMB.

Most storage VPSes will include a decent amount of traffic per month.

[–] doodledup@lemmy.world 1 points 4 months ago* (last edited 4 months ago)

If you want I can hit you up with a couple TB S3 compatible block storage against a small compensation covering electricity. I've got about 30TB available of my 64TB that are just doing nothing right now, it's a shame really. I'm running a TrueNAS homelab in a RaidZ2 with battery backup and proper Firewall and IDS/IPS protection (but I'm not a professional). If that's fine DM me.

[–] CaptainPedantic@lemmy.world 2 points 4 months ago (2 children)

I use Kopia to backup to Backblaze B2. I also use the Kopia UI since I can't be bothered to figure out the cli for it. I have it running constantly in the background so it automatically takes care of everything.

[–] nesuno@sh.itjust.works 2 points 4 months ago

This. 100% me. I have been using Kopia+BB and I am happily surprised.

[–] shiftymccool@programming.dev 1 points 4 months ago

Kopia doesn't get enough love, it's awesome

[–] Smash@lemmy.self-hosted.site 1 points 4 months ago

GoodSync can encrypt files during upload

[–] sznowicki@lemmy.world 1 points 4 months ago

Check Borg documentation. Somewhere there there’s a way to pass the password as an environmental variable.

[–] PetteriPano@lemmy.world 1 points 4 months ago* (last edited 4 months ago)

I have a storagebox at hetzner. My script does:

  • Mount the storagebox over sshfs with public key file
  • Mount a gocryptfs folder, with supplied key on local file
  • Rsync my stuff to the encrypted folder
  • Unmounts in reverse order

I can access the storagebox by password, too. So this is my disaster recovery in case my house burns down with all my devices. I'll just buy another laptop the next day, and me and the Mrs can admire all my code and our wedding videos within a few hours.

[–] 0x0@programming.dev 1 points 4 months ago

I use a cryptomator mount and sync that to whichever cloud i want, but the un/mounting is manual.
If you need full disk encryption look at ZFS and snapshots.
Do you need to backup everything on the disk?

[–] geography082@lemm.ee 0 points 4 months ago* (last edited 4 months ago) (2 children)

Duplicati, has many cloud providers as destination. Encryption. Basic backup tools functionalities. I use Onedrive family plan which has a total of 6 TB for my backups. Other solid option is rclone , it does the same even more, but is more focused on sync than backup. Also many cloud providers supported. Both are Foss

[–] soisoy@lemm.ee 4 points 4 months ago (1 children)

I had constant problems with duplicati and switched to kopia with backblaze and it has been problem free, so I would tread very carefully with it. The database would work for a while and then get into a state that required a reset and would not have permitted a successful backup to be restored.

[–] geography082@lemm.ee 1 points 4 months ago* (last edited 4 months ago)

I had constant problems with duplicati

Yes i know, i had them too, and serious ones. It needs to always have an eye on it. I choose it because the large amount of cloud storage supported natively, and not have to configure and deal with rclone or even + restic to do a backup in home products like Onedrive. For me that's more noise and issues.

[–] MangoPenguin@lemmy.blahaj.zone 1 points 4 months ago

Backrest (restic) is what I use after constant duplicati problems. Kopia is also a good option.

Duplicati is ok with tiny backup sets, but give it multiple TB of data and it chokes and constantly has errors requiring expensive rebuilds.