On this pageCore

Configuration Reference

Grengin reads its server settings from one environment file at startup. Edit it, then restart.

3 min read v1

AWS & self-hosted only

  • Install script ~/.grengin/config.env → grengin restart. grengin configure changes the database and callback address; grengin config shows 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

VariableDescription
DATABASE_URLPostgreSQL URL, e.g. postgres://grengin:<password>@127.0.0.1:5432/grengin
JWT_SECRETSigns sign-in tokens. 64 hex chars. Changing it signs everyone out.
APP_KEYBase64 32-byte key encrypting stored credentials (provider keys, SSO secrets). Changing it makes them unreadable.
REDIRECT_URLThe address people open Grengin at, e.g. https://chat.example.com. Sign-in callbacks build on it.

Server

VariableDefaultDescription
HOST0.0.0.0 (install script: 127.0.0.1)API listen address
PORT8080API port; the web app reaches it at /api
GRENGIN_WEB_PORT3000Install script only: web app port

File storage

VariableSet it toDescription
FILE_STORAGE_ROOTAWS image: /var/lib/grengin/filesWhere uploads are stored

Sign-in

OAuth providers

Empty turns a provider off. After first start, manage them in Authentication (SSO).

VariableDescription
GOOGLE_CLIENT_ID, GOOGLE_CLIENT_SECRETGoogle OAuth client ID and secret
AZURE_TENANT_ID, AZURE_CLIENT_ID, AZURE_CLIENT_SECRETMicrosoft 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

VariableDefaultDescription
RAG_ENABLEDtrueRetrieval-augmented generation on/off
RAG_RECENT_MESSAGE_PAIRS3Recent message pairs in context (min 1)
RAG_RETRIEVAL_TOP_K4Earlier messages retrieved per request (min 1)
RAG_MAX_CONTEXT_TOKENS8000Token budget for retrieved context (min 256)
RAG_EMBEDDING_ENABLEDfalseEmbeddings for semantic search
RAG_EMBEDDING_LLM_PROVIDERopenaiEmbedding provider
RAG_EMBEDDING_LLM_MODELtext-embedding-3-smallEmbedding model
RAG_SUMMARY_LLM_PROVIDERopenaiConversation summary provider
RAG_SUMMARY_LLM_MODELgpt-5.4-miniSummary 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.

VariableDefaultDescription
GRENGIN_AUTO_MIGRATEtrueRun pending migrations at startup
TRUSTED_PROXIESloopbackProxy addresses or ranges whose forwarded client IP is trusted. none trusts none.
CORS_ALLOWED_ORIGINSREDIRECT_URLBrowser origins allowed to call the API
AUDIT_LOG_RETENTION_DAYSDays to keep audit log entries

AWS installs only

Written by the AWS setup wizard; don’t add them yourself.

VariableDescription
SSO_PROXY_AUTO_ENABLE, SSO_PROXY_ENABLED, SSO_PROXY_URLGrengin’s built-in sign-in, for grengin.com workspaces only. Leave unset and use your own SSO app
JARVIS_SUBDOMAINFree 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.)

VariableDefaultDescription
GRENGIN_LOCAL_TEST_URLLocal test address, e.g. http://localhost:8080 (localhost or *.localhost only). Connecting becomes optional, domain skippable. Never on a public server. Details →
GRENGIN_SERVICE_URLhttps://service.grengin.comPairing and free-subdomain service. Alias JARVIS_WORKER_URL.
GRENGIN_STATE_DIR/etc/grenginIdentity and connection files
GRENGIN_INSTANCE_NAMEGrengin instanceName shown on grengin.com
GRENGIN_CLOUD_PROVIDERauto-detectaws or azure; skips cloud detection for the free subdomain
GRENGIN_RELEASE_BASE_URLRelease base (<base>/api/<version>/<arch>/grengin-api, <base>/webapp/<version>/webapp-dist.tar.gz). Alias RELEASE_BASE_URL.
GRENGIN_RELEASE_VERSIONlatestRelease, e.g. v0.9.6. Alias GRENGIN_VERSION.
GRENGIN_API_BINARY_URL, GRENGIN_WEBAPP_URLDirect API binary / web app archive URL, overriding the release layout
GRENGIN_LOCAL_API_BINARYLocal API binary instead of downloading
GRENGIN_LOCAL_WEBAPP_ARCHIVELocal web app .tar.gz
GRENGIN_LOCAL_WEBAPP_DIRLocal web app build directory (with index.html)
GRENGIN_PREFER_LOCAL_ARTIFACTSfalseReuse 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:

PathContents
/etc/grengin/.envConfiguration (this page)
/etc/grengin/Also connection files and, on AWS, the subdomain token
/opt/grengin/grengin-apiAPI binary
/opt/grengin/scripts/update-app-binaries.sh, reconfigure-domain.sh
/var/www/grengin/Web app files
/etc/systemd/system/grengin.serviceAPI 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_KEY on a running instance means re-entering every stored credential.

Was this page helpful?
GitHub (opens in a new tab)