librechat.yaml.
Storage Strategies
Three storage backends are available:- local: Store files on the server filesystem
- s3: AWS S3 or S3-compatible storage (MinIO, Backblaze B2, etc.)
- firebase: Firebase Cloud Storage
Configuration Formats
Legacy Format (Single Strategy)
Apply the same storage strategy to all file types:Granular Format (Recommended)
Use different storage strategies for different file types:Storage strategy for user and agent avatar imagesAvailable:
local, s3, firebaseStorage strategy for uploaded images in chatsAvailable:
local, s3, firebaseStorage strategy for document uploads (PDFs, text files, etc.)Available:
local, s3, firebaseIf not specified, all file types default to
local storageLocal Storage
Stores files on the server’s filesystem.Local Storage Paths
Files are stored in different directories based on type:- Images:
publicPath/images/userId/(served statically) - Documents:
uploads/userId/(downloaded via API)
Configuration
No additional environment variables required. Files are stored in:AWS S3 Storage
Store files in AWS S3 or S3-compatible services.Environment Variables
AWS access key ID
AWS secret access key
AWS region
S3 bucket name
Custom endpoint URL for S3-compatible services
Required for path-style S3-compatible providers
Set to
true for MinIO, Hetzner, Backblaze B2, and other providers that don’t support virtual-hosted-style URLs (bucket.endpoint). Not needed for AWS S3.S3-Compatible Providers
MinIO
MinIO
Backblaze B2
Backblaze B2
Hetzner Storage Box
Hetzner Storage Box
File Organization
Files are organized in S3 by user ID and file type:Azure Blob Storage
Store files in Azure Blob Storage.Azure Blob Storage uses the same configuration key as S3 in the YAML file. Configure via environment variables.
Environment Variables
Azure Storage account connection string
Azure Blob container name
Enable public access to blobs
Example Configuration
.env
Firebase Cloud Storage
Store files in Firebase Cloud Storage.Environment Variables
Firebase API key
Firebase auth domain
Firebase project ID
Firebase storage bucket name
Firebase messaging sender ID
Firebase app ID
Example Configuration
.env
File Organization
Files are stored with the following structure:File Upload Limits
Configure file upload limits inlibrechat.yaml:
Maximum number of files per request
Maximum size for individual file (MB)
Maximum total size for all files in request (MB)
Global server file size limit (MB)
Avatar image size limit (MB)
Client-Side Image Resizing
Enable client-side image resizing before upload
Maximum width for resized images (pixels)
Maximum height for resized images (pixels)
JPEG compression quality (0.0-1.0)
Use Cases
Privacy & Compliance
Privacy & Compliance
Keep sensitive documents on local storage for compliance:
Performance Optimization
Performance Optimization
Use S3 for avatars (fast global access) and Firebase for images (automatic optimization):
Cost Optimization
Cost Optimization
Store frequently accessed avatars in S3, keep large documents local:
Shared Links
Enable file sharing via public links:Enable shared links feature
Allow public shared links (accessible without authentication)
.env
Static File Caching
Configure cache headers for static files:Browser cache duration in seconds (default: 2 days)
Only takes effect when NODE_ENV=production
CDN/proxy cache duration in seconds (default: 1 day)
.env
Advanced Options
Disable Express-based compression
Use if you have another service doing compression
Enable scanning and serving of gzipped images
.env