File Storage Configuration (Optional)
By default, all media files (uploads, attachments, etc.) are stored locally on your server. For improved scalability, security, and reliability, you may optionally configure external file storage using either AWS S3 or Google Cloud Storage (GCS).
Note: You should only configure one storage provider (AWS S3 or GCS), not both.
Why Use External File Storage?
- Offload media files from your application server
- Improve performance and scalability
- Enable secure, presigned URLs for file access
- Recommended for production deployments
Configuration Steps
Option 1: AWS S3 Configuration
- Create an S3 bucket in your AWS account.
- Generate an IAM user with access to the bucket and obtain the Access Key ID and Secret Access Key.
- Update your
web-server.env
file with the following (uncomment and fill in your details):
# AWS S3 Configuration
AWS_BUCKET_NAME='your-bucket-name'
AWS_ACCESS_KEY_ID='your_aws_access_key'
AWS_SECRET_ACCESS_KEY='your_aws_secret_key'
AWS_REGION='us-east-1'
AWS_PRESIGNED_EXPIRY='43200'
Option 2: Google Cloud Storage (GCS) Configuration
- Create a GCS bucket in your Google Cloud project.
- Create a service account with Storage Object Admin role and generate a key.
- Update your
web-server.env
file with the following (uncomment and fill in your details):
# Google Cloud Storage Configuration
GCS_BUCKET='your-bucket-name'
GCP_PROJECT_ID='your-project-id'
GCP_PRIVATE_KEY_ID='your-private-key-id'
GCP_PRIVATE_KEY='your-private-key'
GCP_CLIENT_EMAIL='your-service-account-email'
GCP_CLIENT_ID='your-client-id'
GCS_BUCKET_PREFIX='optional-prefix'
GCS_PRESIGNED_EXPIRY_SECONDS='86400'
GCP_AUTH_URI='your_gcp_auth_uri'
GCP_TOKEN_URI='your_gcp_token_uri'
GCP_AUTH_PROVIDER_X509_CERT_URL='your_gcp_auth_provider_x509_cert_url'
GCP_CLIENT_X509_CERT_URL='your_gcp_client_x509_cert_url'
GCP_UNIVERSE_DOMAIN='your_gcp_universe_domain'
Additional Notes
- If neither AWS S3 nor GCS is configured, all files will be stored locally on your server (default).
- Make sure to keep your cloud credentials secure and never share them publicly.
For more details, refer to the official AWS S3 and Google Cloud Storage documentation, or contact WhautoChat support for guidance on best practices.