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
--storage-typeSTORAGE_TYPEfileStorage backend type
--file-base-dirFILE_BASE_DIR/app/galleryBase directory for images
--file-mkdir-permissionsFILE_MKDIR_PERMISSIONS0755Directory creation permissions
--file-write-permissionsFILE_WRITE_PERMISSIONS0644File write permissions

Example

# Environment variables
export STORAGE_TYPE=file
export FILE_BASE_DIR=/path/to/images

# Or command line
./imagor-studio --storage-type=file --file-base-dir=/path/to/images

Docker Example

services:
imagor-studio:
image: shumc/imagor-studio:latest
environment:
- STORAGE_TYPE=file
- FILE_BASE_DIR=/app/gallery
volumes:
- ~/Pictures:/app/gallery:ro # Mount as read-only
Read-Only Mount

Mount your image directory as read-only (:ro) for safety. Imagor Studio doesn't modify original images.

S3 Storage

For cloud deployments and scalable storage.

Configuration

FlagEnvironment VariableEncryptedDescription
--storage-typeSTORAGE_TYPENoMust be set to s3
--s3-bucketS3_BUCKETNoS3 bucket name
--s3-regionS3_REGIONNoAWS region
--s3-endpointS3_ENDPOINTNoCustom endpoint (optional)
--s3-force-path-styleS3_FORCE_PATH_STYLENoForce path-style URLs
--s3-access-key-idS3_ACCESS_KEY_IDYesAWS access key
--s3-secret-access-keyS3_SECRET_ACCESS_KEYYesAWS secret key
--s3-session-tokenS3_SESSION_TOKENYesAWS session token
--s3-base-dirS3_BASE_DIRNoBase directory in bucket

AWS S3 Example

export STORAGE_TYPE=s3
export S3_BUCKET=my-images-bucket
export S3_REGION=us-east-1
export S3_ACCESS_KEY_ID=AKIAIOSFODNN7EXAMPLE
export S3_SECRET_ACCESS_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

MinIO Example

export STORAGE_TYPE=s3
export S3_BUCKET=images
export S3_REGION=us-east-1
export S3_ENDPOINT=http://minio:9000
export S3_FORCE_PATH_STYLE=true
export S3_ACCESS_KEY_ID=minioadmin
export S3_SECRET_ACCESS_KEY=minioadmin

Docker Compose with S3

services:
imagor-studio:
image: shumc/imagor-studio:latest
environment:
- STORAGE_TYPE=s3
- S3_BUCKET=my-images-bucket
- S3_REGION=us-east-1
- S3_ACCESS_KEY_ID=${AWS_ACCESS_KEY_ID}
- S3_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:
- STORAGE_TYPE=s3
- S3_BUCKET=images
- S3_REGION=us-east-1
- S3_ENDPOINT=http://minio:9000
- S3_FORCE_PATH_STYLE=true
- S3_ACCESS_KEY_ID=minioadmin
- S3_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 STORAGE_TYPE=s3
export S3_BUCKET=my-bucket
export S3_REGION=auto
export S3_ENDPOINT=https://ACCOUNT_ID.r2.cloudflarestorage.com
export S3_ACCESS_KEY_ID=your_access_key
export S3_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. Update STORAGE_TYPE environment variable
  2. Configure the new storage backend settings
  3. Restart the application
warning

Switching storage backends doesn't migrate your images. You'll need to manually move files if needed.

Next Steps