LensHub
Get startedlenshub.ai
Self-hosting

Configuration

Environment variables, and which ones you must set.

Configuration is environment variables on the API and worker containers. Organization settings in the interface override them where both exist.

Must be set

DATABASE_URLPostgreSQL connection string
JWT_SECRET32+ characters. openssl rand -hex 32
ENCRYPTION_KEYExactly 32 bytes, base64. openssl rand -base64 32

The API refuses to start without a valid ENCRYPTION_KEY, deliberately — earlier behaviour was to continue and store credentials unencrypted, which is worse than not starting.

Set before anyone else connects

BASE_URLYour public address. Agent sign-in breaks if this is wrong
CORS_ORIGINWhere the web interface is served from
COOKIE_SECUREtrue when serving over HTTPS
LENSHUB_ENVproduction enables stricter startup checks

Models

LLM_PROVIDERopenai for anything OpenAI-compatible, or vllm
LLM_BASE_URLAPI root. Empty for OpenAI itself
LLM_API_KEYYour key
LLM_CHAT_MODELModel name
LLM_EMBED_BASE_URLLeave pointing at the bundled service to keep indexing local

Behaviour

WORKER_CONCURRENCYParallel sync jobs. Raise for faster indexing
TRUST_PROXY_HEADERSOnly if your proxy overwrites X-Forwarded-For
EMBEDDING_DIMMust match the embedding model. Changing it means re-indexing everything

ENCRYPTION_KEY and EMBEDDING_DIM are the two you cannot change casually. The first makes stored credentials unreadable; the second invalidates your entire index.

The full generated list is in the reference.

On this page