Formbricks is an open-source survey and experience-management platform — a privacy-friendly alternative to tools like Typeform and Qualtrics. Self-hosting means survey responses stay in your own database, which is a big deal for teams with data-residency or compliance requirements. It's a Next.js app backed by PostgreSQL, so the deployment is refreshingly straightforward compared to multi-process apps.
This guide deploys Formbricks with a managed PostgreSQL database.
What Formbricks needs
| Component | Role |
|---|---|
| Next.js app | Web UI, survey rendering, API |
| PostgreSQL | Surveys, responses, users |
| SMTP (optional) | Email invites, verification, notifications |
| Object storage (optional) | File-upload survey responses |
It's essentially one web app plus a database — the simplest topology in this series.
Step 1: Provision managed PostgreSQL
On [PandaStack](https://dashboard.pandastack.io), create a managed PostgreSQL (14.x or 16.x). When linked to the app, DATABASE_URL is injected automatically, which Formbricks (via Prisma) reads directly.
Step 2: Generate required secrets
Formbricks needs several secrets for auth, encryption, and cron protection:
openssl rand -hex 32 # NEXTAUTH_SECRET
openssl rand -hex 32 # ENCRYPTION_KEY
openssl rand -hex 32 # CRON_SECRETENCRYPTION_KEY protects sensitive stored data — keep it stable across deploys.
Step 3: Assemble the environment
WEBAPP_URL=https://surveys.example.com
NEXTAUTH_URL=https://surveys.example.com
NEXTAUTH_SECRET=<generated>
ENCRYPTION_KEY=<generated>
CRON_SECRET=<generated>
DATABASE_URL=${DATABASE_URL} # injected by linking managed PostgreSQL
# Email (optional but recommended)
MAIL_FROM=surveys@example.com
SMTP_HOST=<smtp-host>
SMTP_PORT=587
SMTP_USER=<user>
SMTP_PASSWORD=<password>
# Optional: disable open signup after creating your account
SIGNUP_DISABLED=0WEBAPP_URL and NEXTAUTH_URL must match your real HTTPS domain.
Step 4: Run database migrations
Formbricks uses Prisma. Apply migrations before first boot as a pre-deploy step with the Formbricks image:
npx prisma migrate deployRun this on every deploy that includes schema changes.
Step 5: Deploy the container
FROM ghcr.io/formbricks/formbricks:latest
# Serves on port 3000Pin a version in production.
- 1Push the repo (or reference the image) to GitHub.
- 2Create a container app on PandaStack.
- 3Link the managed PostgreSQL so
DATABASE_URLis injected. - 4Set the env vars (secrets as secrets).
- 5Set
npx prisma migrate deployas the pre-deploy hook. - 6Expose port
3000. - 7Add a custom domain matching your URL vars; SSL is automatic.
Step 6: First-run setup
Visit your domain and create the first account (which becomes the admin/owner). Then optionally set SIGNUP_DISABLED=1 and redeploy so only invited users can join.
Formbricks offers two survey modes:
- Link surveys — standalone shareable URLs (like a classic Typeform link). No website integration needed.
- In-app / website surveys — triggered inside your product based on user actions, using the Formbricks JS SDK.
Step 7: Embed in-app surveys (optional)
For product-embedded surveys, add the Formbricks SDK to your app and point it at your self-hosted instance:
import formbricks from "@formbricks/js";
formbricks.setup({
environmentId: "<your-environment-id>",
appUrl: "https://surveys.example.com",
});Then trigger surveys based on actions or attributes you define in the Formbricks dashboard. Because the instance is yours, responses never leave your infrastructure.
Why self-host a survey tool?
| Reason | Detail |
|---|---|
| Data ownership | Responses stay in your PostgreSQL |
| Compliance | Easier GDPR / data-residency story |
| Cost | No per-response or per-seat pricing |
| Customization | Open source — theme and extend it |
Hosted tools like Typeform are genuinely slick and zero-ops; self-hosting is the right call when response data is sensitive or you want to avoid usage-based pricing. Formbricks gives you that without sacrificing a modern survey UX.
Operating tips
- Back up PostgreSQL — it holds all survey definitions and responses. Scheduled backups cover it.
- Keep
ENCRYPTION_KEYstable — rotating it can render encrypted data unreadable. - Configure SMTP if you want email invites and team onboarding.
- Pin image versions and run
prisma migrate deployon upgrades.
References
- [Formbricks documentation](https://formbricks.com/docs)
- [Formbricks self-hosting guide](https://formbricks.com/docs/self-hosting/overview)
- [Formbricks environment variables](https://formbricks.com/docs/self-hosting/configuration)
- [Formbricks GitHub](https://github.com/formbricks/formbricks)
---
Formbricks is one of the easiest self-hosted apps in this series — a single Next.js container plus a database — and PandaStack makes it painless with managed PostgreSQL, an injected DATABASE_URL, pre-deploy migrations, and automatic SSL. Run privacy-first surveys you fully own at [dashboard.pandastack.io](https://dashboard.pandastack.io).