Skip to main content

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

FlagEnvironment VariableDefaultDescription
--file-storage-base-dirFILE_STORAGE_BASE_DIR/app/galleryBase directory for images
--file-storage-mkdir-permissionsFILE_STORAGE_MKDIR_PERMISSIONS0755Directory creation permissions
--file-storage-write-permissionsFILE_STORAGE_WRITE_PERMISSIONS0644File 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

FlagEnvironment VariableEncryptedDescription
--aws-regionAWS_REGIONNoAWS region
--aws-access-key-idAWS_ACCESS_KEY_IDYesAWS access key ID
--aws-secret-access-keyAWS_SECRET_ACCESS_KEYYesAWS secret access key
--aws-session-tokenAWS_SESSION_TOKENYesAWS session token
--s3-storage-bucketS3_STORAGE_BUCKETNoS3 bucket name
--s3-endpointS3_ENDPOINTNoCustom endpoint (optional)
--s3-force-path-styleS3_FORCE_PATH_STYLENoForce path-style URLs
--s3-storage-base-dirS3_STORAGE_BASE_DIRNoBase 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:

  1. To switch to S3 storage: Add S3 storage configuration (bucket, credentials, etc.)
  2. To switch to file storage: Remove S3 storage configuration or set empty values
  3. 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