Environment Variables
All Knowmarks configuration can be set via environment variables. No config files are required.
Core
| Variable |
Default |
Description |
KNOWMARKS_DATA_DIR |
OS default |
Data directory path. Contains the database, model cache, and config file. |
KNOWMARKS_HOST |
127.0.0.1 |
Server bind address. Set to 0.0.0.0 to allow external access. |
KNOWMARKS_PORT |
3749 |
Server port for the dashboard and REST API. |
KNOWMARKS_API_KEY |
(empty) |
Bearer token for REST API authentication. When set, all /api/v1/ requests require Authorization: Bearer <key>. |
Embedding
| Variable |
Default |
Description |
KNOWMARKS_EMBEDDING_PROVIDER |
fastembed |
Embedding provider: fastembed, ollama, or openai. |
KNOWMARKS_EMBEDDING_MODEL |
BAAI/bge-small-en-v1.5 |
Embedding model name. Must match the provider's model format. |
KNOWMARKS_EMBEDDING_ENDPOINT |
(empty) |
Endpoint URL for Ollama or OpenAI-compatible providers. |
KNOWMARKS_EMBEDDING_API_KEY |
(empty) |
API key for OpenAI-compatible embedding providers. |
Model locking
The embedding model is locked on first use. All items in a collection must use the same model for consistent search results. Changing the model requires re-embedding all items.
LLM
| Variable |
Default |
Description |
KM_LLM_URL |
https://openrouter.ai/api/v1 |
OpenAI-compatible LLM endpoint URL. |
KM_LLM_MODEL |
google/gemini-2.5-flash |
LLM model name. |
KM_LLM_API_KEY |
(empty) |
API key for the LLM provider. Required for OpenRouter and other hosted providers. |
KM_LLM_ENABLED |
1 |
Set to 0 to disable all LLM features (chat, summaries, query expansion). |
Telemetry
| Variable |
Default |
Description |
KM_SENTRY_DSN |
(empty) |
Sentry DSN for error reporting. Leave empty to disable. |
KM_POSTHOG_KEY |
(empty) |
PostHog project key for usage analytics. Leave empty to disable. |
KM_POSTHOG_HOST |
https://us.i.posthog.com |
PostHog API host. |
Other
| Variable |
Default |
Description |
KM_GITHUB_TOKEN |
(empty) |
GitHub token for feedback submission. |
KM_FEEDBACK_REPO |
(empty) |
GitHub repository for feedback issues. |
KM_LOG_LEVEL |
INFO |
Logging level: DEBUG, INFO, WARNING, ERROR. |
Docker-Specific
When running in Docker, set variables via -e flags or in docker-compose.yml:
docker run -v knowmarks_data:/data -p 3749:3749 \
-e KNOWMARKS_HOST=0.0.0.0 \
-e KNOWMARKS_EMBEDDING_PROVIDER=ollama \
-e KNOWMARKS_EMBEDDING_ENDPOINT=http://host.docker.internal:11434 \
knowmarks:slim