Self-hosted app·Self-hosted AI
Khoj hosting on a Swiss dedicated server.
Khoj hosting on a Swiss dedicated server: Docker setup pinned to 2.0.0-beta.28, local models via Ollama, sizing and cost on Säntis at $109.99/mo.
- Django
- PostgreSQL
- Ollama
- Docker
ALP1·Swiss Alps
In stockRecommended for this use case
- 10 Gbps portunmetered traffic, fair useIncluded
- Debian 13preinstalled with the orderIncluded
- DDoS protection, 1 IPv4KVM console and full rootIncluded
Optional: NVMe +$10 per 2 TB, up to 12 TB · 25 Gbps port +$25 · 32 GB memory +$12
Pay quarterly for 10% less, yearly for 25% less
- No KYC
- Crypto only
- Swiss jurisdiction
ALP1 · Swiss Alps · Our own hardware, under Swiss law, paid in crypto
- 12 cores, 24 threads AMD EPYC 4464P
- 3 TB NVMe, up to 12 TB
- 10 Gbps port, unmetered traffic
- DDoS protection included
- Swiss jurisdiction, outside the EU
01/06
Short answer.
Yes. Khoj runs on any of our servers that can run Docker, and for the reason most people self-host it, keeping both the documents and the questions on hardware they control, we recommend the Säntis dedicated server: AMD EPYC 4464P with 12 cores and 24 threads, 64 GB of DDR5 ECC and 3 TB of NVMe Gen4, in ALP1 in the Swiss Alps, for $109.99 a month. That is enough room for Khoj, its database and a local language model on the same machine.
The decision that matters most is where inference runs. Point Khoj at OpenAI, Anthropic or Gemini and the Swiss server still holds your index and your chat history, but every question, together with the passages Khoj pulls from your files to answer it, is sent to that provider. If that trade is acceptable to you, a Cloud VPS is enough and Säntis is money you do not need to spend.
02/06
What Khoj is, and who maintains it.
Khoj is an open-source "AI second brain" published under the AGPL-3.0 by Khoj Inc., the company of Saba Imran and Debanjum Singh Solanky, which went through Y Combinator in the summer 2023 batch. It indexes your notes and documents (PDF, Markdown, org-mode, Word, Notion), answers questions over them with retrieval-augmented generation, and adds web search, a Python code sandbox, custom agents and scheduled automations. You use it from a browser, the desktop app, or the Obsidian and Emacs clients, which also keep local folders synced to the server. It talks to any OpenAI-compatible endpoint, which is how a local Ollama instance plugs in.
Two facts should shape how you run it. Khoj Inc. shut down its hosted service, Khoj Cloud, on 15 April 2026 and moved its effort to two other products; the shutdown notice says Khoj stays open source and self-hosting remains the way to use it. And the latest tagged release, 2.0.0-beta.28, dates from 26 March 2026: when we checked on 4 November 2026, nothing newer had been tagged. We read that as mature software entering a quiet phase rather than an abandoned project, but it changes the operating posture. Pin the version, keep the instance away from the open internet, and do not count on quick upstream fixes. An open issue already shows the kind of drift you inherit: a newer OpenAI model family rejects Khoj's requests because the app sends a fixed temperature of 0.8 that those models no longer accept. A model you serve yourself through Ollama does not move under you like that, which is one more argument for local inference.
Our servers are in Switzerland and answer to Swiss law. We act only on orders from competent Swiss authorities, and a request from abroad has to pass through one of them first.
03/06
Requirements and sizing.
The upstream docker-compose.yml defines five services. server is Khoj itself, web interface and API on port 42110. database is PostgreSQL 15 with pgvector, where the index, chats and agents live. sandbox is Terrarium, which executes the Python that Khoj writes. search is a SearXNG instance for web results, and computer is an optional container for the experimental operator mode that publishes VNC on port 5900. On first start Khoj also downloads a sentence-transformer embedding model from Hugging Face and runs it on the CPU. With API models only, none of this is heavy.
Local models change the picture. Khoj's documentation asks for at least 8 GB of RAM and 5 GB of disk for offline chat, recommends 16 GB of VRAM, and says a GPU speeds responses up considerably. Our catalogue has no GPU servers, so local inference here means CPU inference, and on a CPU the speed of token generation is set by memory bandwidth: each generated token reads the model's active weights from RAM once. The EPYC 4004 processors in Rigi through Eiger have two DDR5 channels rated at 5200 MT/s, which is 83.2 GB/s in theory. An 8-billion-parameter model quantised to 4 bits weighs about 5 GB, so the ceiling is roughly 16 tokens per second before any overhead; a 14B model at about 9 GB lands near 9 (both theoretical). Mixture-of-experts models suit this hardware far better. Qwen3-30B-A3B needs around 19 GB of RAM but reads only about 3 billion active parameters per token, which lifts the theoretical ceiling to around 40 tokens per second.
Prompt processing is the other half of the wait. Khoj fills the prompt with retrieved passages and makes several intermediate model calls per answer (intent detection, query planning, search), and that prefill work scales with core count. This is where Säntis's twelve cores earn their place over the eight in Pilatus, which has the same memory and the same bandwidth. If you want dense 30B-class models, the honest recommendation is Matterhorn: a dense 32B model at about 20 GB gives a theoretical ceiling near 4 tokens per second on Säntis and near 23 on Matterhorn's twelve channels.
| Plan | CPU | RAM | Memory bandwidth (theoretical) | Fits | Price/month |
|---|---|---|---|---|---|
| Cloud VPS Pro | 6 vCPU | 8 GB | — | Khoj with API models only | $22.99 |
| Pilatus | EPYC 4344P, 8C/16T | 64 GB | 83.2 GB/s, 2 channels | One user, 8B or MoE local model | $84.99 |
| Säntis (recommended) | EPYC 4464P, 12C/24T | 64 GB | 83.2 GB/s, 2 channels | Small team, local model, faster prefill | $109.99 |
| Matterhorn | EPYC 9254, 24C/48T | 192 GB | 460.8 GB/s, 12 channels at DDR5-4800 | Dense 30B-class models, heavier use | $219.99 |
Read the bandwidth figures as upper bounds, not as promises.
From the outside, the server needs SSH plus ports 80 and 443 for the reverse proxy and its certificate. Port 42110 should listen on loopback only, and port 5900 should not exist.
04/06
Deploying Khoj with Docker on Säntis.
Order Säntis with Debian 13. Payment is in crypto and no-KYC applies: an email address is enough to open the account (what we ask for, and what we do not). Once you have root over SSH, install Docker Engine and the compose plugin from Docker's own Debian repository (docker-ce, docker-compose-plugin; Debian 13 is supported), and Caddy from Debian's archive with apt install caddy. Then create the project directory and a .env file with real secrets:
mkdir -p /srv/khoj && cd /srv/khoj
cat > .env <<EOF
POSTGRES_PASSWORD=$(openssl rand -hex 24)
KHOJ_DJANGO_SECRET_KEY=$(openssl rand -hex 32)
KHOJ_ADMIN_EMAIL=you@example.com
KHOJ_ADMIN_PASSWORD=$(openssl rand -base64 24)
EOF
chmod 600 .envThe docker-compose.yml below is the upstream file, trimmed and adjusted for a server with a public address.
services:
database:
image: docker.io/pgvector/pgvector:pg15
restart: unless-stopped
environment:
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD}
POSTGRES_DB: postgres
volumes:
- khoj_db:/var/lib/postgresql/data/
healthcheck:
test: ["CMD-SHELL", "pg_isready -U postgres"]
interval: 30s
timeout: 10s
retries: 5
sandbox:
image: ghcr.io/khoj-ai/terrarium:latest
restart: unless-stopped
search:
image: docker.io/searxng/searxng:latest
restart: unless-stopped
volumes:
- khoj_search:/etc/searxng
environment:
- SEARXNG_BASE_URL=http://localhost:8080/
ollama:
image: docker.io/ollama/ollama:latest
restart: unless-stopped
volumes:
- ollama:/root/.ollama
server:
image: ghcr.io/khoj-ai/khoj:2.0.0-beta.28
restart: unless-stopped
depends_on:
database:
condition: service_healthy
ports:
- "127.0.0.1:42110:42110"
working_dir: /app
volumes:
- khoj_config:/root/.khoj/
- khoj_models:/root/.cache/torch/sentence_transformers
- khoj_models:/root/.cache/huggingface
environment:
- POSTGRES_DB=postgres
- POSTGRES_USER=postgres
- POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
- POSTGRES_HOST=database
- POSTGRES_PORT=5432
- KHOJ_DJANGO_SECRET_KEY=${KHOJ_DJANGO_SECRET_KEY}
- KHOJ_DEBUG=False
- KHOJ_ADMIN_EMAIL=${KHOJ_ADMIN_EMAIL}
- KHOJ_ADMIN_PASSWORD=${KHOJ_ADMIN_PASSWORD}
- KHOJ_TERRARIUM_URL=http://sandbox:8080
- KHOJ_SEARXNG_URL=http://search:8080
- OPENAI_BASE_URL=http://ollama:11434/v1/
- KHOJ_DEFAULT_CHAT_MODEL=qwen3:8b
- KHOJ_DOMAIN=khoj.example.com
- KHOJ_ALLOWED_DOMAIN=127.0.0.1
- KHOJ_TELEMETRY_DISABLE=True
command: --host="0.0.0.0" --port=42110 -vv --non-interactive
volumes:
khoj_config:
khoj_db:
khoj_models:
khoj_search:
ollama:Pull the model before Khoj starts for the first time, because Khoj registers the models it finds on Ollama at that moment. The upstream docs also advise one restart after the first run so every setting is applied:
docker compose up -d ollama
docker compose exec ollama ollama pull qwen3:8b
docker compose up -d
docker compose logs -f server # wait for the "Khoj is ready to engage" line
docker compose restart serverPoint an A record for your domain at the server's IPv4, then give Caddy two lines in /etc/caddy/Caddyfile and reload it; it fetches the certificate itself:
khoj.example.com {
reverse_proxy 127.0.0.1:42110
}The admin panel is at https://khoj.example.com/server/admin. Add any further chat models there, then pick the default in your user settings.
Each departure from upstream has a reason. The Khoj image is pinned to 2.0.0-beta.28 rather than latest, so a rebuild next year gives you the same software; Terrarium, SearXNG and Ollama still track latest, so note their digests after the first pull if you want reproducible rebuilds. Port 42110 is bound to 127.0.0.1 because Docker writes its own iptables rules for published ports and those bypass ufw, as Docker's documentation warns: on a server with a public IPv4, the upstream "42110:42110" mapping is reachable from anywhere, whatever your firewall says. The computer service is gone for the same reason, since its VNC port would be public and the operator mode it serves wants the Docker socket, which amounts to root on the host. The upstream command: line also passes a no-login flag just before --non-interactive; in that mode anyone who reaches the URL acts as you, with your files, your agents and the API keys you configured. We removed it. Logins then use magic links, sent through Resend if you set RESEND_API_KEY and RESEND_EMAIL, or generated by hand from the admin panel, which works well for a handful of users and keeps a US mail API out of the loop. Telemetry is off. Ollama runs inside the compose network instead of on the host, because the upstream route through host.docker.internal only works if Ollama listens beyond loopback, and an OLLAMA_HOST=0.0.0.0 set in a hurry on a public machine publishes an unauthenticated model API on port 11434.
If you are the only user, a stricter variant is to keep the no-login mode, publish nothing on 80 and 443, and reach Khoj only over WireGuard or an SSH tunnel.
Everything that matters lives in the database volume, so back that up. With zstd and restic installed from Debian, a nightly job is two lines; a 250 GB bucket in our S3-compatible object storage at $1.99 a month is plenty for most indexes:
docker compose exec -T database pg_dump -U postgres postgres | zstd > /srv/khoj/backup/khoj-$(date +%F).sql.zst
restic -r s3:https://<endpoint>/<bucket> backup /srv/khoj/backup05/06
Cost.
Säntis costs $109.99 a month and includes a 10 Gbps port with unmetered traffic under fair use, DDoS protection, one IPv4, a KVM console and full root. Longer terms bring it down:
| Billing | Equivalent per month | Amount billed |
|---|---|---|
| Monthly | $109.99 | $109.99 |
| Quarterly (−10 %) | $98.99 | $296.97 per quarter |
| Yearly (−25 %) | $82.49 | $989.91 per year |
The quarterly and yearly figures are our arithmetic on the catalogue price. Two options are worth knowing for Khoj: +32 GB of RAM for $12 a month (96 GB for $121.99), which buys room for a larger mixture-of-experts model next to PostgreSQL but adds no memory bandwidth, and backup space from 1 TB for $5 a month if you prefer it to object storage. Model API usage, if you configure any, is billed by that provider, not by us. We take Monero, Bitcoin, Tether (USDT), Ethereum, Litecoin and other coins; balances are in US dollars, top-ups from $50 carry a bonus (a $500 top-up becomes $600 of balance, about five and a half months of Säntis at the monthly price), and the unused paid part of a top-up is refundable within 14 days. The whole range is on our dedicated server page and the price list.
06/06
Limits and acceptable use.
We supply the server and the network; the application, its updates and its exposure are yours. An instance left open without login hands strangers your documents, your API keys and a Python sandbox, and abuse that originates from your server is handled as abuse from your account.
If you index other people's personal data, such as client files, staff records or a support mailbox, you are the controller under the revised Swiss Federal Act on Data Protection, in force since 1 September 2023. Personal data can come in from the EU without additional safeguards, because the European Commission confirmed on 15 January 2024 that Switzerland's adequacy decision stays in force. Sending it on to a US model API is a transfer abroad: since 15 September 2024 Switzerland treats US companies certified under the Swiss-U.S. Data Privacy Framework as adequate, so check your provider's certification, and remember that the retrieved passages travelling with each prompt are personal data too.
On copyright, a private index of your own library is one thing: Swiss law allows downloading a work for private use, software excepted. Opening your Khoj to other people so they can read or download those works is making them available, and that requires permission. A DMCA notice has no direct legal effect in Switzerland. We forward complete complaints to the customer, who must remove the content or justify it, and we act on a decision of a competent Swiss authority, or where the content is manifestly unlawful (Swico Code of Conduct Hosting 2025). Khoj's AGPL-3.0 licence adds one obligation of its own: if you modify the code and let others use it over a network, you must offer them the corresponding source.
As for foreign requests, the US Department of Justice lists CLOUD Act executive agreements only with the United Kingdom and Australia as of 31 October 2026, none with Switzerland. That removes one fast-track route; it is not a promise that no foreign authority can ever reach data held in Switzerland. Our page on Swiss jurisdiction and offshore hosting covers the detail. For anything specific to your account, open a support ticket from the client panel.
Catalogue·Options
Every configuration, every option, every price.
Six dedicated servers, all with a 10 Gbps port and unmetered traffic. Add NVMe, memory, a faster port or more addresses when you order.
| Server | CPU | Cores / threads | Memory | Storage | Port, traffic | Price | Order |
|---|---|---|---|---|---|---|---|
| Rigi1,798 mEntry level | EPYC 4244P | 6 / 12 | 32 GB DDR5 | 1 TB NVMe | 10 Gbps unmetered | $64.99/mo | Order Rigi |
| Pilatus2,128 mBalanced | EPYC 4344P | 8 / 16 | 64 GB DDR5 | 2 TB NVMe | 10 Gbps unmetered | $84.99/mo | Order Pilatus |
| Säntis2,502 mRecommendedMore cores | EPYC 4464P | 12 / 24 | 64 GB DDR5 | 3 TB NVMe | 10 Gbps unmetered | $109.99/mo | Order Säntis |
| Titlis3,238 mHigh frequency | EPYC 4564P | 16 / 32 | 96 GB DDR5 | 4 TB NVMe | 10 Gbps unmetered | $139.99/mo | Order Titlis |
| Eiger3,967 mLarge memory | EPYC 4584PX | 16 / 32 | 128 GB DDR5 | 6 TB NVMe | 10 Gbps unmetered | $164.99/mo | Order Eiger |
| Matterhorn4,478 mMaximum density | EPYC 9254 | 24 / 48 | 192 GB DDR5 | 8 TB NVMe | 10 Gbps unmetered | $219.99/mo | Order Matterhorn |
Each configuration is named after a Swiss summit, drawn from its real silhouette. NVMe can be added in 2 TB steps up to 12 TB.
Every plan
- 10 Gbps port25 Gbps for $25 more
- Unmetered trafficfair use, no per-TB bill
- DDoS protectionalways on
- 1 IPv4 addressmore at $2 each
- KVM consoleand full root access
FAQ
Questions people ask first.
Short answers about running this in ALP1. If yours is not here, open a ticket from your panel.
Can Khoj run on Säntis without a GPU?
Yes. Our catalogue has no GPU servers, so local models run on the CPU through Ollama. Generation speed is bound by memory bandwidth: on Säntis's two DDR5 channels (83.2 GB/s in theory) an 8B model at 4-bit has a theoretical ceiling around 16 tokens per second, and mixture-of-experts models such as Qwen3-30B-A3B do much better than their size suggests. Khoj's research mode chains several model calls per answer, so expect it to be slow on CPU.
Is a Cloud VPS enough for Khoj?
With API models only, yes. Khoj, PostgreSQL, SearXNG and the sandbox fit on Cloud VPS Pro (6 vCPU, 8 GB RAM, 320 GB NVMe, 20 TB of transfer included) for $22.99 a month. VPS traffic is counted against the plan's monthly transfer, unlike the dedicated servers' unmetered fair-use port, but Khoj generates little traffic. A VPS is the wrong place for local models.
Does my data leave Switzerland when Khoj runs on your server?
Your files, index, chats and agents stay in PostgreSQL on the server in ALP1. Three things can leave it: prompts and retrieved passages if you configure an external model API, web searches that SearXNG forwards to upstream search engines, and Khoj's telemetry unless you set KHOJ_TELEMETRY_DISABLE=True. A local model through Ollama and that one variable remove the first and the last.
Is Khoj still maintained now that Khoj Cloud is gone?
Khoj Cloud shut down on 15 April 2026, and the founders now work mainly on Open Paper and Pipali; Khoj remains open source under the AGPL-3.0. The latest tagged release is 2.0.0-beta.28 from 26 March 2026, and nothing newer had been tagged when we checked on 4 November 2026. Pin that version, keep the instance behind a login or a VPN, and treat upstream fixes as uncertain.
Can several people share one self-hosted Khoj?
Yes. Run Khoj without the upstream no-login flag, as in the compose file above, and each person signs in with a magic link, emailed through Resend or generated by you in the admin panel, and gets their own documents, chats and settings on the shared server.
Which ports does a self-hosted Khoj need open?
Publicly, only SSH and ports 80 and 443 for the reverse proxy. Khoj listens on 42110 and should be bound to 127.0.0.1; PostgreSQL, SearXNG, Terrarium and Ollama need no published port at all. Docker's published ports bypass ufw, so the binding in the compose file protects you, not the firewall.
Sources
Every fact on this page, with its source
Consulted 4 Nov 2026 unless noted.
Swiss law and authorities
- Revised Federal Act on Data Protection (FADP), in force since 1 September 2023fedlex.admin.ch
- Federal Office of Justice, recognition of US companies certified under the Swiss-U.S. Data Privacy Framework, since 15 September 2024bj.admin.ch
- Swiss Federal Institute of Intellectual Property, copyright on the internet (private download permitted, software excepted; making available requires permission)ige.ch
EU and other countries
- European Commission, adequacy decisions; review of 15 January 2024 confirming decision 2000/518/EC for Switzerlandcommission.europa.eu
- US Department of Justice, CLOUD Act resources (executive agreements with the United Kingdom and Australia only), verified 31 October 2026justice.gov · verified 31 Oct 2026
Industry, providers and software
- Khoj docker-compose.yml, master branch (services, images, ports, telemetry switch)github.com
- Khoj releases, 2.0.0-beta.28 published 26 March 2026 and marked latestgithub.com
- Khoj container image, tag 2.0.0-beta.28 (amd64 and arm64)github.com
- Khoj repository and AGPL-3.0 licencegithub.com
- Khoj issue #1377, fixed temperature rejected by newer OpenAI modelsgithub.com
- Docker documentation, "Install Docker Engine on Debian" (Debian 13 supported; published ports bypass ufw)docs.docker.com
- Swico, Code of Conduct Hosting, revised edition published 13 March 2025swico.ch
Other references
- Khoj documentation, "Self-Host" (requirements, environment variables, port 42110, admin panel)docs.khoj.dev
- Khoj Cloud shutdown notice, dated 15 April 2026app.khoj.dev
- Y Combinator company page for Khoj (batch S23, founders)ycombinator.com
- Khoj documentation, "Authenticate (Multi-User Setup)" (magic links, Resend variables, turning off the no-login mode)docs.khoj.dev
- Khoj documentation, "Remote Access" (KHOJ_DOMAIN, HTTPS)docs.khoj.dev
- Khoj documentation, "Ollama" (OpenAI-compatible endpoint, model auto-loading on first run)docs.khoj.dev
- AMD, EPYC 4464P specifications (2 DDR5 channels, up to 5200 MT/s)amd.com
- AMD, EPYC 9254 specifications (12 channels, DDR5-4800, 460.8 GB/s per socket)amd.com
ALP1·Swiss Alps
Your server in the Alps, ready when you are.
Cloud VPS start at $6.99 a month and are usually set up within minutes of your order.
