This guide demonstrates how to integrate S3-compatible asset storage into your Vendure application using multiple cloud storage platforms. You'll learn to configure a single, platform-agnostic storage solution that works seamlessly with AWS S3, DigitalOcean Spaces, MinIO, CloudFlare R2, and Supabase Storage.
This guide is based on the s3-file-storage example. Refer to the complete working code for full implementation details.
Configure your chosen storage provider by following the setup instructions for your preferred platform:
Create an S3 Bucket
my-vendure-assets)Create IAM User with S3 Permissions
Set PermissionsAttach existing policies directly optionAmazonS3FullAccess policy (or create a custom policy with minimal permissions)Generate Access Keys
Environment Variables
Configure your Vendure application to use S3-compatible asset storage by modifying your vendure-config.ts:
IMPORTANT: The configuration uses a conditional approach - when S3_BUCKET is set, it activates S3 storage; otherwise, it falls back to local file storage. This enables seamless development-to-production transitions.
Create a .env file in your project root with your chosen storage provider configuration:
Preconfigured environment examples for each storage provider are available in the s3-file-storage example repository.
Verify your S3 storage configuration works correctly:
Start your Vendure server:
Access the Dashboard:
Test asset upload:
Verify storage backend:
For production deployments with CDN or custom domains:
Use different buckets for different environments:
Switching between storage providers requires updating only the environment variables:
"Access Denied" Errors:
"Bucket Not Found" Errors:
S3_REGION matches your bucket's regionS3_FORCE_PATH_STYLE=trueAssets Not Loading:
assetUrlPrefix matches your actual domainConnection Timeout Issues:
S3_ENDPOINT URL is correct and accessibleYou now have a robust, platform-agnostic S3-compatible asset storage solution integrated with your Vendure application. This configuration provides:
The unified approach eliminates the need for custom storage plugins while maintaining flexibility across different cloud storage platforms. Your assets will be reliably stored and served regardless of which S3-compatible provider you choose.