Documentation Index
Fetch the complete documentation index at: https://mintlify.com/formbricks/formbricks/llms.txt
Use this file to discover all available pages before exploring further.
Overview
Formbricks supports file uploads in surveys and responses. For self-hosted instances, you can configure S3-compatible storage for handling file uploads. This is especially important for serverless deployments (like Vercel) where local file storage is not persistent.Storage Backends
Formbricks supports two storage backends:- Local Storage - Default for traditional server deployments
- S3-Compatible Storage - Required for serverless environments and recommended for production
S3 Storage Configuration
Required Environment Variables
The name of your S3 bucket where files will be stored.Example:
formbricks-uploadsNote: This is the only truly required variable. The bucket must exist before starting Formbricks.Optional Environment Variables
AWS access key ID or compatible storage service credentials.If not provided, Formbricks will attempt to use the default AWS credential chain (useful for EC2 instances with IAM roles).
AWS secret access key or compatible storage service credentials.Required if
S3_ACCESS_KEY is provided.AWS region where your S3 bucket is located.Examples:
us-east-1, eu-west-1, ap-southeast-1If not specified, defaults to AWS SDK defaults.Custom endpoint URL for S3-compatible storage providers.Leave empty if using Amazon S3.Examples:
- MinIO:
https://minio.example.com - StorJ:
https://gateway.storjshare.io - DigitalOcean Spaces:
https://nyc3.digitaloceanspaces.com - Cloudflare R2:
https://<account-id>.r2.cloudflarestorage.com
Force path-style URLs instead of virtual-hosted-style URLs.Required for some S3-compatible services like MinIO.Options:
0- Use virtual-hosted-style (e.g.,bucket-name.s3.amazonaws.com/key)1- Use path-style (e.g.,s3.amazonaws.com/bucket-name/key)
Public URL Configuration
Public domain URL for client-facing routes.If you’re using a separate domain for your surveys (e.g.,
survey.example.com), set this to override the default WEBAPP_URL.Example: https://survey.example.comProvider-Specific Setup
Amazon S3
- Create an S3 bucket in AWS Console
- Create an IAM user with programmatic access
- Attach a policy with the following permissions:
- Configure environment variables:
MinIO
MinIO is an open-source S3-compatible object storage server.http://localhost:9001 to create your bucket.
DigitalOcean Spaces
Cloudflare R2
Backblaze B2
StorJ
Wasabi
File Upload Limits
Formbricks has built-in file size limits:- Standard uploads: 10 MB
- Large uploads: 1 GB (for specific use cases)
Allowed File Types
Formbricks supports the following file types for security reasons:Images
- HEIC, PNG, JPEG, JPG, WebP, ICO
Documents
- PDF, EML, DOC, DOCX, XLS, XLSX, PPT, PPTX, TXT, CSV
Media
- MP4, MOV, AVI, MKV, WebM, MP3
Archives
- ZIP, RAR, 7Z, TAR
Access Control
Formbricks supports two access types for uploaded files:- Public - Files accessible via direct URL
- Private - Files require authentication to access
Public Files
Public files are typically used for:- Survey background images
- Logos
- Public assets
Private Files
Private files are used for:- User-uploaded survey responses
- Sensitive documents
- Internal file uploads
Bucket Configuration
CORS Configuration
For public file uploads to work correctly, configure CORS on your S3 bucket:Bucket Permissions
For private files, ensure your bucket is not publicly accessible. Formbricks uses signed URLs for private file access. For public files, you may want to configure a bucket policy:Local Storage (Development)
For local development without S3, Formbricks will use local file storage by default whenS3_BUCKET_NAME is not configured.
Warning: Local storage is not suitable for:
- Serverless deployments (Vercel, AWS Lambda, etc.)
- Multi-instance deployments
- Production environments where persistence is required
Serverless Deployments
When deploying to serverless platforms like Vercel, Netlify, or AWS Lambda:S3 storage is required for serverless environments because the local filesystem is ephemeral and files will be lost between deployments or function invocations.
Troubleshooting
Files Not Uploading
- Check bucket name: Ensure
S3_BUCKET_NAMEis correct and the bucket exists - Verify credentials: Confirm
S3_ACCESS_KEYandS3_SECRET_KEYare valid - Check permissions: Ensure the IAM user/role has
PutObjectpermissions - Verify CORS: Make sure CORS is properly configured on your bucket
Files Not Accessible
- Check bucket policy: For public files, ensure the bucket policy allows public reads
- Verify region: Ensure
S3_REGIONmatches your bucket’s region - Check endpoint URL: For S3-compatible services, verify
S3_ENDPOINT_URLis correct
Connection Errors
- Test endpoint: Use
curloraws s3 lsto test connectivity - Check firewall: Ensure outbound connections to S3 are allowed
- Verify endpoint format: Some services require
S3_FORCE_PATH_STYLE=1
Performance Issues
- Use correct region: Deploy Formbricks in the same region as your S3 bucket
- Enable CDN: Consider using CloudFront or similar CDN for public files
- Monitor transfer costs: Be aware of data transfer costs between regions
Migration
From Local to S3
If you’re migrating from local storage to S3:- Set up S3 bucket and configure environment variables
- Copy existing files to S3 using AWS CLI or similar tools
- Update database references if needed
- Restart Formbricks with S3 configuration
Between S3 Providers
- Create new bucket in target provider
- Use a tool like
rcloneto sync files between buckets - Update environment variables
- Restart Formbricks
Security Best Practices
- Use IAM roles: On AWS EC2, use IAM roles instead of access keys
- Least privilege: Grant only necessary S3 permissions
- Encrypt at rest: Enable S3 bucket encryption
- Secure credentials: Never commit access keys to version control
- Rotate keys: Regularly rotate S3 access keys
- Enable versioning: Turn on S3 versioning to prevent accidental deletions
- Monitor access: Enable S3 access logging for audit trails
Cost Optimization
- Use lifecycle policies: Archive old files to cheaper storage classes
- Enable intelligent tiering: Let AWS automatically optimize storage costs
- Monitor usage: Set up billing alerts for unexpected increases
- Clean up unused files: Implement retention policies for temporary files
- Choose the right region: Balance latency with regional pricing differences
Next Steps
- Authentication Configuration - Set up SSO and OAuth
- Email Configuration - Configure SMTP for emails
- Environment Variables Reference - Complete list of all variables