Storage Providers
Cap works with any S3-compatible storage:MinIO (Default)
Included in Docker Compose, runs locally
AWS S3
Industry standard, global CDN
Cloudflare R2
Zero egress fees, fast globally
Backblaze B2
Most cost-effective option
MinIO (Default Setup)
The Docker Compose deployment includes MinIO out of the box.Configuration
Default environment variables:.env
Access MinIO Console
MinIO includes a web-based admin console:- Username: Value of
MINIO_ROOT_USER - Password: Value of
MINIO_ROOT_PASSWORD
Production MinIO Setup
For production with public access:Configure Reverse Proxy
See SSL/HTTPS Setup for Nginx/Caddy configuration.
MinIO Limitations
AWS S3
AWS S3 is the most reliable option with global CDN through CloudFront.Setup Steps
Create S3 Bucket
- Go to AWS S3 Console
- Click Create bucket
- Configure:
- Bucket name:
cap-videos-prod(must be globally unique) - Region: Choose closest to your users
- Block Public Access: Disable (we’ll set specific permissions)
- Bucket name:
- Create bucket
Configure Bucket Policy
Allow public read access for videos:Replace
- Go to bucket Permissions → Bucket Policy
- Add this policy:
cap-videos-prod with your bucket name.Create IAM User
- Go to IAM Console
- Click Users → Add user
- User name:
cap-s3-user - Access type: Programmatic access
- Attach policy: AmazonS3FullAccess (or create custom policy below)
- Save Access Key ID and Secret Access Key
CloudFront CDN (Optional)
Add CloudFront for faster global delivery:Create Distribution
- Go to CloudFront Console
- Click Create Distribution
- Configure:
- Origin Domain: Select your S3 bucket
- Viewer Protocol Policy: Redirect HTTP to HTTPS
- Allowed HTTP Methods: GET, HEAD, OPTIONS, PUT, POST, PATCH, DELETE
- Cache Policy: CachingOptimized
Cloudflare R2
Cloudflare R2 offers S3-compatible storage with zero egress fees.Create R2 Bucket
- Go to Cloudflare Dashboard → R2
- Click Create bucket
- Name:
cap-videos - Location: Automatic (or choose region)
Enable Public Access
- Go to bucket Settings
- Click Allow Access under “Public Access”
- Cloudflare provides a public URL:
Create API Token
- Go to R2 → Manage R2 API Tokens
- Click Create API Token
- Permissions:
- Object Read & Write
- Apply to specific bucket:
cap-videos
- Save Access Key ID and Secret Access Key
R2 is significantly cheaper than S3 for high-traffic deployments due to zero egress fees.
Backblaze B2
Backblaze B2 is the most cost-effective S3-compatible storage.Create Bucket
- Sign up at backblaze.com
- Go to Buckets → Create a Bucket
- Configure:
- Bucket Name:
cap-videos - Files in Bucket: Public
- Encryption: Disable
- Bucket Name:
Create Application Key
- Go to App Keys → Add a New Application Key
- Name:
cap-server - Access: Read and Write
- Bucket:
cap-videos - Save keyID and applicationKey
Get Endpoint URL
In bucket details, find:
- Endpoint:
s3.us-west-004.backblazeb2.com - Region:
us-west-004
Backblaze Pricing
- Storage: 23/TB for S3)
- Downloads: First 3x storage is free, then $0.01/GB
- API calls: Included
Other S3 Providers
DigitalOcean Spaces
.env
Wasabi
.env
Linode Object Storage
.env
Testing Storage Configuration
Verify your S3 setup:Troubleshooting
Videos Won’t Upload
Check credentials:CAP_AWS_ACCESS_KEYandCAP_AWS_SECRET_KEYare correct- IAM user has
PutObjectpermission
Videos Upload but Won’t Play
Public access issue:- Verify bucket policy allows public read
- Check CORS configuration includes your domain
- Test direct file URL in browser
CORS Errors in Browser
Update CORS configuration to include your Cap domain:Wrong Endpoint
Check logs for connection errors:S3_PUBLIC_ENDPOINTis accessible from browserS3_INTERNAL_ENDPOINTis accessible from Docker containerS3_PATH_STYLEmatches your provider
Migration Between Providers
Move videos from one S3 provider to another:Configure Source and Destination
For rclone, configure both providers:Create remotes for source and destination.
Cost Comparison
Monthly costs for 1TB storage + 1TB egress:| Provider | Storage | Egress | Total |
|---|---|---|---|
| MinIO (self-hosted) | Server cost | $0 | ~$20-50 |
| AWS S3 | $23 | $90 | $113 |
| Cloudflare R2 | $15 | $0 | $15 |
| Backblaze B2 | $6 | $0* | $6 |
| Wasabi | $6.99 | $0* | $6.99 |
For high-traffic deployments, Cloudflare R2 or Backblaze B2 offer the best value.
Next Steps
Environment Variables
Complete S3 variable reference
SSL/HTTPS
Secure S3 endpoints with SSL
Scaling
Optimize storage for production
Troubleshooting
Debug storage issues