How to use s3cmd with Backblaze B2 Cloud Storage

s3cmd is a free command line tool and client for uploading, retrieving, and managing data in Amazon S3 and other cloud storage service providers that use the S3 protocol, such as Backblaze B2 Cloud Storage.

Please note that if you are using a bucket-restricted Application Key that it will require the List All Bucket Names permission to work successfully with the S3 Compatible API. If you did not select this when you created your Application Key you will need to create a new key with the required permission enabled. 

Versions of s3cmd prior to 2.1 are not compatible with the S3 Compatible API as certain calls will default to v2 signatures which are not supported in B2 Cloud Storage. You can download the latest version here.

s3cmd can be configured with B2 Cloud Storage by following the steps below.

Step 1:

Configure s3cmd with the following command:

python s3cmd --configure


Step 2:

Enter the Key ID, Application Key, and S3 Endpoint into the appropriate fields.


For the region, enter the second part of the URL.  In this example it is “us-west-002”



Access key and Secret key are your identifiers for Amazon S3. Leave them empty for using the env variables.

Access Key: 0xxxxxxxxxxxxxxxx7

Secret Key: KyyyyyyyyyyyyyyyyyyyQ

Default Region [US]: us-west-002


Use "" for S3 Endpoint and not modify it to the target Amazon S3.

S3 Endpoint []:


Use "%(bucket)" to the target Amazon S3. "%(bucket)s" and "%(location)s" vars can be used

if the target S3 system supports dns based buckets.

DNS-style bucket+hostname:port template for accessing a bucket [%(bucket)]: %(bucket)


Encryption password is used to protect your files from reading

by unauthorized persons while in transfer to S3

Encryption password:

Path to GPG program [/usr/bin/gpg]:


When using secure HTTPS protocol all communication with Amazon S3

servers is protected from 3rd party eavesdropping. This method is

slower than plain HTTP, and can only be proxied with Python 2.7 or newer

Use HTTPS protocol [Yes]:


On some networks all internet access must go through a HTTP proxy.

Try setting it here if you can't connect to S3 directly

HTTP Proxy server name:


New settings:

  Access Key: 0xxxxxxxxxxxxxxxx7

  Secret Key: KyyyyyyyyyyyyyyyyyyyQ

  Default Region: us-west-002

  S3 Endpoint:

  DNS-style bucket+hostname:port template for accessing a bucket: %(bucket)

  Encryption password:

  Path to GPG program: /usr/bin/gpg

  Use HTTPS protocol: True

  HTTP Proxy server name:

  HTTP Proxy server port: 0


If you receive a 403 error upon verifying the configuration, this likely means that you have created a bucket-restricted key and not enabled the List All Bucket Names permission. Please create a new key and ensure this option is selected and you will be able to complete the setup of s3cmd. 


The S3 Compatible API for Backblaze B2 Cloud Storage allows 1000’s of integrations to work with B2 Cloud Storage natively. If you’re new to the S3 Compatible API, please see our Getting Started Guide. If you have any trouble using s3cmd with B2, please let us know by emailing us at



Have more questions? Submit a request


Article is closed for comments.
Powered by Zendesk