Parameter Reference
Quick reference for all available storage parameters:| Parameter | Description |
|---|---|
STORAGE_REGION | S3 region |
STORAGE_ACCESS_KEY_ID | S3 access key ID |
STORAGE_SECRET_ACCESS_KEY | S3 secret access key |
STORAGE_BUCKET_NAME | S3 bucket name |
STORAGE_ENDPOINT | S3-compatible endpoint |
STORAGE_PUBLIC_URL | Public URL for stored files |
STORAGE_MAX_SOCKETS | Maximum HTTP sockets |
STORAGE_CONNECTION_TIMEOUT | Connection timeout in ms |
STORAGE_REQUEST_TIMEOUT | Request timeout in ms |
STORAGE_SOCKET_TIMEOUT | Socket timeout in ms |
All
STORAGE_* variables can also use the S3_* prefix (e.g., S3_REGION instead of STORAGE_REGION). Both formats are supported.Local Mode (default)
- Development Mode
- Docker Mode
Place your files in
apps/api/public/Cloud Mode
Openinary supports any S3-compatible storage provider with a universal configuration. No need to specify the provider - it’s automatically detected! Copy and configure:Universal S3 Configuration
The configuration automatically detects your provider:- With STORAGE_ENDPOINT: S3-compatible provider (Cloudflare R2, Minio, DigitalOcean Spaces, Wasabi, etc.)
- Without STORAGE_ENDPOINT: AWS S3 standard
AWS S3
Cloudflare R2
Other S3-Compatible Providers
Works with Minio, DigitalOcean Spaces, Wasabi, Backblaze B2, and any other S3-compatible service:Key difference: Set
STORAGE_ENDPOINT for any non-AWS S3-compatible provider. For AWS S3, leave it empty.Core Parameters
Set the S3 region for your storage provider.Examples:
us-east-1- AWS US East (N. Virginia)eu-west-1- AWS Europe (Ireland)auto- Automatic region detection (Cloudflare R2)
S3_REGIONS3 access key ID for authentication.Examples:
AKIAIOSFODNN7EXAMPLE- AWS access key formatyour_r2_access_key- Cloudflare R2 access key
S3_ACCESS_KEY_IDS3 secret access key for authentication.Examples:
wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY- AWS secret key formatyour_r2_secret_key- Cloudflare R2 secret key
S3_SECRET_ACCESS_KEYName of the S3 bucket where files will be stored.Examples:
my-openinary-bucket- Standard bucket namecdn-assets- CDN bucketmedia-storage- Media files bucket
S3_BUCKET_NAMEBucket names must be globally unique and follow S3 naming conventions.
Custom S3-compatible endpoint URL.When to use:
- Cloudflare R2:
https://your-account-id.r2.cloudflarestorage.com - MinIO:
http://minio.example.com:9000 - DigitalOcean Spaces:
https://nyc3.digitaloceanspaces.com - Wasabi:
https://s3.wasabisys.com
- AWS S3 (uses default AWS endpoints)
S3_ENDPOINTLeave empty for standard AWS S3. Required for all S3-compatible providers.
Custom public URL for accessing stored files.Use cases:
- CDN URL:
https://cdn.example.com - Custom domain:
https://assets.example.com - Cloudflare R2 custom domain:
https://r2.example.com
https://cdn.example.com- CDN endpointhttps://your-bucket-name.s3.us-east-1.amazonaws.com- AWS S3 public URL
If not set, uses the default S3 endpoint URL. Set this when using a CDN or custom domain.
Advanced Parameters
Maximum number of simultaneous HTTP sockets for S3 connections.Examples:
50- Default (good for most use cases)100- Higher concurrency for high-traffic scenarios25- Lower concurrency for resource-constrained environments
Connection timeout in milliseconds. Set to
0 for no timeout.Examples:0- No timeout (default)5000- 5 seconds10000- 10 seconds
A value of
0 means the connection will wait indefinitely. Set a timeout for better error handling in production.Request timeout in milliseconds. Set to
0 for no timeout.Examples:0- No timeout (default)30000- 30 seconds60000- 60 seconds
Socket timeout in milliseconds. Set to
0 for no timeout.Examples:0- No timeout (default)60000- 60 seconds120000- 2 minutes
Socket timeout applies to the underlying TCP socket connection, not individual requests.
Configuration Examples
- AWS S3
- Cloudflare R2
- MinIO
- Advanced with Timeouts
STORAGE_ENDPOINT needed.Best Practices
Use S3-compatible storage
Leverage any S3-compatible provider for flexibility and cost optimization.
Set appropriate timeouts
Configure timeouts based on your file sizes and network conditions.