.env.example to .env and configure the variables below.
Server Configuration
Server hostname
Server port number
MongoDB connection string
Client-facing domain URL
Server-facing domain URL
MongoDB Connection Pool
Maximum number of connections in the connection pool
Minimum number of connections in the connection pool
Maximum connections being established concurrently
Maximum time a connection can remain idle before being closed (milliseconds)
Enable automatic index creation for all models. Set to false to disable
Security & Authentication
Secret key for JWT token generation
Secret key for JWT refresh tokens
Encryption key for credential storage
Initialization vector for credential encryption
Session expiration time in milliseconds (default: 15 minutes)
Refresh token expiration time in milliseconds (default: 7 days)
Minimum password length for user authentication
Set to 1 when using LDAP to bypass local password validation
Logging & Debugging
Enable debug-level logging
Enable console debug output
Use JSON format for console logs (recommended for cloud deployments like GCP/AWS)
Enable memory diagnostics (logs heap/RSS snapshots every 60s, auto-enabled with —inspect)
Node.js Configuration
Node.js command-line options
Node.js heap size in MB (used as Docker build argument, not recognized by Node.js directly)
To configure Node.js memory, use NODE_OPTIONS instead
Configuration File
Path to librechat.yaml configuration file (absolute, relative, or URL)
Search Configuration
Enable MeiliSearch integration
MeiliSearch server host
MeiliSearch master key
Disable MeiliSearch analytics
Disable indexing (useful in multi-node setup where only one instance performs index sync)
User Registration & Login
Enable email/password login
Enable user registration
Enable social login (OAuth)
Enable registration via social providers
Enable password reset functionality
Allow login with unverified email addresses
Allow users to delete their accounts
Rate Limiting & Moderation
Enable automatic banning based on violation scores
Ban duration in milliseconds (default: 2 hours)
Number of violations before ban
Violation Scores
Violation score for failed login attempts
Violation score for registration attempts
Violation score for message rate limit violations
Violation score for non-browser requests
Rate Limits
Maximum login attempts per window
Login rate limit window in minutes
Maximum registration attempts per window
Registration rate limit window in minutes
Enable concurrent message limiting
Maximum concurrent messages per user
Maximum messages per IP per window
Message IP rate limit window in minutes
OpenAI Moderation
Enable OpenAI content moderation
OpenAI API key for moderation endpoint
Custom reverse proxy for OpenAI moderation API
Redis Configuration
Enable Redis for caching and session storage
Enable Redis for resumable LLM streams (defaults to USE_REDIS value)
Set to false to use in-memory storage for streams while keeping Redis for other caches
Redis connection URI
Redis authentication username
Redis authentication password
Static prefix for Redis keys
Environment variable name for dynamic Redis key prefix (recommended for cloud deployments)
Redis ping interval in seconds (0 = disabled)
When set to a positive integer, Redis clients ping the server to keep connections alive
UI Configuration
Application title displayed in browser
Custom footer text
URL for help and FAQ link
Google Tag Manager ID for analytics
Proxy & Network
HTTP proxy for API requests
Number of hops from Express application to trust for client IP
- 0 = req.socket.remoteAddress (no reverse proxy)
- 1 = first hop in X-Forwarded-For header
Add noindex meta tag to prevent search engine indexing
Langfuse Tracing
Langfuse public API key for tracing
Langfuse secret API key
Langfuse API base URL
Error Handling
Continue running after uncaught exceptions