Skip to content

Prerequisites

Before deploying CloudFlare ImgBed, you need to prepare according to the storage channels you want to use.

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 TypeAdvantagesLimitations
Telegram BotCompletely free, unlimited capacityFiles larger than 20MB need to be stored in chunks
Cloudflare R2No file size limit, enterprise-grade performanceCharges after 10GB free quota, requires payment method
S3 Compatible StorageDiverse options, flexible pricingPricing varies by provider
DiscordCompletely free, simple and easy to useFiles larger than 10MB need to be stored in chunks
HuggingFaceCompletely free, supports large file direct uploadRequires HuggingFace account

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)

Create Telegram Bot

2.2 Get TG_CHAT_ID

  • Create a new Telegram channel
  • Add the created Bot as channel administrator
  • Grant the Bot message management permissions
Telegram Channel ManagementTelegram Channel ManagementTelegram Channel Management
  • Send a test message in the channel
  • Forward this message to @VersaToolsBot
  • Get the channel ID (example: -1001234567890)

Get Channel ID

Note

  • The - sign before the channel ID must be retained
  • The Bot must have channel administrator permissions

3. Cloudflare R2 Channel

3.1 Create R2 Bucket

Create R2 Bucket

  • Click "Create bucket"
  • Enter bucket name (globally unique)
  • Select storage region
  • Click "Create bucket"

Create R2 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/)

Configure R2 Bucket Public Access

4. S3 Compatible Storage

4.1 Supported Providers

ProviderRegionFeatures
Amazon S3GlobalOriginal S3 service
Qiniu CloudChinaFast domestic access
UpyunChinaCDN acceleration
Backblaze B2USAAffordable pricing
Cloudflare R2GlobalCloudflare ecosystem integration
MinIOGlobalOpen-source S3 compatible storage

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 ID
  • S3_SECRET_ACCESS_KEY: Secret access key
  • S3_BUCKET_NAME: Bucket name
  • S3_ENDPOINT: Service endpoint URL
  • S3_REGION: Storage region (optional)

5. Discord Channel (by @林酱)

5.1 Create Discord Bot

  • Visit Discord Developer Portal
  • Click "New Application" to create an application
  • Go to "Bot" page, click "Add Bot"
  • Copy the Bot Token

5.2 Get Channel ID

  • Enable Developer Mode in Discord client (User Settings → Advanced → Developer Mode)
  • Create a channel for storing files
  • Right-click the channel, select "Copy Channel ID"
  • Add the Bot to the server and grant file sending permissions

Note

  • Regular users have a 10MB file size limit
  • Nitro users have a 25MB file size limit
  • Ensure the Bot has permissions to send messages and attachments
  • Discord has API rate limits, not recommended for high-concurrency scenarios

6. HuggingFace Channel (by @林酱)

6.1 Create HuggingFace Account

6.2 Get Access Token

  • After logging in, visit Token Settings Page
  • Click "New token" to create a new Token
  • Select "Write" permission
  • Copy the generated Token

Note

HuggingFace channel supports large file direct upload, recommended for uploading files larger than 20MB.

🚀 Next Steps

After completing the preparation work, you can choose the appropriate deployment method:

Released under the MIT License