Skip to main content

Example .env File

Complete .env file examples for minimal and full-featured deployments.

Minimal Configuration (Required Only)

This is the absolute minimum required to run Chatty AI:

#=================================================================
# MINIMAL CHATTY AI CONFIGURATION
# Only required variables - uses defaults for everything else
#=================================================================

#-----------------------------------------------------------------
# Domains (Required)
#-----------------------------------------------------------------
CHATTYAI_DOMAIN=chat.example.com
N8N_DOMAIN=n8n.example.com
DATABASES_DOMAIN=databases.example.com

#-----------------------------------------------------------------
# URLs (Required - must match domains)
#-----------------------------------------------------------------
CHATTYAI_URL=https://chat.example.com
N8N_URL=https://n8n.example.com
DATABASES_URL=https://databases.example.com

#-----------------------------------------------------------------
# Database (Required)
#-----------------------------------------------------------------
DB_PASSWORD=MyS3cur3P@ssw0rd!2024

#-----------------------------------------------------------------
# Security & API Keys (Required)
#-----------------------------------------------------------------
CHATTYAI_JWT_SECRET_KEY=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
CHATTYAI_API_KEY=sk-chattyai-1234567890abcdef
CHATTYAI_AI_API_KEY=sk-proj-your-openai-api-key-here

#-----------------------------------------------------------------
# Admin Account (Required)
#-----------------------------------------------------------------
CHATTYAI_ADMIN_EMAIL=admin@company.com
CHATTYAI_ADMIN_NAME=Admin
CHATTYAI_ADMIN_PASSWORD=AdminPassword123!

Generate secrets:

# JWT Secret
openssl rand -hex 32

# API Key
echo "sk-chattyai-$(openssl rand -hex 16)"

# Database Password
openssl rand -base64 32

Full Configuration (All Options)

This includes all available variables with recommended values:

#=================================================================
# CHATTY AI - COMPLETE CONFIGURATION
# Full-featured deployment with all options
#=================================================================

#-----------------------------------------------------------------
# Domains & URLs (Required)
#-----------------------------------------------------------------
CHATTYAI_DOMAIN=chat.example.com
N8N_DOMAIN=n8n.example.com
DATABASES_DOMAIN=databases.example.com

CHATTYAI_URL=https://chat.example.com
N8N_URL=https://n8n.example.com
DATABASES_URL=https://databases.example.com

#-----------------------------------------------------------------
# Database Configuration (Required)
#-----------------------------------------------------------------
DB_USER=chattyAdmin
DB_NAME=chattydb
DB_PASSWORD=MyS3cur3P@ssw0rd!2024
# DB_PORT=5432 # Uncomment for external access (not recommended)

#-----------------------------------------------------------------
# Security & Authentication (Required)
#-----------------------------------------------------------------
CHATTYAI_JWT_SECRET_KEY=a1b2c3d4e5f6g7h8i9j0k1l2m3n4o5p6q7r8s9t0u1v2w3x4y5z6
CHATTYAI_API_KEY=sk-chattyai-1234567890abcdef
CHATTYAI_AI_API_KEY=sk-proj-your-openai-api-key-here

#-----------------------------------------------------------------
# Admin Account (Required)
#-----------------------------------------------------------------
CHATTYAI_ADMIN_EMAIL=admin@company.com
CHATTYAI_ADMIN_NAME=Admin
CHATTYAI_ADMIN_PASSWORD=AdminPassword123!

#-----------------------------------------------------------------
# LLM API Configuration
#-----------------------------------------------------------------
CHATTYAI_AI_API_BASE_URL=https://llm.chatty-ai.ai
ENABLE_OLLAMA_API=false

#-----------------------------------------------------------------
# Application Settings
#-----------------------------------------------------------------
CHATTYAI_NAME=Chatty AI
ENABLE_API_KEYS=true
MAX_USERS=0

#-----------------------------------------------------------------
# Microsoft SSO (Optional)
#-----------------------------------------------------------------
# MICROSOFT_CLIENT_ID=12345678-1234-1234-1234-123456789012
# MICROSOFT_CLIENT_SECRET=abc123~XYZ...
# MICROSOFT_CLIENT_TENANT_ID=common
# MICROSOFT_OAUTH_SCOPE=openid email profile
# MICROSOFT_REDIRECT_URI=https://chat.example.com/oauth/microsoft/callback

#-----------------------------------------------------------------
# LDAP Authentication (Optional)
#-----------------------------------------------------------------
# LDAP_SERVER_URL=ldaps://ldap.company.com:636
# LDAP_BIND_DN=cn=chatty-service,dc=company,dc=com
# LDAP_BIND_PASSWORD=ldap-service-password
# LDAP_USER_BASE=ou=users,dc=company,dc=com
# LDAP_SEARCH_FILTER=(uid={0})

#-----------------------------------------------------------------
# n8n Workflow Automation
#-----------------------------------------------------------------
N8N_ENABLED=true
N8N_API_KEY=${CHATTYAI_API_KEY}
N8N_USER_MANAGEMENT_DISABLED=true
N8N_SECURE_COOKIE=true
N8N_DIAGNOSTICS_ENABLED=false
N8N_PERSONALIZATION_ENABLED=false

#-----------------------------------------------------------------
# RAG Configuration
#-----------------------------------------------------------------
RAG_TOP_K=20
RAG_TOP_K_RERANKER=5
RAG_RELEVANCE_THRESHOLD=0
ENABLE_RAG_HYBRID_SEARCH=true
RAG_EMBEDDING_MODEL=text-embedding-3-large
CHUNK_SIZE=512
CHUNK_OVERLAP=100

#-----------------------------------------------------------------
# Qdrant Vector Database
#-----------------------------------------------------------------
ENABLE_QDRANT_MULTITENANCY_MODE=true
QDRANT_HNSW_M=48
QDRANT_HNSW_EF_CONSTRUCT=100

#-----------------------------------------------------------------
# File Storage
#-----------------------------------------------------------------
FILE_KEEP_SOURCE=true
FILE_RETENTION_DAYS=14

#-----------------------------------------------------------------
# Web Search
#-----------------------------------------------------------------
ENABLE_DEFAULT_WEBSEARCH_TOOL=true
DEFAULT_WEBSEARCH_TOOL_ID=web_search
DEFAULT_WEBSEARCH_MODEL=chattyAI-search-model

#-----------------------------------------------------------------
# Databases
#-----------------------------------------------------------------
ENABLE_DATABASES=true
DATABASES_GENERATION_MODEL=gpt-4o-mini

#-----------------------------------------------------------------
# ChattyAI App Servers (MS365 & Jira)
# ⚠️ WARNING: MS365 credentials are vendor-managed in Portainer
# DO NOT set these manually in Portainer deployments
#-----------------------------------------------------------------
CHATTY_APP_SHOW_APPS=true
CHATTY_APP_AUTO_CONNECT_ON_STARTUP=false

# For Docker Compose only (use your own Azure App Registration):
# CHATTY_APP_MS365_OAUTH_CLIENT_ID=your-client-id
# CHATTY_APP_MS365_OAUTH_CLIENT_SECRET=your-client-secret
# CHATTY_APP_MS365_OAUTH_TENANT_ID=common

#-----------------------------------------------------------------
# Docker Image Versions
#-----------------------------------------------------------------
CHATTYAI_VERSION=arm64
PIPELINES_VERSION=amd64
DATABASES_VERSION=amd64
DATABASES_AI_VERSION=arm64
N8N_VERSION=amd64

#-----------------------------------------------------------------
# Port Configuration (for IP-based deployments)
#-----------------------------------------------------------------
# CHATTYAI_PORT=3000
# N8N_PORT=5678
# DATABASES_PORT=8000

#-----------------------------------------------------------------
# SSL Certificates (Portainer - custom paths)
#-----------------------------------------------------------------
# CHATTYAI_SSL_CERT=/etc/nginx/certs/chattyai/fullchain.pem
# CHATTYAI_SSL_KEY=/etc/nginx/certs/chattyai/privkey.pem
# N8N_SSL_CERT=/etc/nginx/certs/n8n/fullchain.pem
# N8N_SSL_KEY=/etc/nginx/certs/n8n/privkey.pem
# DATABASES_SSL_CERT=/etc/nginx/certs/databases/fullchain.pem
# DATABASES_SSL_KEY=/etc/nginx/certs/databases/privkey.pem

#-----------------------------------------------------------------
# Advanced Settings
#-----------------------------------------------------------------
NODE_MAX_MEMORY=8192
CORS_ALLOW_ORIGIN=*

#=================================================================
# END OF CONFIGURATION
#=================================================================

Production Configuration

Recommended settings for production:

#=================================================================
# PRODUCTION CONFIGURATION
# Secure settings for production deployment
#=================================================================

#-----------------------------------------------------------------
# Domains & URLs
#-----------------------------------------------------------------
CHATTYAI_DOMAIN=chat.company.com
N8N_DOMAIN=n8n.company.com
DATABASES_DOMAIN=databases.company.com

CHATTYAI_URL=https://chat.company.com
N8N_URL=https://n8n.company.com
DATABASES_URL=https://databases.company.com

#-----------------------------------------------------------------
# Database (Strong Password)
#-----------------------------------------------------------------
DB_PASSWORD=$(openssl rand -base64 32)

#-----------------------------------------------------------------
# Security (Generated Secrets)
#-----------------------------------------------------------------
CHATTYAI_JWT_SECRET_KEY=$(openssl rand -hex 32)
CHATTYAI_API_KEY=sk-chattyai-$(openssl rand -hex 16)
CHATTYAI_AI_API_KEY=sk-proj-your-production-api-key

#-----------------------------------------------------------------
# Admin Account
#-----------------------------------------------------------------
CHATTYAI_ADMIN_EMAIL=admin@company.com
CHATTYAI_ADMIN_NAME=Administrator
CHATTYAI_ADMIN_PASSWORD=$(openssl rand -base64 24)

#-----------------------------------------------------------------
# Microsoft SSO (Recommended for Production)
#-----------------------------------------------------------------
MICROSOFT_CLIENT_ID=12345678-1234-1234-1234-123456789012
MICROSOFT_CLIENT_SECRET=abc123~XYZ...
MICROSOFT_CLIENT_TENANT_ID=87654321-4321-4321-4321-210987654321
MICROSOFT_REDIRECT_URI=https://chat.company.com/oauth/microsoft/callback

#-----------------------------------------------------------------
# Security Settings
#-----------------------------------------------------------------
CORS_ALLOW_ORIGIN=https://chat.company.com
N8N_SECURE_COOKIE=true
ENABLE_API_KEYS=true

#-----------------------------------------------------------------
# Performance Tuning
#-----------------------------------------------------------------
NODE_MAX_MEMORY=16384
RAG_TOP_K=20
QDRANT_HNSW_M=64

Development Configuration

Settings for local development:

#=================================================================
# DEVELOPMENT CONFIGURATION
# For local testing and development
#=================================================================

#-----------------------------------------------------------------
# Local Domains (using IPs)
#-----------------------------------------------------------------
CHATTYAI_DOMAIN=192.168.1.100
N8N_DOMAIN=192.168.1.100
DATABASES_DOMAIN=192.168.1.100

CHATTYAI_URL=http://192.168.1.100:3000
N8N_URL=http://192.168.1.100:5678
DATABASES_URL=http://192.168.1.100:8000

#-----------------------------------------------------------------
# Ports
#-----------------------------------------------------------------
CHATTYAI_PORT=3000
N8N_PORT=5678
DATABASES_PORT=8000

#-----------------------------------------------------------------
# Simple Passwords (dev only!)
#-----------------------------------------------------------------
DB_PASSWORD=devpassword
CHATTYAI_JWT_SECRET_KEY=dev-jwt-secret-key-not-for-production
CHATTYAI_API_KEY=sk-chattyai-dev123
CHATTYAI_AI_API_KEY=sk-proj-dev-api-key

#-----------------------------------------------------------------
# Admin
#-----------------------------------------------------------------
CHATTYAI_ADMIN_EMAIL=admin@localhost
CHATTYAI_ADMIN_NAME=Dev Admin
CHATTYAI_ADMIN_PASSWORD=admin123

#-----------------------------------------------------------------
# Development Settings
#-----------------------------------------------------------------
CORS_ALLOW_ORIGIN=*
N8N_SECURE_COOKIE=false
N8N_DIAGNOSTICS_ENABLED=true

Configuration Checklist

Before Deployment

  • All required variables set
  • Secrets generated (not using example values)
  • Strong passwords (16+ characters)
  • Domains configured correctly
  • URLs match domains
  • SSL certificates prepared
  • DNS records pointing to server

Security Checklist

  • JWT secret is 32+ characters
  • Database password is strong
  • API keys are unique
  • Admin password is strong
  • CORS_ALLOW_ORIGIN not * in production
  • SSL certificates valid
  • Secrets not committed to git

Optional Features

  • Microsoft SSO configured (if needed)
  • LDAP configured (if needed)
  • Custom image versions (if needed)
  • Performance tuning (if needed)