Skip to main content

Optional: add RustFS for file storage

RustFS provides S3-compatible object storage for file uploads in Formbricks. It is not required for the baseline Docker setup. Add it only when you want features like image uploads, survey file uploads, or custom logos.
For a broader overview of file storage options and required environment variables, see our File Uploads Configuration guide.
For production deployments with HTTPS, use the one-click setup script which automatically configures RustFS with Traefik, SSL certificates, a dedicated files. subdomain, and least-privilege service credentials. The examples below are best suited for development, testing, or custom local setups.
The bundled RustFS examples on this page are convenience-oriented single-server setups. They work well for development, evaluation, and smaller self-hosted deployments, but they are not the ideal RustFS architecture for high-availability or larger-scale production storage. For stricter production requirements, use external object storage or run a dedicated RustFS deployment separately.

Quick start: repository development stack

If you cloned the Formbricks repository, the fastest way to test file uploads locally is to use the included docker-compose.dev.yml, which already starts RustFS and auto-creates the formbricks bucket.
This development compose file is not downloaded by the manual production quickstart. If you only downloaded docker-compose.yml, use the manual RustFS setup below or the one-click production setup.
1

Start the local stack

From the repository root:
This starts PostgreSQL, Valkey (Redis), Mailhog, RustFS, a permissions helper, a one-time bucket bootstrap job, Formbricks Hub, and a local Cube instance for analytics testing.
2

Open the storage console

Open http://localhost:9001 in your browser and sign in with:
  • Username: devrustfs
  • Password: devrustfs123
3

Configure Formbricks

Update your .env file or environment variables:
4

Verify uploads

After uploading a file in Formbricks, open http://localhost:9001 and navigate to Buckets → formbricks to confirm the object was stored successfully.
The development compose file also runs a rustfs-init job so you do not need to create the bucket manually.

Manual RustFS setup (custom configuration)

Recommended: Prefer docker-compose.dev.yml for local development unless you need to fold RustFS into an existing custom Compose stack.
If you want to add RustFS to your own docker-compose.yml, use a pinned RustFS image plus two helper services:
Declare the corresponding volume:
Store the generated RustFS credentials in a local .env file next to your docker-compose.yml instead of hardcoding them in Compose:
Then configure Formbricks to use the RustFS service credentials:
Start the stack:
The bucket and service account are created automatically by the rustfs-init job defined above, so no manual RustFS console step is required.
Restrict the .env file to 0600 and do not commit it to source control. For production, prefer the one-click setup script, which creates a separate least-privilege service account automatically.

Tips & common gotchas

  • Permission denied on /data: Ensure the mounted directory or volume is owned by UID 10001. The rustfs-perms helper handles this for Compose-managed volumes.
  • Storage medium matters: Prefer local SSD or NVMe storage for rustfs-data, use XFS on dedicated host-managed disks where possible, and avoid NFS or other network filesystems for RustFS data.
  • Connection refused: Ensure the rustfs container is running and port 9000 is reachable from the Formbricks container.
  • Bucket not found: Confirm that rustfs-init completed successfully or create the bucket manually with rc.
  • Auth failed: Confirm that S3_ACCESS_KEY and S3_SECRET_KEY match the RustFS credentials configured on the server.
  • Backups: Back up the rustfs-data volume regularly, especially for single-server deployments.
  • Console exposure: Do not expose the RustFS console port publicly in production. Keep it on a private network or behind admin-only controls.
  • Health check: From the Formbricks container:

Production setup with Traefik

For production deployments, use the one-click setup script, which automatically configures:
  • RustFS behind Traefik on a dedicated files.yourdomain.com subdomain
  • Automatic SSL certificate generation via Let’s Encrypt
  • CORS configuration scoped to your Formbricks domain
  • Rate limiting middleware
  • Separate RustFS admin and Formbricks service credentials
  • A rustfs-init job that creates the bucket and access policy
The production setup from formbricks.sh adds the reverse proxy wiring and bootstrap automation needed for long-lived deployments.
Even in the one-click flow, bundled RustFS remains a convenience-oriented single-server deployment. For higher availability, stricter operational requirements, or larger storage footprints, prefer external object storage or a dedicated RustFS deployment managed separately from Formbricks.