Environment Variables
All configuration is done through environment variables. Copy example.env to .env and customize.
Database Configuration
Section titled “Database Configuration”PostgreSQL
Section titled “PostgreSQL”# Connection URL (required)POSTGRES_URL=postgres://user:password@localhost:5432/zori?sslmode=disableClickHouse
Section titled “ClickHouse”# Connection details (required)CLICKHOUSE_URL=localhost:9000CLICKHOUSE_USERNAME=defaultCLICKHOUSE_USER=defaultCLICKHOUSE_PASSWORD=defaultCLICKHOUSE_DATABASE=defaultMessage Queue & Cache
Section titled “Message Queue & Cache”# NATS JetStream URL (required)NATS_STREAM_URL=nats://localhost:4222
# Optional: NATS credentials for cloud/secured deploymentsNATS_CREDENTIALS_CONTENT=# Redis address (required)REDIS_ADDRS=localhost:6379
# Optional: Redis passwordREDIS_PASSWORD=Security
Section titled “Security”# JWT configuration (required)JWT_SECRET_KEY=your-secret-key-must-be-at-least-32-characters-longJWT_ACCESS_TOKEN_TTL=15mJWT_REFRESH_TOKEN_TTL=168h
# Encryption key for sensitive data (required, must be 32 characters)ENCRYPTION_KEY=your-encryption-key-must-be-32-chars!
# BCrypt cost for password hashingBCRYPT_COST=10Server Configuration
Section titled “Server Configuration”# API server hostZORI_API_HOST=http://localhost:1323
# Test server settingsTEST_SERVER_PORT=1324TEST_SERVER_HOST=localhost
# TimeoutsTEST_TIMEOUT=30sTEST_DB_TIMEOUT=5sApplication Mode
Section titled “Application Mode”# OSS mode: single-tenant, self-hosted# Set to true for self-hosted deploymentsZORI_IS_OSS=true
# Debug mode for ORM queries (0=off, 1=on)BUNDEBUG=0OSS vs Cloud Mode
Section titled “OSS vs Cloud Mode”| Setting | OSS Mode | Cloud Mode |
|---|---|---|
ZORI_IS_OSS | true | false |
| Auth | Your own implementation | Clerk integration |
| Stripe | Direct API key | Stripe App OAuth |
| Tenancy | Single tenant | Multi-tenant |
Feature Flags
Section titled “Feature Flags”# Email verification (requires email service setup)FEATURE_EMAIL_VERIFICATION=false
# Password recovery (requires email service setup)FEATURE_PASSWORD_RECOVERY=false
# Rate limitingFEATURE_RATE_LIMITING=trueObservability
Section titled “Observability”# Master switch for telemetryTELEMETRY_ENABLED=false
# Datadog integrationDATADOG_ENABLED=false
# OpenTelemetryOTEL_ENABLED=false
# Log level: debug, info, warn, errorLOG_LEVEL=infoStripe Configuration (Cloud Mode)
Section titled “Stripe Configuration (Cloud Mode)”These are only needed for Zori Cloud (multi-tenant) deployments:
# Stripe App credentialsZORI_STRIPE_APP=falseZORI_STRIPE_APP_SECRET_KEY=ZORI_STRIPE_APP_WEBHOOK_SECRET=Complete Example
Section titled “Complete Example”Here’s a complete production .env file:
# DatabaseCLICKHOUSE_URL=clickhouse.example.com:9000CLICKHOUSE_USERNAME=zoriCLICKHOUSE_PASSWORD=secretpasswordCLICKHOUSE_DATABASE=zori
# Message QueueNATS_STREAM_URL=nats://nats.example.com:4222REDIS_ADDRS=redis.example.com:6379REDIS_PASSWORD=redispassword
# Security (use generated values!)JWT_SECRET_KEY=generate-a-random-64-character-string-hereJWT_ACCESS_TOKEN_TTL=15mJWT_REFRESH_TOKEN_TTL=168hENCRYPTION_KEY=generate-random-32-char-string!!
# ServerZORI_API_HOST=https://api.yourdomain.comZORI_IS_OSS=true
# FeaturesFEATURE_RATE_LIMITING=true
# ObservabilityTELEMETRY_ENABLED=trueLOG_LEVEL=infoGenerating Secure Keys
Section titled “Generating Secure Keys”# Generate a random 64-character stringopenssl rand -hex 32
# Generate a 32-character encryption keyopenssl rand -base64 24Next Steps
Section titled “Next Steps”- Docker Setup - Containerized deployment
- Manual Setup - Build from source