Storage

Configure S3-compatible storage for file uploads

Storage

LaunchSaaS supports S3-compatible storage for file uploads. This works with AWS S3, Cloudflare R2, MinIO, and other S3-compatible services.

Setup

1. Enable Storage

NEXT_PUBLIC_STORAGE_ENABLED=true

2. Configure Provider

Choose an S3-compatible storage provider:

  1. Go to Cloudflare Dashboard → R2
  2. Create a bucket
  3. Create an API token with R2 permissions
  4. Add to your .env:
STORAGE_PROVIDER=s3
STORAGE_ACCESS_KEY_ID="your-access-key-id"
STORAGE_SECRET_ACCESS_KEY="your-secret-access-key"
STORAGE_BUCKET="your-bucket-name"
STORAGE_REGION="auto"
STORAGE_API_ENDPOINT="https://<account-id>.r2.cloudflarestorage.com"
STORAGE_PUBLIC_ENDPOINT="https://pub-<id>.r2.dev"

AWS S3

  1. Go to AWS S3 Console
  2. Create a bucket
  3. Create an IAM user with S3 permissions
  4. Add to your .env:
STORAGE_PROVIDER=s3
STORAGE_ACCESS_KEY_ID="your-access-key-id"
STORAGE_SECRET_ACCESS_KEY="your-secret-access-key"
STORAGE_BUCKET="your-bucket-name"
STORAGE_REGION="us-east-1"
STORAGE_API_ENDPOINT="https://s3.us-east-1.amazonaws.com"
STORAGE_PUBLIC_ENDPOINT="https://your-bucket-name.s3.us-east-1.amazonaws.com"

MinIO (Self-Hosted)

  1. Deploy MinIO server
  2. Create a bucket
  3. Create access credentials
  4. Add to your .env:
STORAGE_PROVIDER=s3
STORAGE_ACCESS_KEY_ID="your-access-key"
STORAGE_SECRET_ACCESS_KEY="your-secret-key"
STORAGE_BUCKET="your-bucket-name"
STORAGE_REGION="us-east-1"
STORAGE_API_ENDPOINT="https://your-minio-server.com"
STORAGE_PUBLIC_ENDPOINT="https://your-minio-server.com/your-bucket-name"

Environment Variables

VariableDescription
NEXT_PUBLIC_STORAGE_ENABLEDEnable storage (true / false)
STORAGE_PROVIDERStorage provider (currently s3)
STORAGE_ACCESS_KEY_IDAccess key ID
STORAGE_SECRET_ACCESS_KEYSecret access key
STORAGE_BUCKETBucket name
STORAGE_REGIONRegion (e.g., us-east-1, auto for R2)
STORAGE_API_ENDPOINTS3 API endpoint URL
STORAGE_PUBLIC_ENDPOINTPublic URL for accessing files

CORS Configuration

For browser uploads, configure CORS on your bucket:

[
  {
    "AllowedOrigins": ["https://yourdomain.com"],
    "AllowedMethods": ["GET", "PUT", "POST", "DELETE"],
    "AllowedHeaders": ["*"],
    "MaxAgeSeconds": 3600
  }
]

References

Next Steps