WindowsmacOSLinux

Where Does Khoj Store Config and Index?

Khoj keeps server state in ~/.khoj with khoj.yml plus content and env, and Electron prefs in AppData.

Last updated

Khoj splits state cleanly. The backend owns a dotfolder in home with YAML config, indexed content and environment. The desktop Electron shell adds a small JSON for window prefs. Server state stays in the dotfolder. The wrapper JSON only remembers window layout.

Docker mounts the same home path into the container. Back up the dotfolder, not the wrapper JSON. Version jumps can rebuild the index on first launch, which takes a while on big notes. Stop the server before copying. Check the config file inside the folder after restore to confirm.

Where Khoj stores this, by platform

Windows
%USERPROFILE%\.khoj

Backend home with khoj.yml, content and env. Same relative path on Windows (C:\Users\..\.khoj). Docker mounts this dir as khoj_config.

macOS
~/.khoj

Same backend home on Mac. Electron wrapper prefs sit separately in Application Support; server state stays here.

Linux
~/.khoj

Same backend home on Linux. No XDG config variant; the dotfolder is canonical across installs.

Frequently asked questions

How do I back up Khoj?

Copy the whole .khoj folder with Khoj stopped. It holds khoj.yml, the content index and env. Point the new install at the copy and restart; embeddings rebuild if versions differ.

What is the difference between .khoj and Khoj AppData?

Server state lives in ~/.khoj on all OSes. The Electron wrapper adds %APPDATA%\Khoj\config.json for window prefs only. There is no ~/.config/khoj to hunt.

Notice an outdated path? Let us know.