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_URL | PostgreSQL connection string |
JWT_SECRET | 32+ characters. openssl rand -hex 32 |
ENCRYPTION_KEY | Exactly 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_URL | Your public address. Agent sign-in breaks if this is wrong |
CORS_ORIGIN | Where the web interface is served from |
COOKIE_SECURE | true when serving over HTTPS |
LENSHUB_ENV | production enables stricter startup checks |
Models
LLM_PROVIDER | openai for anything OpenAI-compatible, or vllm |
LLM_BASE_URL | API root. Empty for OpenAI itself |
LLM_API_KEY | Your key |
LLM_CHAT_MODEL | Model name |
LLM_EMBED_BASE_URL | Leave pointing at the bundled service to keep indexing local |
Behaviour
WORKER_CONCURRENCY | Parallel sync jobs. Raise for faster indexing |
TRUST_PROXY_HEADERS | Only if your proxy overwrites X-Forwarded-For |
EMBEDDING_DIM | Must 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.