Overview
The AWS S3 storage client enables automatic upload of recorded streams, VOD files, and preview images to Amazon S3 or any S3-compatible storage service (DigitalOcean Spaces, Wasabi, OVH, Minio, etc.).Features
S3-Compatible
Works with Amazon S3 and any S3-compatible service
Multipart Upload
Automatic multipart upload for large files (>5MB)
Storage Classes
Support for all S3 storage classes (Standard, Glacier, etc.)
Custom Permissions
Full control over ACLs and access permissions
Configuration
Spring Bean Configuration
Add the S3 storage client bean to your application’sred5-web.xml:
S3-Compatible Services
For S3-compatible services (DigitalOcean, Wasabi, OVH, etc.), specify a custom endpoint:Configuration Parameters
IAM Credentials: If running on EC2, you can use IAM roles instead of providing
accessKey and secretKey. Leave them unset to use instance credentials.Storage Classes
S3 supports multiple storage classes for cost optimization:- STANDARD - Frequent access, low latency
- STANDARD_IA - Infrequent access
- INTELLIGENT_TIERING - Automatic cost optimization
- ONEZONE_IA - Lower cost, single AZ
- GLACIER - Archive with retrieval time
- GLACIER_IR - Instant retrieval archive
- DEEP_ARCHIVE - Lowest cost, long-term archive
Permission (ACL) Options
Configure file access permissions:AWS IAM Setup
Required IAM Permissions
Create an IAM user or role with these permissions:Advanced Configuration
Multipart Upload
Large files are automatically uploaded using multipart upload. Configure the threshold:Path-Style Access
Some S3-compatible services require path-style access:https://bucket-name.s3.amazonaws.com/keyPath-style:
https://s3.amazonaws.com/bucket-name/key
Progress Monitoring
Monitor upload progress programmatically:Common Use Cases
DigitalOcean Spaces
Wasabi
MinIO (Self-Hosted)
File Operations
Upload Files
Delete Files
Check File Existence
Retrieve Files
Troubleshooting
Connection timeout errors
Connection timeout errors
- Verify your
endpointURL is correct - Check firewall rules allow outbound HTTPS (443)
- Increase connection timeout if needed (default: 120 seconds)
Access denied errors
Access denied errors
- Verify
accessKeyandsecretKeyare correct - Check IAM permissions include required S3 actions
- Ensure bucket name matches exactly (case-sensitive)
Bucket not found
Bucket not found
- Verify
storageName(bucket name) is correct - Check
regionmatches bucket region - For S3-compatible services, verify
endpointis correct
Files not uploading
Files not uploading
- Confirm
enabledis set totrue - Check application logs for error details
- Verify network connectivity to S3/endpoint
- Test with small file first
Performance Tuning
Connection Pool
The S3 client uses a connection pool with these defaults:- Max connections: 100
- Connection timeout: 120 seconds
- Max retries: 15
Transfer Manager
Multipart uploads use AWS Transfer Manager for optimal performance:- Automatic parallel part uploads
- Automatic retry on failures
- Progress tracking
Security Best Practices
1
Use IAM Roles
On EC2/ECS, use IAM roles instead of hardcoded credentials.
2
Restrict Permissions
Grant only necessary S3 permissions (PutObject, GetObject, DeleteObject).
3
Enable Encryption
Configure S3 bucket encryption (SSE-S3, SSE-KMS) for data at rest.
4
Use Private ACLs
For sensitive content, use
private permission instead of public-read.5
Enable Versioning
Enable S3 bucket versioning to protect against accidental deletions.
Configuration File Location:
red5-web.xml is typically located at /usr/local/antmedia/webapps/YourApp/WEB-INF/red5-web.xml