Configuration Reference
Grengin reads its server settings from one environment file at startup. Edit it, then restart.
AWS & self-hosted only
- Install script
~/.grengin/config.env→grengin restart.grengin configurechanges the database and callback address;grengin configshows the file. - AWS image
/etc/grengin/.env→sudo systemctl restart grengin - Keep it private It holds secrets; keep a copy with every backup
Note AI keys and models are managed only in Control Hub → AI Engines. Sign-in providers are seeded from this file, then managed in Control Hub.
On the install script, lines look like export NAME=value.
Core
Required
| Variable | Description |
|---|---|
DATABASE_URL | PostgreSQL URL, e.g. postgres://grengin:<password>@127.0.0.1:5432/grengin |
JWT_SECRET | Signs sign-in tokens. 64 hex chars. Changing it signs everyone out. |
APP_KEY | Base64 32-byte key encrypting stored credentials (provider keys, SSO secrets). Changing it makes them unreadable. |
REDIRECT_URL | The address people open Grengin at, e.g. https://chat.example.com. Sign-in callbacks build on it. |
Server
| Variable | Default | Description |
|---|---|---|
HOST | 0.0.0.0 (install script: 127.0.0.1) | API listen address |
PORT | 8080 | API port; the web app reaches it at /api |
GRENGIN_WEB_PORT | 3000 | Install script only: web app port |
File storage
| Variable | Set it to | Description |
|---|---|---|
FILE_STORAGE_ROOT | AWS image: /var/lib/grengin/files | Where uploads are stored |
Sign-in
OAuth providers
Empty turns a provider off. After first start, manage them in Authentication (SSO).
| Variable | Description |
|---|---|
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRET | Google OAuth client ID and secret |
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRET | Microsoft Entra ID tenant ID, application (client) ID and secret |
Callbacks: <REDIRECT_URL>/auth/google/callback, <REDIRECT_URL>/auth/azure/callback.
Sign-in policy
Set allowed domains and auto-provisioning in Authentication (SSO) after setup.
AI
AI provider keys aren’t set here: add them in AI Engines.
RAG
| Variable | Default | Description |
|---|---|---|
RAG_ENABLED | true | Retrieval-augmented generation on/off |
RAG_RECENT_MESSAGE_PAIRS | 3 | Recent message pairs in context (min 1) |
RAG_RETRIEVAL_TOP_K | 4 | Earlier messages retrieved per request (min 1) |
RAG_MAX_CONTEXT_TOKENS | 8000 | Token budget for retrieved context (min 256) |
RAG_EMBEDDING_ENABLED | false | Embeddings for semantic search |
RAG_EMBEDDING_LLM_PROVIDER | openai | Embedding provider |
RAG_EMBEDDING_LLM_MODEL | text-embedding-3-small | Embedding model |
RAG_SUMMARY_LLM_PROVIDER | openai | Conversation summary provider |
RAG_SUMMARY_LLM_MODEL | gpt-5.4-mini | Summary model |
The providers named here need a key in AI Engines.
Advanced
Optional API settings
Not written by the installer; the API reads them if added.
| Variable | Default | Description |
|---|---|---|
GRENGIN_AUTO_MIGRATE | true | Run pending migrations at startup |
TRUSTED_PROXIES | loopback | Proxy addresses or ranges whose forwarded client IP is trusted. none trusts none. |
CORS_ALLOWED_ORIGINS | REDIRECT_URL | Browser origins allowed to call the API |
AUDIT_LOG_RETENTION_DAYS | Days to keep audit log entries |
AWS installs only
Written by the AWS setup wizard; don’t add them yourself.
| Variable | Description |
|---|---|
SSO_PROXY_AUTO_ENABLE, SSO_PROXY_ENABLED, SSO_PROXY_URL | Grengin’s built-in sign-in, for grengin.com workspaces only. Leave unset and use your own SSO app |
JARVIS_SUBDOMAIN | Free ongrengin.com subdomain |
AWS installer overrides
For the AWS setup wizard. Set them with sudo systemctl edit grengin-installer before it starts. (The install script has its own: see Install.)
| Variable | Default | Description |
|---|---|---|
GRENGIN_LOCAL_TEST_URL | Local test address, e.g. http://localhost:8080 (localhost or *.localhost only). Connecting becomes optional, domain skippable. Never on a public server. Details → | |
GRENGIN_SERVICE_URL | https://service.grengin.com | Pairing and free-subdomain service. Alias JARVIS_WORKER_URL. |
GRENGIN_STATE_DIR | /etc/grengin | Identity and connection files |
GRENGIN_INSTANCE_NAME | Grengin instance | Name shown on grengin.com |
GRENGIN_CLOUD_PROVIDER | auto-detect | aws or azure; skips cloud detection for the free subdomain |
GRENGIN_RELEASE_BASE_URL | Release base (<base>/api/<version>/<arch>/grengin-api, <base>/webapp/<version>/webapp-dist.tar.gz). Alias RELEASE_BASE_URL. | |
GRENGIN_RELEASE_VERSION | latest | Release, e.g. v0.9.6. Alias GRENGIN_VERSION. |
GRENGIN_API_BINARY_URL, GRENGIN_WEBAPP_URL | Direct API binary / web app archive URL, overriding the release layout | |
GRENGIN_LOCAL_API_BINARY | Local API binary instead of downloading | |
GRENGIN_LOCAL_WEBAPP_ARCHIVE | Local web app .tar.gz | |
GRENGIN_LOCAL_WEBAPP_DIR | Local web app build directory (with index.html) | |
GRENGIN_PREFER_LOCAL_ARTIFACTS | false | Reuse installed API and web app. AWS image: true. |
File locations
Install script: everything is in ~/.grengin: config.env (settings), current/ (the release), logs/. The command is ~/.local/bin/grengin.
AWS image:
| Path | Contents |
|---|---|
/etc/grengin/.env | Configuration (this page) |
/etc/grengin/ | Also connection files and, on AWS, the subdomain token |
/opt/grengin/grengin-api | API binary |
/opt/grengin/scripts/ | update-app-binaries.sh, reconfigure-domain.sh |
/var/www/grengin/ | Web app files |
/etc/systemd/system/grengin.service | API service unit |
/etc/nginx/conf.d/grengin.conf (RHEL) or /etc/nginx/sites-available/grengin.conf (Debian) | Nginx site |
/etc/letsencrypt/live/<domain>/ | TLS certificate, with Let’s Encrypt |
/var/log/grengin/ | Logs |
/var/lib/grengin/files/ | Uploaded files |
Generate secrets
The install script and the AWS wizard generate both. To make them yourself, e.g. when building from source:
openssl rand -hex 32 # JWT_SECRET
openssl rand -base64 32 # APP_KEY
Warning Never reuse secrets between instances. Changing
APP_KEYon a running instance means re-entering every stored credential.