Khoj is an open-source "AI second brain": a personal assistant that can chat with a language model, search your notes and documents by meaning, and answer questions using what's in them. You can use the developers' cloud app, but Khoj is also self-hostable, and when it runs on your own PC with a local model from Ollama, your documents don't have to leave your machine. This guide follows Khoj's official documentation for setting it up on Windows with Docker and connecting Ollama.
What Khoj does
According to its GitHub README, Khoj can chat with "any local or online LLM", get answers "from the internet and your docs (including image, pdf, markdown, org-mode, word, notion files)", and be reached from a browser, Obsidian, Emacs, a desktop app, your phone or WhatsApp. It also offers semantic search across your documents, custom agents with their own knowledge and persona, and scheduled research tasks. The project describes itself as "open-source, self-hostable. Always.", and its GitHub repository lists the GNU Affero General Public License v3.0 (AGPL-3.0).
The self-hosting docs put the main benefit plainly: "Your data will never have to leave your private network. You can even use Khoj without an internet connection if deployed on your personal computer."
What you need
Khoj's documentation gives these system requirements for running chat models offline:
RAM: minimum 8GB
Graphics memory: 16GB of VRAM recommended
Storage: at least 5GB of free disk space
GPU: "A Nvidia, AMD GPU or a Mac M1+ machine would significantly speed up chat responses"
In practice that means a 16GB card such as the ASUS RTX 5060 Ti 16GB Dual OC matches the developers' recommendation, while a 12GB card such as the ASUS RTX 3060 12GB Dual Gaming OC V2 sits below it, so you may need a smaller model. If you're unsure what your hardware can handle, read how to check if your PC can run a local LLM first. The Docker setup also runs several containers at once (see below), so leaving plenty of system RAM free helps.
You'll also need Ollama installed on Windows. If you haven't used it before, our guide to running AI models locally with Ollama and LM Studio covers the basics.
Step 1: Install WSL2 and Docker Desktop
Khoj's Windows instructions use Docker. First install WSL2 by running this in PowerShell, then restart your PC:
wsl --install
Then install Docker Desktop with the WSL2 backend (the default) and make sure Docker Compose is available. Our guide to setting up WSL2 for local AI covers WSL in more depth.
Step 2: Pull a model in Ollama
Install Ollama from ollama.com and download a chat model. Khoj's Ollama page uses Llama 3.1 as its example:
ollama pull llama3.1
Step 3: Download and edit Khoj's docker-compose.yml
Khoj's docs say Windows users should run these commands in their WSL2 terminal:
mkdir ~/.khoj && cd ~/.khoj
wget https://raw.githubusercontent.com/khoj-ai/khoj/master/docker-compose.yml
Open docker-compose.yml in a text editor and check these settings:
Set KHOJ_ADMIN_PASSWORD and KHOJ_DJANGO_SECRET_KEY to something secure. The file we downloaded on 29 November 2026 ships with placeholder values ("password" and "secret"), so don't leave them as they are. You can optionally set KHOJ_ADMIN_EMAIL too. These details let you log into the admin panel later.
Uncomment the OPENAI_BASE_URL line so Khoj talks to Ollama on your PC. In the current file the commented line reads # - OPENAI_BASE_URL=http://host.docker.internal:11434/v1/; remove the # to enable it.
Optionally disable telemetry. A comment in the file says telemetry "helps us prioritize feature development"; uncomment the KHOJ_TELEMETRY_DISABLE=True line if you'd rather not send it.
Leave the cloud API key lines blank (OPENAI_API_KEY, ANTHROPIC_API_KEY, GEMINI_API_KEY) if you want everything to stay local. Fill them in only if you also want to use those commercial models.
The compose file doesn't just start Khoj. It also starts a pgvector Postgres database, a SearXNG search container, Khoj's Terrarium code sandbox and a "khoj-computer" container, which is why it needs more memory than a single app. It also starts Khoj in anonymous mode, so there's no login for the web app on a single-user local setup.
Step 4: Start Khoj
From the same folder, start everything:
cd ~/.khoj
docker-compose up
On first start, Khoj is meant to load the models it finds on the Ollama server running on your PC automatically. Setup is complete when you see "Khoj is ready to engage" in the logs. The docs recommend restarting the Khoj server after the first run so all settings apply.
Then open http://localhost:42110 in your browser to use the web app.
Step 5: Check or add your Ollama model in the admin panel
If your Ollama model doesn't appear, add it manually. Go to http://localhost:42110/server/admin and log in with the admin email and password from docker-compose.yml. Use localhost rather than 127.0.0.1 here: the docs warn that 127.0.0.1 can cause a CSRF error on the admin panel.
Create a new AI Model API named ollama, with any string as the API key and the Ollama URL as the API base URL. From inside Docker, that's the host.docker.internal address in your compose file; the docs give http://localhost:11434/v1/ as Ollama's default when Khoj isn't in a container.
Create a new Chat Model with the name of your Ollama model (for example llama3.1), model type Openai, the ollama AI Model API you just made, and a max prompt size that suits your model (the docs' example is 20000).
Select the new model in the chat model dropdown in your settings.
Repeat step 2 for any other Ollama models you want to use.
Step 6: Add your documents
Khoj's docs list several ways to give it your files:
Drag and drop documents into the web app, best for one-off files.
Add Documents on the search page to upload files that are then indexed.
Khoj Desktop app, which syncs chosen files and folders. When self-hosting, set its Khoj URL to http://127.0.0.1:42110 and leave the API key blank if your server runs in anonymous mode.
Obsidian or Emacs clients, which sync your notes automatically. Khoj's Obsidian plugin can search and chat with your vault from inside Obsidian.
Notion or GitHub sync, which keeps those sources indexed in the background.
Search uses a "bi-encoder" embedding model to find relevant passages and a slower cross-encoder model to re-rank them, which is the same retrieve-then-rerank approach explained in our embedding vs reranker models piece. Khoj sets up a default local search model, so you don't need to change it unless you want better multilingual search.
The pip alternative
If you'd rather not use Docker, Khoj's docs also describe installing the server with Python's pip on Windows (py -m pip install 'khoj[local]'), with build options for NVIDIA CUDA, AMD ROCm or Vulkan GPUs, and starting it with an embedded database in anonymous mode. If pip reports dependency conflicts, the docs recommend installing with pipx instead. Docker is the route Khoj's Windows instructions lead with, and it bundles the database and helper services for you, so it's the simpler choice for most Windows users.
Troubleshooting
Container stops with "Killed": Khoj's fix is to increase the RAM available to Docker containers in Docker's settings.
Can't log in to the admin panel: use localhost, not 127.0.0.1. On a Mac, the docs say Safari may not work, so try Chrome or Firefox.
Bad Request (400) on another device: by default Khoj is only reachable on the machine running it; the docs explain setting KHOJ_DOMAIN (and KHOJ_NO_HTTPS if needed) for remote access.
Upgrading: run docker-compose up --build in the same folder to fetch the latest build.
Is the project still active?
It's worth knowing before you build your notes around it. When we checked GitHub on 29 November 2026, the repository's most recent code push was on 2 August 2026, and the latest tagged release was 2.0.0-beta.28 from 26 March 2026. The README now also promotes Pipali, a separate open-source "AI coworker" from the same team. Khoj still works as documented, but updates may be slower than for some rivals. If you want an alternative, see our list of the best local AI document chat apps.