Skip to content

Configuration

Glean is configured through environment variables. Create a .env file:

Terminal window
# Download example configuration
curl -fsSL https://raw.githubusercontent.com/LeslieLeung/glean/main/.env.example -o .env
# Edit configuration
nano .env
VariableRequiredDefaultDescription
SECRET_KEYYes-JWT signing key, at least 32 characters
DEBUGNofalseDebug mode, must be disabled in production
VariableRequiredDefaultDescription
POSTGRES_DBNogleanDatabase name
POSTGRES_USERNogleanDatabase username
POSTGRES_PASSWORDYesgleanDatabase password
VariableDefaultDescription
WEB_PORT80Web application port
ADMIN_PORT3001Admin dashboard port

Auto-create admin account on first startup:

VariableDefaultDescription
CREATE_ADMINfalseWhether to auto-create admin
ADMIN_USERNAMEadminAdmin username
ADMIN_PASSWORD-Admin password (required if enabled)
ADMIN_ROLEsuper_adminAdmin role

Example configuration:

Terminal window
CREATE_ADMIN=true
ADMIN_USERNAME=admin
ADMIN_PASSWORD=MySecurePass123!
VariableDefaultDescription
LOG_LEVELINFOLog level (DEBUG/INFO/WARNING/ERROR)
LOG_FILE/app/logs/glean-api.logLog file path
LOG_ROTATION100 MBLog rotation size
LOG_RETENTION30 daysLog retention period
LOG_COMPRESSIONgzLog compression format

Milvus configuration for full deployment mode:

VariableDefaultDescription
MILVUS_HOSTmilvusMilvus service host
MILVUS_PORT19530Milvus service port
MILVUS_USER-Milvus username (if auth enabled)
MILVUS_PASSWORD-Milvus password (if auth enabled)

Vector embedding configuration for smart recommendations:

VariableDefaultDescription
EMBEDDING_PROVIDERsentence-transformersEmbedding provider
EMBEDDING_MODELall-MiniLM-L6-v2Model name
EMBEDDING_DIMENSION384Vector dimension (must match model)
EMBEDDING_API_KEY-API key (OpenAI/Volcengine)
EMBEDDING_BASE_URL-Custom API endpoint
EMBEDDING_BATCH_SIZE20Batch processing size
EMBEDDING_TIMEOUT30Request timeout (seconds)

sentence-transformers (local, default):

Terminal window
EMBEDDING_PROVIDER=sentence-transformers
EMBEDDING_MODEL=all-MiniLM-L6-v2
EMBEDDING_DIMENSION=384

OpenAI:

Terminal window
EMBEDDING_PROVIDER=openai
EMBEDDING_MODEL=text-embedding-3-small
EMBEDDING_DIMENSION=1536
EMBEDDING_API_KEY=sk-xxx

Volcengine:

Terminal window
EMBEDDING_PROVIDER=volc-engine
EMBEDDING_MODEL=doubao-embedding
EMBEDDING_DIMENSION=1024
EMBEDDING_API_KEY=your-api-key
Terminal window
# Security
SECRET_KEY=your-long-random-secret-key-at-least-32-chars
DEBUG=false
# Database
POSTGRES_PASSWORD=your-secure-database-password
# Ports
WEB_PORT=80
ADMIN_PORT=3001
# Admin (first startup)
CREATE_ADMIN=true
ADMIN_USERNAME=admin
ADMIN_PASSWORD=YourSecurePassword123!
# Logging
LOG_LEVEL=INFO
# Embedding (using OpenAI)
EMBEDDING_PROVIDER=openai
EMBEDDING_MODEL=text-embedding-3-small
EMBEDDING_DIMENSION=1536
EMBEDDING_API_KEY=sk-xxx

Restart services after modifying configuration:

Terminal window
# Restart all services
docker compose down
docker compose up -d
# Or restart specific services only
docker compose restart backend worker
Terminal window
# Check service status
docker compose ps
# View backend logs
docker compose logs backend
# Check health status
curl http://localhost/api/health