Cloudflare R2
The Cloudflare R2 integrationIntegrations connect and integrate Home Assistant with your devices, services, and more. [Learn more] allows you to use Cloudflare R2
Prerequisites
This integration requires an existing R2 bucket and admin access to the bucket so you can create a Secret Access Key.
Create a new Cloudflare R2 bucket
- Log in to your Cloudflare Dashboard
. - On the sidebar, go to Storage & databases, click on R2 object storage and then Overview.
- Select + Create bucket.
- Choose a unique Bucket name (e.g.,
home-assistant-backups-123456). - Select your preferred location
. - Select your preferred storage class
(Standard is fine, as Infrequent Access is still in beta) - Select Create bucket.
Make a note of the bucket name — you’ll need it later.
Create an API Token/Secret Key
To create a new Secret Key that can access the R2 bucket:
- Go back to the R2 object storage > Overview page.
- Click Manage API Tokens.
- Click Create User API token.
- Give it a name like
Home Assistant Backup. - Check Object Read & Write.
- Click Apply to specific buckets only and chose the bucket you created previously (e.g.,
home-assistant-backups-123456). - Do not touch the other options and click Create User API Token.
- Save the Access Key ID, the Secret Access Key and also the S3 endpoint — you’ll need these when setting up the Cloudflare R2 integration in Home Assistant.
-
Avoid using credentials and API Keys that have more permissions than is necessary.
-
By limiting credentials to a specific bucket, you reduce risk and help keep your Cloudflare account secure.
Configuration
To add the Cloudflare R2 service to your Home Assistant instance, use this My button:
Manual configuration steps
If the above My button doesn’t work, you can also perform the following steps manually:
-
Browse to your Home Assistant instance.
-
In the bottom right corner, select the
Add Integration button. -
From the list, select Cloudflare R2.
-
Follow the instructions on screen to complete the setup.
Secret access key to connect to Cloudflare R2. See Cloudflare documentation
R2 bucket name to store the backups. Bucket must already exist and be writable by the provided credentials.
Removing the integration
To remove an integration instance from Home Assistant
- Go to Settings > Devices & services and select the integration card.
- From the list of devices, select the integration instance you want to remove.
- Next to the entry, select the three dots
menu. Then, select Delete.