Skip to main content

Configuration

Complete reference for Raven Docs configuration options.

Environment Variables

Required

VariableDescriptionExample
DATABASE_URLPostgreSQL connection stringpostgresql://user:pass@host:5432/db
REDIS_URLRedis connection stringredis://host:6379
APP_SECRETSecret key for encryption (min 32 chars)your-very-long-secret-key-here
APP_URLPublic URL of your instancehttps://docs.example.com

Database

VariableDefaultDescription
DB_HOST-Database host (alternative to DATABASE_URL)
DB_PORT5432Database port
DB_NAME-Database name
DB_USER-Database user
DB_PASSWORD-Database password
DB_SSLfalseEnable SSL
DB_POOL_SIZE10Connection pool size

Redis

VariableDefaultDescription
REDIS_HOST-Redis host (alternative to REDIS_URL)
REDIS_PORT6379Redis port
REDIS_PASSWORD-Redis password
REDIS_TLSfalseEnable TLS

Authentication

VariableDefaultDescription
GOOGLE_CLIENT_ID-Google OAuth client ID
GOOGLE_CLIENT_SECRET-Google OAuth client secret
GITHUB_CLIENT_ID-GitHub OAuth client ID
GITHUB_CLIENT_SECRET-GitHub OAuth client secret
JWT_EXPIRY7dJWT token expiry
SESSION_SECRET-Session encryption key

Storage

VariableDefaultDescription
STORAGE_PROVIDERlocallocal, s3, gcs
STORAGE_PATH/data/uploadsLocal storage path
S3_BUCKET-S3 bucket name
S3_REGION-S3 region
S3_ACCESS_KEY-S3 access key
S3_SECRET_KEY-S3 secret key
S3_ENDPOINT-S3-compatible endpoint
GCS_BUCKET-Google Cloud Storage bucket
GCS_PROJECT_ID-GCP project ID

Email

VariableDefaultDescription
SMTP_HOST-SMTP server host
SMTP_PORT587SMTP port
SMTP_USER-SMTP username
SMTP_PASSWORD-SMTP password
SMTP_FROM-From email address
SMTP_SECUREtrueUse TLS

Features

VariableDefaultDescription
ENABLE_SIGNUPtrueAllow new signups
ENABLE_GOOGLE_AUTHfalseEnable Google OAuth
ENABLE_GITHUB_AUTHfalseEnable GitHub OAuth
ENABLE_AItrueEnable AI features
AI_PROVIDERopenaiAI provider
OPENAI_API_KEY-OpenAI API key

Performance

VariableDefaultDescription
NODE_ENVproductionEnvironment
PORT3000HTTP port
WORKERSautoWorker processes
MAX_UPLOAD_SIZE10mbMax file upload size
RATE_LIMIT100Requests per minute

Logging

VariableDefaultDescription
LOG_LEVELinfodebug, info, warn, error
LOG_FORMATjsonjson or pretty
LOG_FILE-Log file path

Example Configurations

Minimal Production

DATABASE_URL=postgresql://raven:pass@db:5432/ravendocs
REDIS_URL=redis://redis:6379
APP_SECRET=your-32-char-secret-key-here!!
APP_URL=https://docs.example.com

Full Production

# Core
DATABASE_URL=postgresql://raven:pass@db:5432/ravendocs
REDIS_URL=redis://:password@redis:6379
APP_SECRET=your-very-long-secret-key-here
APP_URL=https://docs.example.com
NODE_ENV=production

# Auth
GOOGLE_CLIENT_ID=123456789.apps.googleusercontent.com
GOOGLE_CLIENT_SECRET=your-google-secret
ENABLE_GOOGLE_AUTH=true

# Storage
STORAGE_PROVIDER=s3
S3_BUCKET=my-ravendocs-bucket
S3_REGION=us-east-1
S3_ACCESS_KEY=AKIAIOSFODNN7EXAMPLE
S3_SECRET_KEY=wJalrXUtnFEMI/K7MDENG/bPxRfiCYEXAMPLEKEY

# Email
SMTP_HOST=smtp.sendgrid.net
SMTP_PORT=587
SMTP_USER=apikey
SMTP_PASSWORD=your-sendgrid-api-key
SMTP_FROM=noreply@example.com

# AI
ENABLE_AI=true
OPENAI_API_KEY=sk-your-openai-key

# Logging
LOG_LEVEL=info
LOG_FORMAT=json

Development

DATABASE_URL=postgresql://raven:raven@localhost:5432/ravendocs
REDIS_URL=redis://localhost:6379
APP_SECRET=dev-secret-not-for-production
APP_URL=http://localhost:3000
NODE_ENV=development
LOG_LEVEL=debug
LOG_FORMAT=pretty

Security Recommendations

  1. Use strong secrets - Generate with openssl rand -base64 32
  2. Enable TLS - Use HTTPS for APP_URL
  3. Database SSL - Enable DB_SSL=true in production
  4. Rotate secrets - Change APP_SECRET periodically
  5. Limit access - Use network policies to restrict database access