Prerequisites
Before deploying CloudFlare ImgBed, you need to prepare according to the storage channels you want to use.
🗄️ Storage Channel Preparation
1. Channel Overview
The project supports different storage channels as backend storage. Each channel has different advantages and limitations. You can choose the appropriate channel according to your needs.
Channel Type | Advantages | Limitations |
---|---|---|
Telegram Bot | Completely free, unlimited capacity | Single file maximum 20MB |
Cloudflare R2 | No file size limit, enterprise-grade performance | Charges after 10GB free quota, requires payment method |
S3 Compatible Storage | Diverse options, flexible pricing | Pricing varies by provider |
2. Telegram Bot Channel
2.1 Get TG_BOT_TOKEN
- Search for @BotFather in Telegram
- Send
/newbot
command - Follow prompts to enter Bot name and username
- Get Bot Token (format:
123456789:ABCdefGHIjklMNOpqrsTUVwxyz
)
2.2 Get TG_CHAT_ID
- Create a new Telegram channel
- Add the created Bot as channel administrator
- Grant the Bot message management permissions
- Send a test message in the channel
- Forward this message to @VersaToolsBot
- Get the channel ID (format:
-1001234567890
)
Note
- The
-
sign before the channel ID is required - The Bot must have channel administrator permissions
3. Cloudflare R2 Channel
3.1 Create R2 Bucket
- Login to Cloudflare Dashboard
- Select "R2 Object Storage"
- Click "Create bucket"
- Enter bucket name (globally unique)
- Select storage region
- Click "Create bucket"
3.2 Configure Public Access (Optional)
If you need to enable image review functionality:
- Enter the created bucket
- Select "Settings" → "Public access"
- Enable "Allow Access" or configure custom domain
- Record the complete public access link (e.g.,
https://your-bucket.r2.cloudflarestorage.com/
)
4. S3 Compatible Storage
4.1 Supported Providers
Provider | Region | Features |
---|---|---|
Amazon S3 | Global | Original S3 service |
Qiniu Cloud | China | Fast domestic access |
Upyun | China | CDN acceleration |
Backblaze B2 | USA | Affordable pricing |
Cloudflare R2 | Global | Cloudflare ecosystem integration |
Note
The above are tested S3 compatible storage providers. Other S3 compatible providers have not been tested and may have compatibility issues.
4.2 Required Information
S3_ACCESS_KEY_ID
: Access key IDS3_SECRET_ACCESS_KEY
: Secret access keyS3_BUCKET_NAME
: Bucket nameS3_ENDPOINT
: Service endpoint URLS3_REGION
: Storage region (optional)
🔧 Optional Feature Preparation
Image Content Review
If you need to enable adult content detection:
- Visit ModerateContent
- Register and get free API Key (currently no longer supports free registration)
- Record API Key for subsequent configuration
🚀 Next Steps
After completing the preparation work, you can choose the appropriate deployment method: