Deploy Formbricks on any server using Docker and Docker Compose. This method is ideal for single-server deployments and development environments.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.
Prerequisites
- A Linux server (Ubuntu 20.04+ recommended)
- SSH access to the server
- A domain name pointing to your server (for SSL)
- Minimum 4GB RAM and 2 CPU cores
Quick Start (Automated Setup)
The fastest way to deploy Formbricks with Docker is using our automated setup script:Run the Installation Script
Execute the following command on your server:The script will:
- Install Docker and Docker Compose if not present
- Set up Traefik as a reverse proxy
- Configure SSL certificates via Let’s Encrypt
- Deploy Formbricks with PostgreSQL and Redis
Provide Required Information
The script will prompt you for:
- Email Address: For SSL certificate registration with Let’s Encrypt
- Domain Name: Your Formbricks domain (e.g.,
formbricks.example.com)
Ensure your domain’s A record points to your server’s IP address before running the script.
Manual Setup
For more control over the deployment, you can manually configure Docker Compose:Download docker-compose.yml
Create a
docker-compose.yml file with the following content:docker-compose.yml
Generate Secret Keys
Generate three secure keys for your deployment:Add these to the
docker-compose.yml file in the environment section.Configuration Reference
Essential Environment Variables
The following variables must be configured:| Variable | Description | Example |
|---|---|---|
WEBAPP_URL | Public URL of your Formbricks instance | https://formbricks.example.com |
NEXTAUTH_URL | NextAuth URL (same as WEBAPP_URL) | https://formbricks.example.com |
DATABASE_URL | PostgreSQL connection string | postgresql://user:pass@host:5432/db |
REDIS_URL | Redis connection string | redis://redis:6379 |
NEXTAUTH_SECRET | NextAuth encryption secret | Generated with openssl rand -hex 32 |
ENCRYPTION_KEY | 2FA & link encryption key | Generated with openssl rand -hex 32 |
CRON_SECRET | API secret for cron jobs | Generated with openssl rand -hex 32 |
Optional Features
Enable Email Verification
Enable Email Verification
Configure SMTP and enable email features:
S3 File Storage
S3 File Storage
Store file uploads in S3:
OAuth Authentication
OAuth Authentication
Enable GitHub, Google, or Azure AD login:
Enterprise License
Enterprise License
Activate Enterprise features:
SSL/TLS Configuration
Using Traefik (Recommended)
The automated setup script uses Traefik for automatic SSL. To manually configure Traefik:- Traefik will automatically obtain certificates from Let’s Encrypt
- Certificates are renewed automatically
- HTTP traffic is redirected to HTTPS
Using Nginx
If you prefer Nginx as a reverse proxy:Updating Formbricks
Backup and Restore
Backup Database
Restore Database
Backup Volumes
Troubleshooting
Container won't start
Container won't start
Check the logs for error messages:Common issues:
- Missing or invalid environment variables
- Database connection failures
- Port 3000 already in use
Database connection failed
Database connection failed
Ensure PostgreSQL is healthy:Test the connection:
SSL certificate issues
SSL certificate issues
If using the automated script:
- Ensure your domain’s A record points to your server
- Check that ports 80 and 443 are open
- Wait a few minutes for DNS propagation
Performance Tuning
Increase PostgreSQL Performance
Add PostgreSQL tuning to your compose file:Redis Persistence
The default configuration uses AOF (Append-Only File) for Redis persistence, which provides good durability. Adjust if needed:Next Steps
Configure Integrations
Connect Formbricks with your tools
Create Your First Survey
Start collecting feedback