Google did away with its free photo backups quite a long time ago, instead opting to count even compressed backups against your overall Google Drive usage. While Google's pricing isn't bad for storage ($20 annually or $2 a month for 100GB), it's actually possible to get even cheaper elsewhere, all while maintaining control of your data. Combining Immich and Backblaze B2, a terabyte of storage is merely $6 a month, and you pay for what you use, so the costs are even less than that for most people.
For this configuration, I'm using TrueNAS Scale and Immich, with my photos backed up via Nextcloud to a shared dataset that Immich can access. However, you can back up your photos directly to Immich using the official Immich app, so Nextcloud isn't required. What you need to ensure is that your Immich folders have their own dataset in TrueNAS so that they can be backed up through a Cloud Sync task. You're good to go once you've got all that set up. I'm using a Backblaze B2 storage bucket as it's low-cost, and the company itself has many employees active on social media, such as Reddit, to answer questions from community members.
Having an off-site backup is a vital part of a 3-2-1 backup strategy and is incredibly useful in disaster recovery scenarios. With systems like TrueNAS natively supporting Backblaze B2, it's easy and cost-effective to protect your data. There are plenty of other backup services out there, too, and you can research others to see if they better suit you. Backblaze has another backup tier, called computer backup, which can back up your entire computer and costs $9 a month or $99 a year, though this is aimed at computers rather than a home server, while also lacking the additional flexibility of B2.
In case you're wondering why Backblaze is significantly cheaper than competitors, part of it comes down to data redundancy. The company doesn't have the same level of redundancy as Amazon would with S3, for example. If the Backblaze building housing your data were to disappear tomorrow, your data would be irretrievable. As already mentioned, though, it should be part of a 3-2-1 backup strategy, and not your only place for backups. As company co-founder Brian Wilson once wrote, in the event that a "meteor hits our datacenter", "the hope is your laptop isn't hit by the same meteor so you still have a primary copy of the data. If you want something completely and utterly failsafe as a primary and sole backup, then Backblaze isn't your answer, but you will have to spend significantly more for that level of safety.
Configuring Backblaze B2
It's pretty simple
Backblaze is pretty easy to set up, and all you need to do is make an account and create a storage bucket. The first 10GB of storage is free, so you can configure it and test it out to ensure that it works before committing to it. When making a bucket, you can configure it any way that you like, though I recommend making it private, enabling encryption, and disabling object lock. Object lock will prevent files from being modified or changed for a period of time, which in most personal use cases isn't necessary.
There are some reasons why you may want to use object lock, and certain types of files where it makes sense. For example, if you want to make use of this just for photos, you can make one bucket that just contains your photos and enable object lock, and then make another bucket that contains everything else with object lock disabled. With object lock enabled, for example, you can't modify specific files, which means that databases for applications you may also choose to backup to Backblaze won't be backed up properly, as the configuration files won't be updated.
Next, you'll need to create an application key on the left-hand side. You can name this anything you want, but make sure that it points to your B2 bucket that you just created. Give it read and write access to the bucket, and you can choose to only allow it access to files with a specific prefix or only allow it to access your files for a limited period of time before it needs to be refreshed. These, again, are additional security features that aren't required, but can be useful in certain situations. Save the key name and the actual key that was generated, as the key is only shown when generated. If you lose your key, you'll need to generate a new one.
Configuring TrueNAS
It has native support for Backblaze
Adding a Cloud Sync task in TrueNAS is incredibly easy, and you can configure your backups with other tools like Duplicati and Kopia, too. Backblaze B2 support is fairly universal, and most tools support it thanks to Backblaze's S3-compatible API. When it was first introduced, this meant that tools aimed at backing up to Amazon S3 simply just worked with minimal changes required once they were pointed at Backblaze B2 instead. In TrueNAS, all you need to do is add a Cloud Sync task, add new credentials, and enter your key ID and your application key, and it'll just work.
Once you've verified your credentials, you'll need to configure your settings. Here's what I use, but you're welcome to change these if you need to or feel that something may better suit your needs.
- Direction: Push
- Transfer mode: Sync
-
Advanced options
- Transfers: High bandwidth (16)
- Use --fast-list: Checked
I also recommend enabling remote encryption if you aren't using sync, as you can protect your data with an encryption key and salt.
Setting transfer mode to sync means that your Backblaze B2 bucket will be a one-to-one replica of the data that you back up to it. In other words, files that are changed on your home server will be changed on the server too. This has upsides and downsides. For example, a photo that you backed up and deleted will be removed on the next synchronization, but it also means that files you delete by accident are gone on the next sync, too. If you'd prefer to avoid this scenario, you can create two backup tasks, with files you want to synchronize in one backup task, and files you want to backup everything (even things that are deleted) in another backup task, using the Copy transfer mode instead of sync. I recommend using sync when backing up application datasets with configuration files at the very least, as restoring your data in the future may restore older configuration files that render the restore unusable.
As for "use --fast-list", this setting will reduce the cost of transfers. When transferring files, your backup client needs to know what's already in the server, and it will list the files that are contained so that it knows what to check. The --fast-list flag pulls 1,000 files at a time, whereas having it disabled will mean that it goes directory by directory, listing individual contents. By listing 1,000 files at a time, you limit it to one API call per 1,000 files. This isn't a huge problem for smaller datasets, but it can be a killer in certain scenarios if you're backing up a lot of files with nested folders. Even then, you still get 2,500 free "Class C" transactions every day on Backblaze, which includes listing files. Still, you may as well enable this feature, even just to save you needing to remember it in the future.
Cloud storage doesn't have to be expensive
You just have to manage it yourself
While running your own backups can seem daunting and you may assume it will be expensive, that isn't always the reality, as we can see here. Backblaze is extremely cost-effective, without any minimum costs and charging by the hour, per gigabyte. You can retrieve up to three times your storage for free in the month as well, meaning that if you store 500GB of data, you can pull 1.5TB per month for free, with it costing $0.01 per gigabyte after that. Right now, for 22GB of data, I'm paying approximately $0.07 a month, with Brian Wilson once saying that payments will only be taken around the $3 mark so that the company isn't paying a transaction fee that could be higher than the actual money it collects. Their comment was made two years ago, though, so it may be the case that this has changed since.
Wilson also makes a great point on the cost of local storage, and one that I hadn't really thought about myself until I came across his comment.
On the other side of it (downloading) on each day, the first 1 GByte is free to download to Backblaze (each day). So if you are talking about 5 MByte images you can download that image 200 times totally for free. I don't think that's expensive. On the other hand if you are a professional photographer taking 1 GByte movies, and you want to upload and download that 1 GByte movie clip 200 times per day, that will cost you $2/day which still doesn't sound like that much money to me. But for a student with no income, they may not be able to afford that $60/month so that's kind of a judgement call.
Stepping back, a lot of people don't quite calculate their own storage costs correctly. If you use a product like "Kill-a-Watt" to measure how much electricity a local external hard drive is using, and multiply that by how much that electricity costs in your home, you might be surprised on how much a local hard drive costs to operate. It's probably about $50/year. Then the drive only really lasts 5 years before it dies. So local storage purchased for $100 might cost $70/year to the customer, but they perceive it as "free storage" and can't IMAGINE spending $70/year to store files on some expensive "cloud service". Even though it's about the same cost.
It's an excellent point in favor of cloud storage and makes a lot of sense. Even in my case, I am in the process of migrating older data that will bring my usage of Backblaze up to approximately 100GB of storage, which will still only cost me about $0.60 a month to store. In comparison to Google's $2, that's quite a significant saving. Sure, Google handles all of the setup for you, so there's a convenience charge, but with Backblaze, you're also retaining control of your data. It's a trade-off, but one that I'm personally happy to make.
Once everything is configured, it just runs itself, and I've been using this setup for a few weeks now. If you're curious, give it a try; you don't even need a credit card to make an account, so you can just point it at a dataset on your NAS and see if it works for you before making a full-on commitment.
Self-hosting vs. cloud storage: Which one really protects your data?
Between convenience and data control, both come with trade-offs
