Skip to main content

Environment Variable Reference

ClaraVerse uses a single .env file in the project root as the source of truth for all configuration. Docker Compose reads it automatically.

cp .env.example .env

Environment Mode​

VariableDefaultRequiredDescription
ENVIRONMENTdevelopmentNoSet to production for production deployments. Disables dev-only features like DEV_API_KEY.

Security (Required)​

These must be set before first start. Generate them with openssl:

echo "ENCRYPTION_MASTER_KEY=$(openssl rand -hex 32)" >> .env
echo "JWT_SECRET=$(openssl rand -hex 64)" >> .env
VariableDefaultRequiredDescription
ENCRYPTION_MASTER_KEY(empty)Yes256-bit hex key for AES-256-GCM encryption of user data (credentials, chat sync). Losing this key means losing access to all encrypted data.
JWT_SECRETchange_me_to_a_random_secret_at_least_32_charsYesSecret for signing JWT access and refresh tokens. Minimum 32 characters.

JWT Authentication​

VariableDefaultRequiredDescription
JWT_ACCESS_TOKEN_EXPIRY15mNoAccess token lifetime. Go duration format (e.g., 15m, 1h).
JWT_REFRESH_TOKEN_EXPIRY168hNoRefresh token lifetime. Default is 7 days.

Frontend Build Args​

These are baked into the frontend at Docker build time. If you change them, rebuild the frontend container.

VariableDefaultRequiredDescription
VITE_API_BASE_URLhttp://localhost:3001NoBackend API URL as seen by the browser. For production: https://api.yourdomain.com.
VITE_WS_URLws://localhost:3001NoWebSocket URL as seen by the browser. For production: wss://api.yourdomain.com.

Backend Configuration​

VariableDefaultRequiredDescription
ALLOWED_ORIGINShttp://localhost,http://localhost:5173,http://localhost:5174,http://localhost:3000,http://localhost:8080NoComma-separated CORS allowed origins. For production, set to your domain only.
FRONTEND_URLhttp://localhost:5173NoFrontend URL used by the backend for redirects and links.
BACKEND_URLhttp://localhost:3001NoBackend public URL used to generate absolute download URLs.
DEV_API_KEYclaraverse-dev-key-2024NoDevelopment-only API key for testing. Only works when ENVIRONMENT is not production. Note: This is a Docker-internal variable set automatically by docker-compose.yml. You do not need to add it to your .env file.

MySQL Database​

VariableDefaultRequiredDescription
MYSQL_ROOT_PASSWORDclaraverse_root_2024NoMySQL root password. Change for production.
MYSQL_PASSWORDclaraverse_pass_2024NoPassword for the claraverse_user MySQL account. Change for production.
DATABASE_URL(auto-generated from MYSQL_PASSWORD)NoFull MySQL connection string. Override to use an external MySQL instance. Note: This is a Docker-internal variable set automatically by docker-compose.yml. You do not need to add it to your .env file unless you are connecting to an external MySQL instance.

The Docker Compose file auto-creates the database claraverse and user claraverse_user on first start.

MongoDB​

VariableDefaultRequiredDescription
MONGODB_URImongodb://mongodb:27017/claraverseNoMongoDB connection string. For MongoDB Atlas: mongodb+srv://user:pass@cluster.mongodb.net/claraverse.

Redis​

VariableDefaultRequiredDescription
REDIS_URLredis://redis:6379NoRedis connection string. For Redis Cloud: redis://user:pass@host:6379.

Rate Limiting​

All values are requests per minute.

VariableDefaultRequiredDescription
RATE_LIMIT_GLOBAL_API200NoGlobal limit for all /api/* routes.
RATE_LIMIT_PUBLIC_READ120NoPublic read-only endpoints.
RATE_LIMIT_AUTHENTICATED60NoAuthenticated user requests.
RATE_LIMIT_WEBSOCKET20NoWebSocket connections per minute.
RATE_LIMIT_IMAGE_PROXY60NoImage proxy requests (prevents bandwidth abuse).

External Services​

SearXNG​

VariableDefaultRequiredDescription
SEARXNG_URLShttp://searxng:8080NoSearXNG instance URL(s). Comma-separated for load balancing.

E2B Code Execution​

VariableDefaultRequiredDescription
E2B_API_KEY(empty)NoE2B cloud API key. Get one at e2b.dev/dashboard. Required only if you enable the E2B service.

Composio Integrations​

All Composio variables are optional. Set them only if you use the corresponding integration.

VariableDefaultDescription
COMPOSIO_API_KEY(empty)Master API key from Composio.
COMPOSIO_GOOGLESHEETS_AUTH_CONFIG_ID(empty)Google Sheets OAuth config ID.
COMPOSIO_GMAIL_AUTH_CONFIG_ID(empty)Gmail OAuth config ID.
COMPOSIO_LINKEDIN_AUTH_CONFIG_ID(empty)LinkedIn OAuth config ID.
COMPOSIO_GOOGLECALENDAR_AUTH_CONFIG_ID(empty)Google Calendar OAuth config ID.
COMPOSIO_GOOGLEDRIVE_AUTH_CONFIG_ID(empty)Google Drive OAuth config ID.
COMPOSIO_CANVA_AUTH_CONFIG_ID(empty)Canva OAuth config ID.
COMPOSIO_TWITTER_AUTH_CONFIG_ID(empty)Twitter/X OAuth config ID.
COMPOSIO_YOUTUBE_AUTH_CONFIG_ID(empty)YouTube OAuth config ID.
COMPOSIO_ZOOM_AUTH_CONFIG_ID(empty)Zoom OAuth config ID.

Admin​

VariableDefaultRequiredDescription
SUPERADMIN_USER_IDS(empty)NoComma-separated MongoDB user IDs to grant superadmin role. The first registered user automatically becomes admin.

Production Checklist​

Before going to production, verify these settings:

# Required changes
ENVIRONMENT=production
ENCRYPTION_MASTER_KEY=<your-generated-key>
JWT_SECRET=<your-generated-secret>
MYSQL_ROOT_PASSWORD=<strong-password>
MYSQL_PASSWORD=<strong-password>

# Set to your actual domain
VITE_API_BASE_URL=https://api.yourdomain.com
VITE_WS_URL=wss://api.yourdomain.com
ALLOWED_ORIGINS=https://yourdomain.com
FRONTEND_URL=https://yourdomain.com
BACKEND_URL=https://api.yourdomain.com