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)!

Overview

Flysystem Cloudflare R2 provides a Cloudflare R2 storage adapter for the
Drupal Flysystem module. It builds on the Flysystem S3 adapter and registers
an r2 Flysystem driver for storing Drupal-managed files in a
Cloudflare R2 bucket.

Cloudflare R2 exposes an S3-compatible API, but it does not implement every
AWS S3 operation exactly the same way. This module adapts the existing
Flysystem S3 integration for R2 and handles R2's unsupported object ACL
visibility lookup by returning the configured default visibility.

Features

  • Provides a Flysystem adapter plugin with the driver ID r2.
  • Uses Cloudflare R2's S3-compatible API endpoint.
  • Supports public and private Flysystem stream wrappers.
  • Inherits most configuration options from flysystem_s3.
  • Works with Drupal's file system settings and Flysystem stream wrappers.

Requirements

  • Drupal Flysystem
  • Flysystem S3
  • A Cloudflare R2 bucket
  • Cloudflare R2 S3 API credentials

Installation

Install the module and its dependencies with Composer:

composer require drupal/flysystem_cloudflare_r2
drush en flysystem flysystem_s3 flysystem_cloudflare_r2

Configuration

Configure Flysystem stream wrappers in settings.php. The stream
wrapper scheme name must not contain underscores.

$schemes = [
  'r2-public' => [
    'driver' => 'r2',
    'config' => [
      'key' => '[cloudflare-r2-access-key-id]',
      'secret' => '[cloudflare-r2-secret-access-key]',
      'region' => 'auto',
      'bucket' => '[bucket-name]',
      'endpoint' => 'https://[account-id].r2.cloudflarestorage.com',
      'public' => TRUE,
    ],
      'cache' => TRUE,
  ],
];

$settings['flysystem'] = $schemes;

After configuring the stream wrapper, select it on Drupal's file system
settings page at /admin/config/media/file-system.

Cloudflare R2 Notes

  • Use region value auto.
  • Use the endpoint format https://[account-id].r2.cloudflarestorage.com.
  • For private buckets, omit public or set it to FALSE.
  • For public buckets or CDN-backed buckets, set public to TRUE and configure a public bucket URL or custom domain as needed.

Related Modules

Activity

Total releases
1
First release
Jul 2026
Latest release
9 hours ago
Release cadence
Stability
100% stable

Releases

Version Type Release date
1.0.0 Stable Jul 6, 2026