---
description: Configure R2 Object Storage with Regional Services and Customer Metadata Boundary.
title: R2 Object Storage
image: https://developers.cloudflare.com/og-docs.png
---

[Skip to content](#main-content)

> Documentation Index  
> Fetch the complete documentation index at: https://developers.cloudflare.com/data-localization/llms.txt  
> Use this file to discover all available pages before exploring further.

# R2 Object Storage

Last updated Aug 24, 2026|Copy as Markdown|[View as Markdown](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/data-localization/how-to/r2/index.md)|[Agent setup](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/agent-setup/)

The following sections describe how to configure R2 Object Storage with Regional Services and Customer Metadata Boundary to control where object requests are processed and where logs are stored.

## Regional Services

To configure Regional Services for hostnames [proxied](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/dns/proxy-status/) (meaning traffic routes through Cloudflare) through Cloudflare and ensure that processing of requests to an [R2 Bucket](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/buckets/) occurs only in-region, follow these steps:

1. In the Cloudflare dashboard, go to the **R2** page.  
[Go to **Overview** ↗](https://dash.cloudflare.com/?to=/:account/r2/overview)
2. Follow the steps to [create a Bucket](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/buckets/create-buckets/).
3. [Connect a bucket to a custom domain](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/buckets/public-buckets/#connect-a-bucket-to-a-custom-domain).
4. Run the [API POST](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/data-localization/regional-services/regional-hostnames/#configure-regional-services-via-api) command on the configured bucket custom domain to create a `regional_hostnames` with a specific region.

Regional Services only applies to the custom domain configured for an R2 Bucket.

### Send logs to R2 via S3-Compatible endpoint

The following instructions will show you how to set up a Logpush job using an S3-compatible endpoint to store logs in an R2 bucket in the jurisdiction of your choice.

1. Create an [R2 bucket](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/get-started/) in your Cloudflare account and select the [jurisdiction](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/reference/data-location/#set-jurisdiction-via-the-cloudflare-dashboard) you would like to use.
2. Generate an API token for your R2 bucket. You have the following two options:

Generate a token for a specific bucket (recommended)

Go to the R2 section of your Cloudflare dashboard and select **Manage R2 API Tokens** to generate a token directly tied to your specific bucket. You can follow the instructions in the [Authentication](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/api/tokens/) section.

Generate a token for all buckets

You can generate a API token in **Manage Account** \> **Account API Tokens** or you can create a user-specific token:

1. Go to **My Profile** \> **API Tokens**
2. Select **Create Token** \> **Create Custom Token**
3. Choose **Account** \> **Workers R2 Storage** \> **Edit** to set permissions.
4. To test your token, copy the `curl` command and paste it into a terminal.

```bash
curl "https://api.cloudflare.com/client/v4/user/tokens/verify" \
--header "Authorization: Bearer <API_TOKEN>"
```

The result:

```json
{
	"result": {
		"id": "325xxxxcd",
		"status": "active"
	},
	"success": true,
	"errors": [],
	"messages": [
		{
			"code": 10000,
			"message": "This API Token is valid and active",
			"type": null
		}
	]
}
```

1. Generate a SHA-256 hash of the token:

```bash
echo -n "<token>" | shasum -a 256
```

This command will output a hash similar to `dxxxx391b`.

1. Set up a Logpush destination using [S3-compatible endpoint](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/logs/logpush/logpush-job/enable-destinations/s3-compatible-endpoints/) and fill in the following fields:
* **Bucket**: Enter the name of the R2 bucket you created with the jurisdiction you would like to use.
* **Path** (optional): If you want, you can specify a folder path to organize your logs.
* **Endpoint URL**: Provide the S3 API endpoint for your bucket in the format `<account-id>.eu.r2.cloudflarestorage.com`. Do not include the bucket name, as it was set in the first field.
* **Bucket Region**: For instance, use `WEUR` to specify the EU region.
* **Access Key ID**: Enter the Token ID created previously (`325xxxxcd`).
* **Secret Access Key**: Use the SHA-256 hash of the token (`dxxxx391b`).

Complete the configuration by selecting the fields you want to push to your R2 bucket.

## Customer Metadata Boundary

With Customer Metadata Boundary set to `EU`, **R2** \> **Bucket** \> [**Metrics**](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/platform/metrics-analytics/) tab in the account dashboard will be populated.

Note

Additionally, customers can create R2 buckets with [jurisdictional restrictions set to EU](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/reference/data-location/#jurisdictional-restrictions). In this case, we recommend [using jurisdictions with the S3 API](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/reference/data-location/#using-jurisdictions-with-the-s3-api).

Refer to the [R2 documentation](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/r2/) for more information.

Was this helpful?

YesNo

## On this page

[![](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/_astro/logo.te5VL_aD.svg)Docs](https://docs-durable-objects-instance-replaced-errors.previews.developers.cloudflare.com/)

```json
{"@context":"https://schema.org","@type":"TechArticle","@id":"https://developers.cloudflare.com/data-localization/how-to/r2/#page","headline":"R2 Object Storage · Cloudflare Data Localization Suite docs","description":"Configure R2 Object Storage with Regional Services and Customer Metadata Boundary.","url":"https://developers.cloudflare.com/data-localization/how-to/r2/","inLanguage":"en","image":"https://developers.cloudflare.com/og-docs.png","dateModified":"2026-08-24","publisher":{"@type":"Organization","name":"Cloudflare","description":"One platform for your apps, agents, and workforce. Build, secure, and scale without managing infrastructure","url":"https://www.cloudflare.com/","sameAs":["https://github.com/cloudflare","https://www.linkedin.com/company/cloudflare","https://x.com/cloudflare"],"logo":{"@type":"ImageObject","url":"https://developers.cloudflare.com/logo.svg"},"address":{"@type":"PostalAddress","streetAddress":"101 Townsend St","addressLocality":"San Francisco","addressRegion":"CA","postalCode":"94107","addressCountry":"US"},"contactPoint":[{"@type":"ContactPoint","contactType":"Customer Support","url":"https://support.cloudflare.com/","availableLanguage":["English"]},{"@type":"ContactPoint","contactType":"Sales","url":"https://www.cloudflare.com/contact/","availableLanguage":["English"]}]},"isPartOf":{"@type":"WebSite","@id":"https://developers.cloudflare.com/#website","name":"Cloudflare Docs","url":"https://developers.cloudflare.com/"},"keywords":["S3","Logging"]}
```
