Skip to main content

S3 Configuration

To store your uploaded files in Mixpost, you need to set up an S3 bucket.

Mixpost supports any S3-compatible storage provider, such as:

Get started

  1. Set the environment variable MIXPOST_DISK=s3.
  2. Configure the necessary environment variables required to support S3.

ℹ️ Storage uses its own STORAGE_* variables, separate from AWS_*, so you can use AWS SES for mail and a different provider for file storage. For backward compatibility, when a STORAGE_* variable is not set, Mixpost falls back to the corresponding AWS_* variable — existing setups configured with AWS_* keep working.

AWS Setup

For AWS S3 itself, leave STORAGE_ENDPOINT and STORAGE_URL empty.

Example:

STORAGE_ACCESS_KEY_ID=your-access-key
STORAGE_SECRET_ACCESS_KEY=your-secret-key
STORAGE_REGION=us-east-1
STORAGE_BUCKET=your-bucket-name

Enable ACL

You need to enable the ACL for your bucket.

Access policy

Add following access policy:

{
"Version": "2012-10-17",
"Id": "Policy1692807538499",
"Statement": [
{
"Sid": "Stmt1692807537432",
"Effect": "Allow",
"Principal": "*",
"Action": "s3:*",
"Resource": "arn:aws:s3:::your-bucket-name"
}
]
}

Replace your-bucket-name with your real bucket name.

CORS policy

Next, scroll down to the Access control list (ACL) -> Cross-origin resource sharing (CORS), and add this:

[
{
"AllowedHeaders": [],
"AllowedMethods": [
"GET",
"PUT",
"POST",
"DELETE"
],
"AllowedOrigins": [
"*"
],
"ExposeHeaders": []
}
]

Cloudflare R2 Setup

Create an R2 API token with Object Read & Write permissions, then set the endpoint to your account's R2 endpoint. The region must be set to auto.

Example:

STORAGE_ACCESS_KEY_ID=your-access-key
STORAGE_SECRET_ACCESS_KEY=your-secret-key
STORAGE_REGION=auto
STORAGE_BUCKET=your-bucket-name
STORAGE_ENDPOINT=https://your-account-id.r2.cloudflarestorage.com
STORAGE_URL=https://your-public-bucket-url

Replace your-account-id with your Cloudflare account ID. Set STORAGE_URL to the public URL of your bucket — either the r2.dev public URL or a custom domain connected to the bucket.

Hetzner Object Storage Setup

Set the STORAGE_REGION, STORAGE_ENDPOINT, and STORAGE_URL variables in the .env file to match your Hetzner Object Storage bucket configuration. Make sure STORAGE_USE_PATH_STYLE_ENDPOINT is set to true.

Example:

STORAGE_ACCESS_KEY_ID=your-access-key
STORAGE_SECRET_ACCESS_KEY=your-secret-key
STORAGE_REGION=fsn1
STORAGE_BUCKET=your-bucket-name
STORAGE_ENDPOINT=https://fsn1.your-objectstorage.com
STORAGE_URL=https://your-bucket-name.fsn1.your-objectstorage.com
STORAGE_USE_PATH_STYLE_ENDPOINT=true

Replace fsn1 with the location of your bucket, and your-bucket-name with your actual bucket name.

MinIO Setup

You need to set the STORAGE_URL and STORAGE_ENDPOINT variables in the .env file to point to the MinIO server and ensure that STORAGE_USE_PATH_STYLE_ENDPOINT is set to true.

Example:

STORAGE_ACCESS_KEY_ID=your-access-key
STORAGE_SECRET_ACCESS_KEY=your-secret-key
STORAGE_REGION=us-east-1
STORAGE_BUCKET=your-bucket-name
STORAGE_URL=https://127.0.0.1:9000
STORAGE_ENDPOINT=https://127.0.0.1:9000
STORAGE_USE_PATH_STYLE_ENDPOINT=true

DigitalOcean Spaces Setup

Set the endpoint to your Space's region.

Example:

STORAGE_ACCESS_KEY_ID=your-access-key
STORAGE_SECRET_ACCESS_KEY=your-secret-key
STORAGE_REGION=fra1
STORAGE_BUCKET=your-space-name
STORAGE_ENDPOINT=https://fra1.digitaloceanspaces.com
STORAGE_URL=https://your-space-name.fra1.digitaloceanspaces.com

Replace fra1 with the region of your Space, and your-space-name with your actual Space name.

Backblaze B2 Setup

Use the S3-compatible endpoint shown in your bucket details. The region is part of the endpoint (e.g., us-west-004).

Example:

STORAGE_ACCESS_KEY_ID=your-key-id
STORAGE_SECRET_ACCESS_KEY=your-application-key
STORAGE_REGION=us-west-004
STORAGE_BUCKET=your-bucket-name
STORAGE_ENDPOINT=https://s3.us-west-004.backblazeb2.com