Storage / Backblaze B2Menu

Backblaze B2Backblaze B2

Store your SFTP server's files in your own Backblaze B2 bucket, with an application key limited to that bucket.

B2 is low-cost storage with free egress up to three times the data you store each month. Each Backblaze account lives in one region (US West, US East, EU Central or CA East), chosen when the account is created.

Before you start

  • A Backblaze account with B2 enabled. Its region is fixed at sign-up, so create a new account if you need a different region.

1. Create the bucket

  1. In the Backblaze web console, go to B2 Cloud Storage → Buckets and choose Create a Bucket.
  2. Set Files in Bucket are to Private.
  3. Leave Object Lock disabled. It stops SFTP users from deleting or replacing files.
  4. Create the bucket and note the Endpoint shown on the bucket card, for example s3.eu-central-003.backblazeb2.com. The part between s3. and .backblazeb2.com is your region.

B2 keeps every version of a file by default, so overwritten and deleted files keep counting toward your storage. Open the bucket’s Lifecycle Settings and choose Keep only the last version of the file.

2. Create an application key

The master application key doesn’t work with the S3 API. Create an application key for the bucket:

  1. Go to Application Keys and choose Add a New Application Key.
  2. Name it, for example cloudfile.
  3. Under Allow Access to Bucket(s), pick your bucket.
  4. Set the type of access to Read and Write.
  5. Leave the file name prefix and expiry empty. Allow List All Bucket Names isn’t needed.
  6. Choose Create New Key and copy the keyID and applicationKey. Backblaze shows the applicationKey only once.

3. Connect it

In CloudFile, go to Storage → Add bucket and choose Backblaze B2:

Field Value
Bucket Your bucket name
Region The middle part of the bucket’s endpoint, e.g. eu-central-003
Endpoint https://s3.<region>.backblazeb2.com (filled in from the region)
Access key ID The keyID
Secret access key The applicationKey
Name Optional, e.g. Production
Path-style URLs Off

Click Test connection, then Save. To use the bucket, open a server and pick it under Settings → Storage.

Troubleshooting

  • Writing a test file failed with an invalid access key or signature error. You used the master application key, or the keyID and applicationKey are swapped. Create an application key as in step 2.
  • Writing a test file failed with a region or “bucket does not exist” error. The region doesn’t match your account. Copy it from the bucket’s Endpoint, for example us-west-004, not just us-west.
  • Writing a test file failed: Access Denied. The key is limited to a different bucket, is Read Only, or has a file name prefix. Application keys can’t be edited, so create a new one.
  • Deleting the test file failed. Object Lock is enabled on the bucket.

See Your own bucket for how files are laid out in the bucket.