Setting up backup and image uploads to Backblaze B2

So I was following the Digital Ocean Spaces guide, and I started looking around for cheaper providers for my (very) small community. I noticed this old post which confused me, because I had just looked at Backblaze B2 and saw that it was S3 compatible. Turns out they launched the feature 30 minutes before I had looked (what luck!). So I have decided to write a quick guide on how I got it to work with my current community:

Step 1: Configuring Backblaze B2 Cloud Storage

Create Account
Go to B2 Cloud Storage and click on Sign Up Today.

Generate App Key
Click on “App Keys” or go to this page. Click “Add New Application Key”, name it, then click “Create New Key”. Make sure you record the keyID and applicationKey as they will be hidden once you leave the page.

Create Upload and Backups buckets
Go back to the buckets page and create your desired buckets. Make sure the uploads one is public, and the backups one is private. (TODO: Test auto creation from discourse)

Step 2: Configuring Discourse

This step mostly follows the Digital Ocean Spaces guide, with the following notable differences:

  • Use your App Key keyID with the s3 keyID field.
  • Use the App Key applicationKey with the s3 secret access key field.
  • Use the s3 endpoint provided in the App Key.
  • Leave the CDN blank unless you are providing your own.

For more information on Backblaze B2 S3 compatibility, see this blog post.

8 Likes

So has the Backblaze substitution been working seamlessly for you, no glitches?

I just came here looking for info as I notice it provides 10 GB of free space which would reduce my hosting costs. I’d need to migrate my existing S3 content first though. I’m also curious if anyone has migrated a live instance of Discource from S3 to Backblaze.

1 Like

Instead of carrying this topic, let’s get it added to the s3 clones listing:

5 Likes

Old thread, but this guide was exactly what I was looking for. I have a small community as well and have been looking at storing our images and backups in the cloud, instead of on our main server with digitalocean. This should help our site run smoother by reducing the server load from image files.

I like how backblaze has a partnership with cloudflare to allow for free data transfer. We already use the free tier of cloudflare for DDOS protection. So with no fees on data transfer, this should save us money as we only have to pay for the storage. I’m going to try setting this up soon, with the additional step of including cloudflare in the mix.

1 Like

So I got backups to work correctly, backup in Discourse sends to my backup bucket at Backblaze.

However, Discourse image uploads aren’t appearing in my uploads bucket at Backblaze. I made sure it is set to public.

Any ideas?

@Bill I would recommend seeking support in Using Object Storage for Uploads (S3 Clones)

Given I just set this up successfully with cloudflare, I thought I’d share my experience. Cloudflare is not your traditional CDN. I’m using it for DDoS protection, SSL, and caching. However, to setup S3 storage, it seems you do need another CDN. I used BunnyCDN which is relatively inexpensive. You setup a pull zone that points to your upload bucket url (created in backblaze).

Then just follow the instructions here: Using Object Storage for Uploads (S3 Clones)

Note this only works for future files and images uploaded. It doesn’t transfer your old files.

3 Likes