Skip to main content

Environment Variables

AppFlowy uses environment variables for configuration. All settings are defined in the .env file.

Core Application Settings

string
required
The base URL where your AppFlowy instance is accessible.
Must use HTTPS in production. HTTP is only acceptable for local development.
string
required
WebSocket URL for real-time collaboration features.
Use wss:// (secure WebSocket) for production. Must match your base URL domain.
string
required
GoTrue authentication service URL.
boolean
default:"false"
Enable detailed sync tracing for debugging collaboration issues.
Enabling this will generate verbose logs. Use only for troubleshooting.

Database Configuration

AppFlowy requires PostgreSQL 14 or later.
string
required
PostgreSQL server hostname.
integer
default:"5432"
PostgreSQL server port.
string
required
Database name for AppFlowy.
string
required
Database username.
string
required
Database password.
Use a strong, randomly generated password. Never use default passwords in production.
integer
default:"100"
Maximum number of database connections.

Redis Configuration

Redis is used for caching, session management, and real-time presence.
string
required
Redis server hostname.
integer
default:"6379"
Redis server port.
string
Redis password (optional but recommended).
integer
default:"0"
Redis database number.

Storage Configuration

AppFlowy uses S3-compatible object storage for files and attachments.

MinIO

Self-hosted S3-compatible storage (recommended for self-hosting)

AWS S3

Amazon S3 for cloud-based deployments

Cloudflare R2

Cost-effective S3-compatible alternative

DigitalOcean Spaces

Another S3-compatible option
string
required
S3 service endpoint URL.
string
required
S3 access key ID.
string
required
S3 secret access key.
Keep this secret secure. Never commit to version control.
string
required
S3 bucket name for storing files.
string
default:"us-east-1"
S3 region (for AWS S3 or compatible services).
boolean
default:"true"
Use path-style URLs (required for MinIO).

Authentication Configuration

AppFlowy uses GoTrue for authentication.
string
required
Secret key for JWT token signing.
Generate with:
This is critical for security. Use a cryptographically random value.
string
required
The URL where GoTrue is accessible.
integer
default:"3600"
JWT token expiration time in seconds.
boolean
default:"false"
Disable public user registration.
Set to true in private deployments where you want to control user creation.
boolean
default:"false"
Skip email confirmation for new users.

Email Configuration

Configure SMTP for sending authentication emails.
string
SMTP server hostname.
integer
default:"587"
SMTP server port.
string
SMTP username.
string
SMTP password.
string
Email address for outgoing emails.

AI Configuration (Optional)

Configure AI features if you want to enable them.
string
OpenAI API key for AI features.
string
default:"gpt-4"
AI model to use.
boolean
default:"false"
Enable or disable AI features.
integer
default:"2000"
Maximum tokens for AI responses.

Advanced Configuration

Resource Limits

Configure resource limits in docker-compose.yml:

Database Connection Pooling

Optimize database performance:

Logging Configuration

string
default:"info"
Application log level.
string
default:"json"
Log output format.

Performance Tuning

Optimize PostgreSQL for AppFlowy:
Apply in postgresql.conf or via environment:

Configuration Examples

Small Team Setup

Optimal for 5-20 users:

Enterprise Setup

Optimal for 100+ users:

Validating Configuration

Verify your configuration is correct:
1

Check environment variables

2

Test database connection

3

Verify Redis connection

4

Test S3 connectivity

Configuration Best Practices

Use Secrets Management

Store sensitive values in Docker secrets or a secrets manager like HashiCorp Vault.

Environment Separation

Maintain separate configurations for development, staging, and production.

Version Control

Track configuration changes (excluding secrets) in version control.

Regular Audits

Review and update configurations periodically.
Never commit .env files with real credentials to version control. Use .env.example as a template.

Next Steps

Security Guide

Secure your AppFlowy deployment

Monitoring & Logs

Set up monitoring and alerting