Environment Variables
A comprehensive list of all .env configurations required to operate the Data Explorer ecosystem.
How to read this env reference
Data Explorer currently exposes two important env references in the repo: the root `.env.example` for a Docker-friendly full-system view, and `server/.env.example` for the direct backend runtime view. The tables below combine those perspectives so you do not have to jump between multiple files when configuring local, staging, or production environments.
Practical note: the code fallback and the example env files currently both use 90000ms. If you want local/dev to fail faster while debugging, lower the value explicitly for your setup.
Keep the two AI configuration layers separate: `server/.env` configures built-in backend lanes, while custom OpenAI-compatible providers and per-role model choices (`Assistant`, `Explain`, `AI SQL`, `AI NoSQL`, `Autocomplete`) are stored locally inside `Configure AI` on each client machine.
Infrastructure
| Variable | Description | Example |
|---|---|---|
| PORT | Backend server port (default 3001) | 3001 |
| NODE_ENV | App environment | development | production |
| REDIS_URL | Redis connection URL for caching, presence, notification, queue, and search flows | redis://localhost:6379 |
Security & Admin
| Variable | Description | Example |
|---|---|---|
| JWT_SECRET | Strong secret for access-token signing; weak placeholder values are rejected by the backend | replace-with-a-random-secret-at-least-32-bytes-long |
| REFRESH_TOKEN_SECRET | Separate secret for refresh tokens; if omitted the app may fall back to JWT_SECRET | another-very-long-secret |
| ENCRYPTION_KEY | Exactly 32 characters for encrypting saved connection passwords (AES-256) | 12345678901234567890123456789012 |
| LEGACY_ENCRYPTION_KEYS | Legacy keys used to read connection data encrypted by older versions | |
| ALLOW_INTERNAL_IPS | Allow connections to internal IPs / localhost; defaults to false to reduce SSRF risk | true | false |
| ADMIN_EMAIL | Initial email for the first admin account | admin@example.com |
| ADMIN_PASSWORD | Initial admin password | strong-password |
Metastore & Internal URLs
| Variable | Description | Example |
|---|---|---|
| DATABASE_URL | Connection URL for the app metadata PostgreSQL store | postgresql://postgres:postgres@localhost:5435/data_explorer |
| FRONTEND_URL | Real frontend origin used for CORS, cookies, and redirect flows | http://localhost:5173 |
| API_PUBLIC_URL | Public API base URL currently used by billing return / webhook flows | http://localhost:3001/api |
| ALLOW_INSECURE_DATABASE_TLS | Set to 'false' to enforce TLS certificate verification on every remote database connection (Postgres, MySQL/MariaDB, CockroachDB, Redis, ClickHouse, MSSQL). Defaults to accepting self-signed certificates for easier development. | false |
| VITE_API_URL | API base URL the Vite frontend should call | http://localhost:3001/api |
AI Providers & LLM
| Variable | Description | Example |
|---|---|---|
| GEMINI_API_KEY | Google Gemini key for the higher-quality and vision lane | AIzaSy... |
| AI_PROVIDER_TIMEOUT_MS | Overall timeout for provider requests. The code fallback and the repo example files are both set to 90000ms right now | 90000 |
| AI_STREAM_IDLE_TIMEOUT_MS | Timeout for stalled streams. If omitted, the service falls back to AI_PROVIDER_TIMEOUT_MS; the current default is also 90000ms | 90000 |
| CEREBRAS_API_KEY | Cerebras key for a lower-cost lane | cbr-... |
| CEREBRAS_BASE_URL | Base URL for the Cerebras OpenAI-compatible endpoint | https://api.cerebras.ai/v1 |
| CEREBRAS_CHAT_MODEL | Default model for the Cerebras lane | llama3.1-8b |
| OPENROUTER_API_KEY | OpenRouter key for the default auto chain, multi-model fallback, and some vision or web-backed search lanes depending on the chosen model | sk-or-... |
| OPENROUTER_BASE_URL | Base URL for OpenRouter | https://openrouter.ai/api/v1 |
| OPENROUTER_CHAT_MODEL | Default model for the OpenRouter lane | |
| GROQ_API_KEY | Groq key for the low-latency lane | gsk-... |
| GROQ_BASE_URL | Base URL for the Groq OpenAI-compatible endpoint | https://api.groq.com/openai/v1 |
| GROQ_CHAT_MODEL | Default model for the Groq lane | openai/gpt-oss-120b |
| BEEKNOEE_API_KEY | Beeknoee key that enables explicit provider routing from the model catalog | sk-bee-... |
| BEEKNOEE_BASE_URL | Base URL for the Beeknoee API | https://platform.beeknoee.com/api/v1 |
| BEEKNOEE_CHAT_MODEL | Default Beeknoee fallback model when no explicit model is locked | glm-4.7-flash |
Social Login (OAuth)
| Variable | Description | Example |
|---|---|---|
| GOOGLE_CLIENT_ID | Google OAuth Client ID | xxx.apps.googleusercontent.com |
| GOOGLE_CLIENT_SECRET | Google OAuth Client Secret | GOCSPX-... |
| GOOGLE_CALLBACK_URL | Google callback URL pointing to the real backend | http://localhost:3001/api/auth/google/callback |
| GITHUB_CLIENT_ID | GitHub OAuth Client ID | Ov23... |
| GITHUB_CLIENT_SECRET | GitHub OAuth Client Secret | git-... |
| GITHUB_CALLBACK_URL | GitHub callback URL pointing to the real backend | http://localhost:3001/api/auth/github/callback |
Email (Brevo/Auth)
| Variable | Description | Example |
|---|---|---|
| MAIL_USER | Sender email used by the Brevo REST API and auth notifications | your-email@gmail.com |
| MAIL_PASS | Brevo API key or mail service key; if missing, the app logs emails to the console | xkeysib-... |
Billing providers
| Variable | Description | Example |
|---|---|---|
| MOMO_PARTNER_CODE | Partner code for MoMo checkout | |
| MOMO_ACCESS_KEY | Access key for MoMo | |
| MOMO_SECRET_KEY | Secret key for MoMo signatures | |
| MOMO_CREATE_URL | MoMo payment creation endpoint (use the sandbox URL locally) | https://test-payment.momo.vn/v2/gateway/api/create |
| ZALOPAY_APP_ID | App ID for ZaloPay | |
| ZALOPAY_KEY1 | Primary signing key for ZaloPay | |
| ZALOPAY_KEY2 | Secondary verification key for ZaloPay | |
| ZALOPAY_CREATE_URL | Sandbox payment creation endpoint for ZaloPay | https://sb-openapi.zalopay.vn/v2/create |
Ready to explore data?
Join the community on GitHub to contribute to the smartest local database IDE.
Launch App