Deploy Kotaemon

Chat with your documents: RAG with cited answers, using your OpenAI key

Deploy Kotaemon

/app/ktem_app_data

Deploy and Host Kotaemon on Railway

Kotaemon is an open-source RAG web app for chatting with your documents. You upload PDFs, Office files or text, Kotaemon indexes them into a vector store, and answers your questions with citations that point to the exact passages used. It supports multiple users, file groups, and OpenAI-compatible and other LLM providers.

About Hosting Kotaemon

This template builds Kotaemon v0.12.0 from the pinned upstream release and runs it as one service with a Railway volume at /app/ktem_app_data. That volume holds the SQLite database, uploaded files, the LanceDB document store and the Chroma vector store, so your data survives redeploys. The only prompt is OPENAI_API_KEY: chat and embeddings use OpenAI by default, or any OpenAI-compatible endpoint if you change OPENAI_API_BASE. The admin password is generated on deploy. Every page and API route sits behind login, and /healthz serves Railway's health check. Kotaemon needs about 1 GB RAM: on a 0.5 GB plan it restarts when you index a PDF.

Common Use Cases

  • Ask questions about contracts, manuals, papers or reports and get answers with citations
  • Give a team a shared, private document Q&A tool with its own user accounts
  • Try different LLM and embedding providers against the same document collection

Dependencies for Kotaemon Hosting

  • An OpenAI API key, or a key for an OpenAI-compatible API that serves both chat and embeddings
  • About 1 GB RAM for the Kotaemon service

Deployment Dependencies

Implementation Details

Services: one service, Kotaemon (the web app on port 7860, built from the template repo), with a volume at /app/ktem_app_data. There is no separate database: Kotaemon keeps everything in that volume.

Variables:

  • OPENAI_API_KEY (required): used for chat and embeddings.
  • OPENAI_API_BASE (default https://api.openai.com/v1): set it to any OpenAI-compatible endpoint that also serves /embeddings.
  • OPENAI_CHAT_MODEL (default gpt-4o-mini) and OPENAI_EMBEDDINGS_MODEL (default text-embedding-3-small).
  • KH_FEATURE_USER_MANAGEMENT_ADMIN (default admin) and KH_FEATURE_USER_MANAGEMENT_PASSWORD (generated).

These values are applied again on every deploy, so you can change them in Railway and redeploy.

After deploying:

  1. Open the public URL and sign in as admin. The password is the KH_FEATURE_USER_MANAGEMENT_PASSWORD value in the service's Variables tab.
  2. In Files, upload a document and click Upload and Index.
  3. In Chat, choose Search All in the file selector and ask a question.

Add users under Resources → Users. Add other providers (Azure OpenAI, Anthropic, Gemini, Groq, Cohere, Mistral, Voyage) under Resources → LLMs / Embeddings.

Left out: this build has no PyTorch or GPU parts, so it leaves out local models (Ollama, llama.cpp), the Docling and OCR readers, and the GraphRAG and LightRAG indexes. Standard PDF, Office, HTML and text readers are included.

Updates: the service builds from the template's GitHub repo. When a new Kotaemon version is merged, Railway shows you an update notice and you choose when to apply it. Read the repo's CHANGELOG.md first. Your volume is kept.

Why Deploy Kotaemon on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Kotaemon on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Chat Chat
Chat Chat, your own unified chat and search to AI platform.

okisdev
117
View Template
Weaviate
Vector database with hybrid search and an API key-protected API

GitHub Locker
1
View Template
Möbius Personal AI OS
Self-hosted AI agent that builds and runs apps for you, with memory.

Tracklayer
1