Drupal is a registered trademark of Dries Buytaert
drupal 11.4.1 Update released for Drupal core (11.4.1)! drupal 11.4.0 Update released for Drupal core (11.4.0)! drupal 10.6.12 Update released for Drupal core (10.6.12)! drupal 11.3.13 Update released for Drupal core (11.3.13)! drupal 10.6.11 Update released for Drupal core (10.6.11)! drupal 11.3.12 Update released for Drupal core (11.3.12)! drupal 11.2.14 Update released for Drupal core (11.2.14)! drupal 10.5.12 Update released for Drupal core (10.5.12)! cms 2.1.3 Update released for Drupal core (2.1.3)! drupal 10.5.11 Update released for Drupal core (10.5.11)! drupal 11.3.11 Update released for Drupal core (11.3.11)! drupal 11.2.13 Update released for Drupal core (11.2.13)! drupal 10.6.10 Update released for Drupal core (10.6.10)! cms 2.1.2 Update released for Drupal core (2.1.2)! drupal 11.1.10 Update released for Drupal core (11.1.10)! drupal 10.5.10 Update released for Drupal core (10.5.10)! drupal 10.4.10 Update released for Drupal core (10.4.10)! drupal 11.2.12 Update released for Drupal core (11.2.12)! drupal 11.3.10 Update released for Drupal core (11.3.10)! drupal 10.6.9 Update released for Drupal core (10.6.9)!

Manage Cloudflare R2 object storage buckets from Drupal as configuration: define a bucket, choose public or private access, and let other Cloudflare modules store and serve files from it.

Cloudflare R2 is S3-compatible object storage with no egress fees. This module models each R2 bucket as a first-class Drupal asset (a configuration entity), provisions and inspects it through the Cloudflare API, and keeps its public or private state in sync. On its own it does not serve files; it is the shared bucket layer that file systems and caches build on. For an R2-backed public and private file system, install Cloudflare R2 File System.

Features

  • An R2 bucket configuration entity (bucket name, credential set, and public or private access), managed from an admin screen.
  • Public or private access is authoritative in Drupal and reconciled to the R2 API, so a private bucket is genuinely unreachable publicly rather than just served differently.
  • Public URLs resolved from the Cloudflare API: a custom domain when one is set, otherwise the managed r2.dev domain.
  • Bucket provisioning and inspection through the Cloudflare SDK's primitive and reconciler framework, so a feature module can declare the bucket it needs and have it created.
  • The R2 S3 keypair (access key ID and secret) is resolved from settings.php, kept out of configuration and the database.

Use this module when another Cloudflare module needs an R2 bucket, or when you want to define and provision R2 buckets from Drupal rather than from the Cloudflare dashboard.

Post-Installation

This module has no user-facing output of its own; it provides bucket assets that other modules consume. After enabling it:

  1. Make sure you have a credential set from the Cloudflare SDK, with its account ID and API token in settings.php.
  2. Add that credential set's R2 S3 keypair (access key ID and secret) to settings.php.
  3. Add a bucket at Configuration > Web services > Cloudflare R2 buckets: give it a label, the R2 bucket name, the credential set, and whether it is public or private.

Other Cloudflare modules then reference the bucket by its machine name.

Additional Requirements

Requires the Cloudflare SDK and Cloudflare API modules, which Composer installs automatically, plus a Cloudflare account with R2 enabled and an R2 S3 access keypair. Install with Composer:

composer require drupal/cloudflare_storage

While the suite is in alpha, require it as drupal/cloudflare_storage:^1.0@alpha (or set your project's minimum-stability to alpha) so the pre-stable releases resolve.

Cloudflare R2 File System turns a bucket into a Drupal file system for public and private files, including on-demand image styles.

Similar projects

S3 File System stores files in Amazon S3 or S3-compatible services. This module is R2-specific: it manages the bucket as Drupal configuration, provisions it through the Cloudflare API, and controls public or private access at Cloudflare rather than only in how files are served. It pairs with Cloudflare R2 File System for the file system itself.

Supporting this Module

Issue reports, patches and feedback are welcome in the project's issue queue.

Community Documentation

For creating a Cloudflare API token, see Cloudflare's documentation at developers.cloudflare.com/fundamentals/api/get-started/create-token. For R2, see developers.cloudflare.com/r2.

Activity

Total releases
1
First release
Jul 2026
Latest release
4 hours ago
Release cadence
Stability
0% stable

Releases

Version Type Release date
1.0.0-alpha1 Pre-release Jul 7, 2026