--- title: Configuring Tencent Cloud COS Storage Service description: >- Detailed steps to configure Tencent Cloud COS storage service for smooth file storage. tags: - Tencent Cloud COS - S3 Storage - File Storage - Environment Variables --- # Configuring Tencent Cloud COS Storage Service We need to configure S3 storage service for file storage in the server-side database. ## Configuration Steps ### Configure and Obtain S3 Bucket Create a new bucket on [Tencent Cloud COS](https://console.cloud.tencent.com/cos/bucket): {'Tencent Name the bucket (e.g., 'lobe'). Choose 'Public Read, Private Write', select any region, and keep other settings default. {'COS ### Get Bucket-related Environment Variables View bucket information in COS bucket overview: {'View Corresponding environment variables: ```shell S3_BUCKET=lobe-130xxxxxx2 S3_ENDPOINT=https://cos.ap-chengdu.myqcloud.com S3_REGION=ap-chengdu S3_PUBLIC_DOMAIN=https://lobe-1251234567.cos.ap-chengdu.myqcloud.com ``` Note: `S3_ENDPOINT` should be `https://cos.ap-chengdu.myqcloud.com`, not `https://lobe-130xxxxxx2.cos.ap-chengdu.myqcloud.com` Include `https://` in the URL ### Configure CORS Add the following in 'Security Management - CORS Settings': {'Configure ### Get S3 Keys Create a new SecretId and SecretKey at [Tencent Cloud API Key Management](https://console.cloud.tencent.com/cam/capi). Use as `S3_ACCESS_KEY_ID` and `S3_SECRET_ACCESS_KEY`. ### Additional Notes - Consider setting up CDN acceleration for improved access speed and reduced costs. - Use role management when creating API keys for enhanced security.