Skip to main content
drupalreleases

Use direct release data with your AI assistant.

Learn more

Cloudflare R2 File System

No security coverage Under active development 2 sites

Part of the Cloudflare ecosystem · 20 projects

This module stores Drupal files in Cloudflare R2 storage, serving public files directly from R2 and streaming private files through Drupal with access checks. Image styles are generated on demand and also stored in R2, avoiding egress fees.

Store Drupal's public and private files in a Cloudflare R2 bucket instead of the local server, with image styles generated on demand and served straight from R2 or a custom domain.

This module takes over Drupal's public or private file system (or a custom scheme you choose) and stores those files in a Cloudflare R2 bucket over the S3 API. Public files are served directly from R2 or your custom domain; private files stream through Drupal with its normal access checks. Image style derivatives are generated on demand and written back to the bucket. R2 has no egress fees, so serving files this way avoids per-request bandwidth charges.

Features

  • Binds a stream scheme to a managed R2 bucket: use public or private to take over Drupal's own file systems, or a custom scheme (such as media) for a specific use.
  • Public buckets serve files straight from R2 or a custom domain; private buckets stream through Drupal so access checks still apply.
  • Image styles are generated on demand and written back to the bucket, then served from there.
  • Requests are signed with AWS Signature Version 4; the R2 S3 keypair is read from settings.php.
  • Uses a bucket defined by Cloudflare Storage, so the bucket, credentials, and public or private state are managed in one place.

Post-Installation

You configure this module by adding a mount that binds a stream scheme to a bucket. After enabling it:

  1. Define an R2 bucket with Cloudflare Storage, including its credential set and public or private setting.
  2. Add a mount and choose the stream scheme it serves: public or private to take over Drupal's default file systems, or a custom scheme such as media.
  3. New uploads to that scheme are stored in R2. A public bucket serves them from R2 or your custom domain; a private bucket streams them through Drupal.

Additional Requirements

Requires Cloudflare Storage, the Cloudflare SDK and Cloudflare API modules, which Composer installs automatically, plus a Cloudflare account with R2 enabled and an R2 S3 access keypair. While the suite is in alpha, install it together with its alpha dependencies:

composer require drupal/cloudflare_r2fs:^1.0@alpha drupal/cloudflare_storage:^1.0@alpha drupal/cloudflare_sdk:^1.0@alpha drupal/cloudflare_api:^1.0@alpha

Composer applies a stability flag such as @alpha only to packages the root composer.json requires, so on a site with minimum-stability: stable, requiring this module alone fails. Alternatively, allow alpha releases site-wide with minimum-stability: alpha and prefer-stable: true.

Cloudflare Storage is required and defines the bucket this module serves from.

Similar projects

S3 File System stores files in Amazon S3 or S3-compatible services. This module is R2-specific and pairs with Cloudflare Storage: the bucket, its credentials, and its public or private state are managed as Drupal configuration, and public files can be served from a Cloudflare custom domain with no egress fees.

Supporting this Module

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

Community Documentation

For Cloudflare R2 and its S3 API, see Cloudflare's documentation at developers.cloudflare.com/r2.

Ask your assistant about Cloudflare R2 File System

Check compatibility with your Drupal and PHP version, maintenance and security coverage, from current release data. How it works

Depends on

Dependencies of the latest stable release

No dependencies recorded for this project.

Required by

Tracked projects that depend on this one

No tracked projects depend on this one yet.

Activity

Tracked releases
6
Tracked since
Jul 2026
Latest release
2 weeks ago
Releases (12 mo)
6 ▲ from 0
Maintenance
Active

Release Timeline

Releases

Version Type Core PHP Release date
1.0.0-alpha6 Pre-release 11 PHP >=8.3 Nov 1, 2026
1.0.0-alpha5 Pre-release 11 PHP >=8.3 Oct 31, 2026
1.0.0-alpha4 Pre-release 11 Jul 11, 2026
1.0.0-alpha3 Pre-release 11 Jul 11, 2026
1.0.0-alpha2 Pre-release 11 Jul 7, 2026
1.0.0-alpha1 Pre-release 11 Jul 7, 2026