R2D2

Obtaining Cloudflare R2 Credentials

A step-by-step guide on how to obtain your Cloudflare R2 Access Key ID, Secret Access Key, and Account ID.

Obtaining Cloudflare R2 Credentials

Before you can use the r2d2 CLI to upload files to your Cloudflare R2 bucket, you need to obtain your R2 credentials:

  • Access Key ID
  • Secret Access Key
  • Account ID

Follow these steps to retrieve your credentials from the Cloudflare dashboard:

1. Log in to the Cloudflare Dashboard

2. Navigate to R2

  • In the Cloudflare dashboard, click on the "R2" icon in the left-hand navigation menu.

3. Create or Select a Bucket (if you haven't already)

  • If you don't have an existing R2 bucket, create one by clicking the "Create bucket" button.
  • If you already have a bucket, select the bucket you want to use.

4. Create an API Token

  • Click on "Manage R2 API Tokens"

  • Click on "Create API Token"

  • Give a name for the API Token.

  • Select the "Admin Read & Write" Permission

  • The scope should be your Account

    Manage R2 API Tokens

5. Obtain Your Credentials

  • After you create the API Token you will see the Access Key ID and the Secret Access Key

    R2 API Tokens generated

6. Obtain your Account ID

  • The Account ID can be found in the URL when you are on the main page of R2. It's also on the bottom of the main page

On this page