Media Services
Configure external media storage for better performance and scalability.
Overview
Section titled “Overview”By default, Deckyard stores uploaded images locally. For production deployments, configure an external media provider for:
- CDN delivery - Faster loading worldwide
- Scalable storage - Unlimited capacity
- Image optimization - Automatic resizing and formats
- Reduced server load - Offload media handling
Supported Providers
Section titled “Supported Providers”ImageKit
Section titled “ImageKit”Full-featured image CDN with optimization:
IMAGEKIT_PUBLIC_KEY=public_xxxxxxxxxxxxxxxIMAGEKIT_PRIVATE_KEY=private_xxxxxxxxxxxxxxxIMAGEKIT_URL_ENDPOINT=https://ik.imagekit.io/your-idFeatures:
- Automatic format conversion (WebP, AVIF)
- Real-time image resizing
- Lazy loading support
- Global CDN
Scaleway Object Storage
Section titled “Scaleway Object Storage”S3-compatible storage with CDN:
SCALEWAY_ACCESS_KEY=SCWxxxxxxxxxxxxxxxxxxSCALEWAY_SECRET_KEY=xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxxSCALEWAY_REGION=fr-parSCALEWAY_BUCKET=your-bucket-nameSCALEWAY_ENDPOINT=https://s3.fr-par.scw.cloudFeatures:
- S3-compatible API
- European data centers
- Pay-per-use pricing
- CDN integration available
AWS S3
Section titled “AWS S3”Amazon’s object storage:
AWS_ACCESS_KEY_ID=AKIAxxxxxxxxxxxxxxxxAWS_SECRET_ACCESS_KEY=xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxAWS_REGION=us-east-1AWS_S3_BUCKET=your-bucket-nameFeatures:
- Highly reliable
- CloudFront CDN integration
- Fine-grained access control
- Multiple storage classes
S3-Compatible Storage
Section titled “S3-Compatible Storage”Any S3-compatible provider (MinIO, DigitalOcean Spaces, etc.):
S3_ENDPOINT=https://your-s3-endpoint.comS3_ACCESS_KEY=your-access-keyS3_SECRET_KEY=your-secret-keyS3_BUCKET=your-bucket-nameS3_REGION=autoConfiguration
Section titled “Configuration”Choose a Provider
Section titled “Choose a Provider”Set the media provider in your environment:
# Options: imagekit, scaleway, s3, localMEDIA_PROVIDER=imagekitIf not specified, the system auto-detects based on available credentials.
Local Storage (Default)
Section titled “Local Storage (Default)”For development or single-server deployments:
# No configuration needed# Files stored in ./server/uploads/Limitations:
- Not suitable for multi-server deployments
- No CDN benefits
- Backup responsibility on you
Uploading Images
Section titled “Uploading Images”When you upload an image in Deckyard:
- Image is sent to the server
- Server uploads to configured provider
- Provider returns a public URL
- URL is stored with your presentation
Image URLs
Section titled “Image URLs”Depending on provider, URLs look like:
# ImageKithttps://ik.imagekit.io/your-id/uploads/abc123.jpg
# Scalewayhttps://your-bucket.s3.fr-par.scw.cloud/uploads/abc123.jpg
# Local/uploads/abc123.jpgOG Image Storage
Section titled “OG Image Storage”Generated OpenGraph preview images are stored using the same provider.
ImageKit Setup
Section titled “ImageKit Setup”1. Create Account
Section titled “1. Create Account”- Go to ImageKit.io
- Create a free account
- Verify your email
2. Get Credentials
Section titled “2. Get Credentials”- Go to Developer Options
- Find your URL Endpoint
- Copy Public Key and Private Key
3. Configure Deckyard
Section titled “3. Configure Deckyard”IMAGEKIT_PUBLIC_KEY=public_xxxxxxxxxxxxxxxIMAGEKIT_PRIVATE_KEY=private_xxxxxxxxxxxxxxxIMAGEKIT_URL_ENDPOINT=https://ik.imagekit.io/your-id4. Image Transformations
Section titled “4. Image Transformations”ImageKit supports URL-based transformations:
# Originalhttps://ik.imagekit.io/id/image.jpg
# Resized to 800px widthhttps://ik.imagekit.io/id/tr:w-800/image.jpg
# WebP formathttps://ik.imagekit.io/id/tr:f-webp/image.jpgDeckyard can use these for responsive images.
Scaleway Setup
Section titled “Scaleway Setup”1. Create Account
Section titled “1. Create Account”- Go to Scaleway
- Create an account
- Add billing information
2. Create Bucket
Section titled “2. Create Bucket”- Go to Object Storage
- Click Create a bucket
- Choose a region and name
- Set visibility to Public for CDN access
3. Get Credentials
Section titled “3. Get Credentials”- Go to Credentials > API Keys
- Create a new API key
- Copy the Access Key and Secret Key
4. Configure CORS
Section titled “4. Configure CORS”In bucket settings, add CORS configuration:
[ { "AllowedOrigins": ["*"], "AllowedMethods": ["GET", "PUT", "POST"], "AllowedHeaders": ["*"] }]Migration
Section titled “Migration”From Local to Cloud
Section titled “From Local to Cloud”To migrate existing uploads:
- Configure the new provider
- Copy files from
./server/uploads/to cloud - Update image URLs in presentations
Between Providers
Section titled “Between Providers”- Download all media from current provider
- Upload to new provider
- Update environment variables
- Update image URLs (or use redirects)
Troubleshooting
Section titled “Troubleshooting”Upload Failures
Section titled “Upload Failures”- Verify credentials are correct
- Check bucket/account permissions
- Ensure bucket exists
- Verify network connectivity
Missing Images
Section titled “Missing Images”- Check the provider dashboard for files
- Verify URLs are accessible
- Check for CORS issues
- Ensure bucket is public (if needed)
Performance Issues
Section titled “Performance Issues”- Enable CDN if available
- Check image optimization settings
- Verify regional endpoints
Best Practices
Section titled “Best Practices”Security
Section titled “Security”- Use separate credentials for Deckyard
- Restrict permissions to necessary operations
- Enable bucket logging for auditing
- Consider private bucket + signed URLs for sensitive content
Performance
Section titled “Performance”- Choose provider with nearby data centers
- Enable CDN for global distribution
- Use image optimization features
- Implement caching headers
Cost Management
Section titled “Cost Management”- Monitor storage usage
- Set up billing alerts
- Clean up unused files periodically
- Use appropriate storage classes