Skip to main content

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

This page provides a comprehensive reference for all environment variables available in Formbricks. Environment variables allow you to configure your self-hosted instance without modifying code.

Required Variables

These variables are mandatory for Formbricks to function properly.

Core Configuration

WEBAPP_URL
string
required
The base URL where your Formbricks instance is hosted.Example: http://localhost:3000 or https://formbricks.example.com
NEXTAUTH_URL
string
required
Should be the same as WEBAPP_URL. Required for NextAuth authentication.If your application uses a custom base path, specify the full route to the API endpoint.Example: https://example.com/custom-route/api/auth
ENCRYPTION_KEY
string
required
Encryption key for securing sensitive data. Generate using:
openssl rand -hex 32
NEXTAUTH_SECRET
string
required
Secret for NextAuth.js session encryption. Generate using:
openssl rand -hex 32
See NextAuth.js docs for more details.
CRON_SECRET
string
required
Secret for running cron jobs securely. Generate using:
openssl rand -hex 32
DATABASE_URL
string
required
PostgreSQL database connection string.Example: postgresql://postgres:postgres@localhost:5432/formbricks?schema=public

Email Configuration (Required for email features)

MAIL_FROM
string
Email address used as the sender for all outgoing emails.Example: noreply@example.com
MAIL_FROM_NAME
string
Display name for the sender email address.Default: Formbricks
SMTP_HOST
string
SMTP server hostname.Example: smtp.gmail.com or localhost
SMTP_PORT
string
SMTP server port.Common values: 587 (TLS), 465 (SSL), 1025 (local development)
SMTP_USER
string
Username for SMTP authentication.
SMTP_PASSWORD
string
Password for SMTP authentication.

Optional Variables

Logging

LOG_LEVEL
string
default:"info"
Minimum log level to output.Options: debug, info, warn, error, fatal

Base Path

BASE_PATH
string
Deploy the application under a sub-path of a domain. Can only be set at build time.Example: /formbricks

SMTP Advanced Configuration

SMTP_SECURE_ENABLED
string
default:"0"
Enable TLS for SMTP connection (port 465).Options: 0 (disabled), 1 (enabled)
SMTP_AUTHENTICATED
string
default:"1"
Require SMTP authentication.Options: 0 (no authentication), 1 (authentication required)
SMTP_REJECT_UNAUTHORIZED_TLS
string
default:"1"
Accept connections without requiring authorization from the list of supplied CAs.Options: 0 (accept unauthorized), 1 (reject unauthorized)

Storage Configuration

S3_ACCESS_KEY
string
AWS S3 access key ID or compatible storage service credentials.
S3_SECRET_KEY
string
AWS S3 secret access key or compatible storage service credentials.
S3_REGION
string
AWS region for S3 bucket.Example: us-east-1, eu-west-1
S3_BUCKET_NAME
string
Name of the S3 bucket for file storage. Required for file uploads in serverless environments.
S3_ENDPOINT_URL
string
Custom endpoint URL for S3-compatible storage services (e.g., StorJ, MinIO).Leave empty if using Amazon S3.Example: https://gateway.storjshare.io
S3_FORCE_PATH_STYLE
string
default:"0"
Force path style for S3-compatible storage.Options: 0 (disabled), 1 (enabled)
PUBLIC_URL
string
Public domain for all client-facing routes. Falls back to WEBAPP_URL if not set.Example: https://survey.example.com

Feature Toggles

EMAIL_VERIFICATION_DISABLED
string
default:"1"
Disable email verification for new users.Note: Requires SMTP configuration if enabled.Options: 0 (enabled), 1 (disabled)
PASSWORD_RESET_DISABLED
string
default:"1"
Disable password reset functionality.Note: Requires SMTP configuration if enabled.Options: 0 (enabled), 1 (disabled)
EMAIL_AUTH_DISABLED
string
default:"0"
Disable email/password login.Options: 0 (enabled), 1 (disabled)
INVITE_DISABLED
string
default:"0"
Disable the ability for invited users to create accounts.Options: 0 (enabled), 1 (disabled)
PRIVACY_URL
string
URL to your privacy policy. Displayed in footer of signup and public pages.
TERMS_URL
string
URL to your terms of service. Displayed in footer of signup and public pages.
IMPRINT_URL
string
URL to your imprint/legal notice. Displayed in footer of signup and public pages.
IMPRINT_ADDRESS
string
Physical address for imprint/legal notice.

Security & Bot Protection

TURNSTILE_SITE_KEY
string
Cloudflare Turnstile site key for bot protection in signup flow.
TURNSTILE_SECRET_KEY
string
Cloudflare Turnstile secret key for bot protection.
RECAPTCHA_SITE_KEY
string
Google reCAPTCHA v3 site key for bot protection.
RECAPTCHA_SECRET_KEY
string
Google reCAPTCHA v3 secret key for bot protection.

OAuth Providers

GITHUB_ID
string
GitHub OAuth application client ID.
GITHUB_SECRET
string
GitHub OAuth application client secret.
GOOGLE_CLIENT_ID
string
Google OAuth application client ID.
GOOGLE_CLIENT_SECRET
string
Google OAuth application client secret.
AZUREAD_CLIENT_ID
string
Azure Active Directory OAuth application client ID.
AZUREAD_CLIENT_SECRET
string
Azure Active Directory OAuth application client secret.
AZUREAD_TENANT_ID
string
Azure Active Directory tenant ID.

OpenID Connect (OIDC)

OIDC_CLIENT_ID
string
OIDC client ID.
OIDC_CLIENT_SECRET
string
OIDC client secret.
OIDC_ISSUER
string
OIDC issuer URL.
OIDC_DISPLAY_NAME
string
Display name for OIDC provider in login UI.
OIDC_SIGNING_ALGORITHM
string
OIDC token signing algorithm.Example: RS256

SAML SSO

SAML_DATABASE_URL
string
Separate PostgreSQL database URL for SAML SSO configuration.Example: postgresql://postgres:postgres@localhost:5432/formbricks-saml

Asset Configuration

ASSET_PREFIX_URL
string
Configure to ship JS & CSS files from a complete URL instead of the current domain.

Integrations

NOTION_OAUTH_CLIENT_ID
string
Notion OAuth client ID for Notion integration.
NOTION_OAUTH_CLIENT_SECRET
string
Notion OAuth client secret for Notion integration.
GOOGLE_SHEETS_CLIENT_ID
string
Google Sheets OAuth client ID.
GOOGLE_SHEETS_CLIENT_SECRET
string
Google Sheets OAuth client secret.
GOOGLE_SHEETS_REDIRECT_URL
string
Google Sheets OAuth redirect URL.
AIRTABLE_CLIENT_ID
string
Airtable OAuth client ID.
SLACK_CLIENT_ID
string
Slack OAuth client ID for Slack integration.
SLACK_CLIENT_SECRET
string
Slack OAuth client secret for Slack integration.
UNSPLASH_ACCESS_KEY
string
Unsplash API access key for image integration.

Billing (Enterprise)

STRIPE_SECRET_KEY
string
Stripe secret key for payment processing.
STRIPE_WEBHOOK_SECRET
string
Stripe webhook secret for verifying webhook signatures.

Enterprise Features

ENTERPRISE_LICENSE_KEY
string
Enterprise license key to unlock enterprise features.
AUTH_SSO_DEFAULT_TEAM_ID
string
Automatically assign new SSO users to a specific organization.Insert an existing organization ID or generate a valid CUID at getuniqueid.com.
AUTH_SKIP_INVITE_FOR_SSO
string
default:"0"
Skip invite requirement for SSO users.Options: 0 (require invite), 1 (skip invite)
USER_MANAGEMENT_MINIMUM_ROLE
string
default:"manager"
Minimum role required for user management from UI.Options: owner, manager, disabled

Marketing & Analytics

BREVO_API_KEY
string
Brevo (formerly Sendinblue) API key for sending new users to Brevo.
BREVO_LIST_ID
string
Brevo list ID to add new users to.

Performance & Caching

REDIS_URL
string
Redis connection URL for caching (uses Next.js in-memory cache if not provided).Example: redis://localhost:6379
REDIS_HTTP_URL
string
Redis HTTP URL for rate limiting (uses in-memory LRU cache if not provided).You can use a service like Webdis for this.
RATE_LIMITING_DISABLED
string
default:"0"
Disable rate limiting across the Formbricks app.Options: 0 (enabled), 1 (disabled)

Monitoring & Observability

OTEL_EXPORTER_OTLP_ENDPOINT
string
OpenTelemetry OTLP endpoint (base URL, exporters append /v1/traces and /v1/metrics).Example: http://localhost:4318
OTEL_EXPORTER_OTLP_PROTOCOL
string
OpenTelemetry protocol.Example: http/protobuf
OTEL_SERVICE_NAME
string
Service name for OpenTelemetry.Example: formbricks
OTEL_RESOURCE_ATTRIBUTES
string
Resource attributes for OpenTelemetry.Example: deployment.environment=development
OTEL_TRACES_SAMPLER
string
Trace sampler for OpenTelemetry.Example: parentbased_traceidratio
OTEL_TRACES_SAMPLER_ARG
string
Trace sampler argument for OpenTelemetry.Example: 1
PROMETHEUS_ENABLED
string
default:"0"
Enable Prometheus metrics.Options: 0 (disabled), 1 (enabled)
PROMETHEUS_EXPORTER_PORT
string
Port for Prometheus metrics exporter.
SENTRY_DSN
string
Sentry DSN for error tracking and performance monitoring.
SENTRY_AUTH_TOKEN
string
Sentry authentication token. Picked up automatically by Sentry Build Plugin for uploading source maps.
SENTRY_ENVIRONMENT
string
Environment label for errors in Sentry dashboard.Example: production, staging

Support & Chat

CHATWOOT_BASE_URL
string
default:"https://app.chatwoot.com"
Chatwoot base URL for customer support chat.
CHATWOOT_WEBSITE_TOKEN
string
Chatwoot website token for customer support integration.

Audit Logging

AUDIT_LOG_ENABLED
string
default:"0"
Enable audit logging.Options: 0 (disabled), 1 (enabled)
AUDIT_LOG_GET_USER_IP
string
default:"0"
Include user IP addresses in audit logs.Options: 0 (disabled), 1 (enabled)

Session Configuration

SESSION_MAX_AGE
string
default:"86400"
Maximum session age in seconds.Default: 86400 (24 hours)

Environment Type

ENVIRONMENT
string
default:"production"
Internal environment identifier.Options: production, staging

Translation

LINGODOTDEV_API_KEY
string
Lingo.dev API key for translation generation.

Environment File Example

You can copy the .env.example file from the Formbricks repository as a starting point:
cp .env.example .env
Then edit the .env file with your specific configuration values.