Operate

File uploads and storage

Keep uploads in the database or in S3 and MinIO, with size and type limits.

Uploads live in the database by default, so one backup covers everything. Switch to S3 or any S3-compatible service, such as MinIO or Cloudflare R2, when files grow.

How uploads work

  1. Add a file or image field to a collection in Settings → Data model.
  2. Upload from the record editor in Studio, or through the API. The field stores a reference to an upload in the same workspace.
  3. Downloads require a signed-in user or a valid token. Generic files are served as attachments.

Limits

LimitValue
Size per file2 MiB
Image formatsPNG, JPEG, GIF, WebP
Image sizeUp to 16 million pixels
Recent files in the picker50

Choose where files live

VariableDefaultWhat it does
STORAGE_DRIVERdatabasedatabase keeps files inside SQLite, PostgreSQL or MySQL. s3 sends them to a bucket.

Use S3 or MinIO

Set STORAGE_DRIVER=s3 and these variables:

VariableDefaultWhat it does
S3_ENDPOINTunsetService URL, such as https://s3.us-east-1.amazonaws.com or http://minio:9000.
S3_REGIONunsetBucket region, such as us-east-1. Use auto for Cloudflare R2.
S3_BUCKETunsetBucket name. Kanesh does not create it; create it first.
S3_ACCESS_KEY_IDunsetAccess key with read and write rights on the bucket.
S3_SECRET_ACCESS_KEYunsetSecret for that key. Prefer a mounted secret over plain text.
S3_FORCE_PATH_STYLEfalsetrue for MinIO and most S3-compatible services.

Example for MinIO next to Kanesh in Compose:

STORAGE_DRIVER=s3
S3_ENDPOINT=http://minio:9000
S3_REGION=us-east-1
S3_BUCKET=kanesh-uploads
S3_ACCESS_KEY_ID=kanesh
S3_SECRET_ACCESS_KEY=CHANGE_ME
S3_FORCE_PATH_STYLE=true

Keep the bucket private. Kanesh checks permissions and serves every download itself, so files are never public by URL.

Note: Changing STORAGE_DRIVER affects new uploads. Existing files stay where they were saved and keep working.

Backups

  • Database storage: backing up the database backs up every upload.
  • S3 storage: back up the database and the bucket. Turn on bucket versioning to recover deleted or overwritten files.

Good to know

  • CSV and JSON exports contain file IDs, not the files themselves.

Next steps

Buy me a coffee