This guide will walk you through the process of configuring CloudFlare R2 for use with the FluentCommunity Plugin. You'll learn how to obtain the necessary credentials and input them into the plugin's settings.
- A CloudFlare account
- Access to the FluentCommunity Plugin in your WordPress installation
- Log in to your CloudFlare account.
- Navigate to "R2" under the "Storage" section.
- Click "Create bucket" and choose a unique name for your bucket
- Location: Choose the region closest to your target audience or use Automatic
- Default Storage Class: Select Default
- In your CloudFlare R2 dashboard, go to "Manage R2 API Tokens"
- Click "Create API Token".
- Give a name & From permissions, Select Object Read & Write.
- From Specify bucket(s):
- Select your newly created Bucket
- TTL should be forever.
- Click "Create API Token"
- Now, Save the following Credential:
- Access Key ID
- Secret Access Key
- In the CloudFlare dashboard, go to "R2" > "Overview".
- Select your bucket from the list of buckets.
- Click on the "Settings" tab.
- Scroll down to the "R2.dev subdomain" section and then click "allow access"
- Copy the Public R2.dev Bucket URL
-
In your WordPress admin panel, navigate to FluentCommunity Plugins > Settings > Features.
-
Find the CloudStorage Configaration Form.
-
Fill in the following fields:
- Access Key: Paste the access key from your CloudFlare API token. (From step 2)
- Secret Key: Paste the secret key from your CloudFlare API token. (From step 2)
- Account ID: Paste the CloudFlare Account ID. (You will find it on R2 Overview page)
- Bucket: Enter the name of the R2 bucket you created.
- Sub Folder (Optional): If you want to store files in a specific subfolder within the bucket, enter the name here.
- Public URL Add the public URL for your R2 bucket (From step 3)
-
Save your settings.
For added security or to manage multiple environments, you can define these values in your wp-config.php
file:
// CloudFlare R2 Configuration
define('FLUENT_COMMUNITY_CLOUD_STORAGE', 'cloudflare_r2');
define('FLUENT_COMMUNITY_CLOUD_STORAGE_ACCOUNT_ID', 'CLOUDFLARE_ACCOUNT_ID'); // like: 1718cb5a51e65c8f19e8sahdakh763
define('FLUENT_COMMUNITY_CLOUD_STORAGE_ACCESS_KEY', ''); // from step 2
define('FLUENT_COMMUNITY_CLOUD_STORAGE_SECRET_KEY', ''); // from step 2
define('FLUENT_COMMUNITY_CLOUD_STORAGE_BUCKET', 'YOUR_BUCKET_NAME'); // replace with your bucket name
define('FLUENT_COMMUNITY_CLOUD_STORAGE_PUBLIC_URL', 'https://pub-<YOUR_ACCOUNT_ID>.r2.dev'); // You can use the r2 custom domain too
define('FLUENT_COMMUNITY_CLOUD_STORAGE_SUB_FOLDER', 'community-files'); // optional or use your own folder name or keep it empty
If defined in wp-config.php
, these values will override any settings in the plugin's configuration form.
- Ensure that your API token has the correct permissions for R2 access.
- Double-check that the bucket name and public URL are correct.
- If using a custom domain, make sure it's properly configured in CloudFlare.
For further assistance, contact support team.