Storage Configuration
Configure where Imagor Studio stores and accesses your images.
Storage Types
Imagor Studio supports two storage backends:
- File Storage - Local filesystem (default)
- S3 Storage - Amazon S3 or S3-compatible services
File Storage
Perfect for local deployments and development.
Configuration
| Flag | Environment Variable | Default | Description |
|---|---|---|---|
--file-storage-base-dir | FILE_STORAGE_BASE_DIR | /app/gallery | Base directory for images |
--file-storage-mkdir-permissions | FILE_STORAGE_MKDIR_PERMISSIONS | 0755 | Directory creation permissions |
--file-storage-write-permissions | FILE_STORAGE_WRITE_PERMISSIONS | 0644 | File write permissions |
Example
# Environment variables (storage type auto-detected as 'file')
export FILE_STORAGE_BASE_DIR=/path/to/images
# Or command line
./imagor-studio --file-storage-base-dir=/path/to/images
Docker Example
services:
imagor-studio:
image: shumc/imagor-studio:latest
environment:
- FILE_STORAGE_BASE_DIR=/app/gallery
volumes:
- ~/Pictures:/app/gallery
S3 Storage
For cloud deployments and scalable storage.
Configuration
| Flag | Environment Variable | Encrypted | Description |
|---|---|---|---|
--aws-region | AWS_REGION | No | AWS region |
--aws-access-key-id | AWS_ACCESS_KEY_ID | Yes | AWS access key ID |
--aws-secret-access-key | AWS_SECRET_ACCESS_KEY | Yes | AWS secret access key |
--aws-session-token | AWS_SESSION_TOKEN | Yes | AWS session token |
--s3-storage-bucket | S3_STORAGE_BUCKET | No | S3 bucket name |
--s3-endpoint | S3_ENDPOINT | No | Custom endpoint (optional) |
--s3-force-path-style | S3_FORCE_PATH_STYLE | No | Force path-style URLs |
--s3-storage-base-dir | S3_STORAGE_BASE_DIR | No | Base directory in bucket |
AWS S3 Example
export S3_STORAGE_BUCKET=my-images-bucket
export AWS_REGION=us-east-1
export AWS_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export AWS_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY
MinIO Example
export S3_STORAGE_BUCKET=images
export AWS_REGION=us-east-1
export S3_ENDPOINT=http://minio:9000
export S3_FORCE_PATH_STYLE=true
export AWS_ACCESS_KEY_ID=minioadmin
export AWS_SECRET_ACCESS_KEY=minioadmin
Docker Compose with S3
services:
imagor-studio:
image: shumc/imagor-studio:latest
environment:
- S3_STORAGE_BUCKET=my-images-bucket
- AWS_REGION=us-east-1
- AWS_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- AWS_SECRET_ACCESS_KEY=${AWS_SECRET_ACCESS_KEY}
Docker Compose with MinIO
services:
minio:
image: minio/minio:latest
command: server /data --console-address ":9001"
environment:
MINIO_ROOT_USER: minioadmin
MINIO_ROOT_PASSWORD: minioadmin
volumes:
- minio_data:/data
ports:
- "9000:9000"
- "9001:9001"
imagor-studio:
image: shumc/imagor-studio:latest
environment:
- S3_STORAGE_BUCKET=images
- AWS_REGION=us-east-1
- S3_ENDPOINT=http://minio:9000
- S3_FORCE_PATH_STYLE=true
- AWS_ACCESS_KEY_ID=minioadmin
- AWS_SECRET_ACCESS_KEY=minioadmin
depends_on:
- minio
volumes:
minio_data:
S3-Compatible Services
Imagor Studio works with any S3-compatible service:
- Amazon S3 - AWS's object storage
- MinIO - Self-hosted S3-compatible storage
- DigitalOcean Spaces - DigitalOcean's object storage
- Wasabi - Cloud object storage
- Backblaze B2 - Cloud storage with S3 API
- Cloudflare R2 - Cloudflare's object storage
Cloudflare R2 Example
export S3_STORAGE_BUCKET=my-bucket
export AWS_REGION=auto
export S3_ENDPOINT=https://ACCOUNT_ID.r2.cloudflarestorage.com
export AWS_ACCESS_KEY_ID=your_access_key
export AWS_SECRET_ACCESS_KEY=your_secret_key
Security
Encrypted Credentials
S3 credentials are automatically encrypted when stored in the system registry:
- Access keys encrypted with JWT-based encryption
- Secret keys encrypted with JWT-based encryption
- Session tokens encrypted with JWT-based encryption
IAM Permissions
Minimum required S3 permissions:
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": ["s3:GetObject", "s3:ListBucket"],
"Resource": [
"arn:aws:s3:::my-images-bucket",
"arn:aws:s3:::my-images-bucket/*"
]
}
]
}
Read-Only Access
Imagor Studio only needs read access to your images. Use read-only IAM policies for better security.
Switching Storage Backends
You can switch between storage backends by changing the configuration:
- To switch to S3 storage: Add S3 storage configuration (bucket, credentials, etc.)
- To switch to file storage: Remove S3 storage configuration or set empty values
- Restart the application
The storage type will be automatically detected based on your configuration.
warning
Switching storage backends doesn't migrate your images. You'll need to manually move files if needed.
Next Steps
- Imagor Configuration - Configure image processing
- Security Settings - Manage security options
- Docker Deployment - Deploy with Docker