Basic Redis Configuration
Redis connection URL in standard format.Format:
redis://[username][:password]@host:port[/db_number]Examples:redis://localhost:6379redis://redis:6379(Docker)redis://:password@localhost:6379redis://:password@host:6379/0
redis://127.0.0.1:6379See IANA Redis URI SchemeRedis authentication password.Note: Can be included in
REDIS_URL or specified separately.Security: Always set a password for production Redis instances.Redis Sentinel Configuration
Redis Sentinel provides high availability through automatic failover. Configure these variables to use Redis Sentinel.Comma-separated list of Redis Sentinel hosts and ports.Format:
host1:port1,host2:port2,host3:port3Example: sentinel1.example.com:26379,sentinel2.example.com:26379,sentinel3.example.com:26379Note: When this is set, Chatwoot automatically switches to Sentinel mode.Name of the Redis Sentinel master.Default:
mymasterNote: Find available masters using the SENTINEL masters command on any Sentinel instance.Password for Redis Sentinel authentication.Default behavior: If not set, Chatwoot uses
REDIS_PASSWORD for Sentinel authentication.Special value: Use empty string "" if Sentinels are configured without passwords.Sentinel Configuration Example
SSL/TLS Configuration
OpenSSL verification mode for Redis connections.Options:
peer- Verify the server certificate (default, recommended)none- Skip certificate verification
peerUse case: Set to none if experiencing Redis connection issues with some cloud providers (e.g., Heroku Redis Premium). See GitHub Issue #2420SSL Example
Use
rediss:// (with double ‘s’) for SSL/TLS connections.Connection Pool Configuration
Chatwoot uses connection pooling to efficiently manage Redis connections across multiple features.Connection pool size for Alfred (Round Robin, Conversation Emails, Online Presence).Default:
5Tuning: Increase if you have many concurrent users or high message volume.Connection pool size for Velma (Rack Attack rate limiting).Default:
10Tuning: Increase if experiencing rate limiting bottlenecks under high traffic.Connection Pool Configuration Example
Redis Namespaces
Chatwoot uses Redis namespaces to organize data:- alfred - Round robin, conversation emails, online presence
- velma - Rack Attack rate limiting
- sidekiq - Background job queue
- cache - Application caching
Redis Database Selection
Redis supports multiple databases (numbered 0-15 by default). You can specify the database in the connection URL:Using different database numbers is useful for running multiple Chatwoot instances on the same Redis server.
Redis Version Requirements
Chatwoot requires Redis 6.0 or higher. Recommended version: Redis 7.0+Deployment Scenarios
Single Server Deployment
Simplest configuration for small to medium deployments:Docker Compose
The hostname
redis matches the service name in docker-compose.yml.Kubernetes with Redis Sentinel
High availability configuration:Managed Redis Services
AWS ElastiCache
Azure Cache for Redis
Google Cloud Memorystore
Heroku Redis
DigitalOcean Managed Redis
Performance Tuning
Connection Pool Sizing
Calculate appropriate pool sizes based on your deployment: Alfred pool size:Redis Server Configuration
Recommended Redis server settings for production:Monitoring Redis
Key metrics to monitor:- Connected clients: Should not exceed
maxclients - Memory usage: Should stay below
maxmemory - Keyspace hits/misses: High miss rate indicates cache issues
- Command latency: Should be < 1ms for most commands
Troubleshooting
Connection refused errors
Symptoms:Error connecting to Redis on localhost:6379 (Errno::ECONNREFUSED)
Solutions:
- Verify Redis is running:
redis-cli ping - Check Redis is listening on the correct port
- Verify firewall rules allow connections
- Check
REDIS_URLis correct
Authentication errors
Symptoms:NOAUTH Authentication required
Solutions:
- Verify
REDIS_PASSWORDis set correctly - Check password in
REDIS_URLmatches Redis configuration - For Sentinel, ensure
REDIS_SENTINEL_PASSWORDis configured
SSL/TLS errors
Symptoms:OpenSSL::SSL::SSLError
Solutions:
- Try setting
REDIS_OPENSSL_VERIFY_MODE=none(temporary) - Verify using
rediss://in URL for SSL connections - Check Redis server SSL certificate is valid
- Update OpenSSL libraries
Timeout errors
Symptoms:Redis::TimeoutError
Solutions:
- Increase connection pool sizes
- Check Redis server performance and memory
- Verify network latency between app and Redis
- Consider using Redis Sentinel for high availability
Memory issues
Symptoms:OOM command not allowed when used memory > 'maxmemory'
Solutions:
- Increase Redis
maxmemorysetting - Configure eviction policy:
maxmemory-policy allkeys-lru - Clear unused keys
- Monitor memory usage:
redis-cli INFO memory
Sentinel connection issues
Symptoms: Cannot connect to Redis master via Sentinel Solutions:- Verify all Sentinel nodes are accessible
- Check
REDIS_SENTINEL_MASTER_NAMEmatches actual master name - Run
SENTINEL mastersto see available masters - Verify Sentinel passwords if authentication is enabled
Security Best Practices
- Always set a password: Use
REDIS_PASSWORDin production - Use SSL/TLS: Connect via
rediss://for encrypted connections - Network isolation: Run Redis in a private network, not exposed to internet
- Firewall rules: Only allow connections from Chatwoot servers
- Regular updates: Keep Redis updated to latest stable version
- Disable dangerous commands: Use
rename-commandin redis.conf for FLUSHDB, FLUSHALL, etc.
Related Configuration
- Environment Variables - Complete environment variable reference
- PostgreSQL Configuration - Database configuration
- Email Setup - Email configuration

