Deploy Kotaemon
Chat with your documents: RAG with cited answers, using your OpenAI key
Just deployed
/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
- Kotaemon on GitHub: https://github.com/Cinnamon/kotaemon
- Kotaemon documentation: https://cinnamon.github.io/kotaemon/
- Template source and changelog: https://github.com/aalfath/kotaemon-railway-template
- OpenAI API keys: https://platform.openai.com/api-keys
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(defaulthttps://api.openai.com/v1): set it to any OpenAI-compatible endpoint that also serves/embeddings.OPENAI_CHAT_MODEL(defaultgpt-4o-mini) andOPENAI_EMBEDDINGS_MODEL(defaulttext-embedding-3-small).KH_FEATURE_USER_MANAGEMENT_ADMIN(defaultadmin) andKH_FEATURE_USER_MANAGEMENT_PASSWORD(generated).
These values are applied again on every deploy, so you can change them in Railway and redeploy.
After deploying:
- Open the public URL and sign in as
admin. The password is theKH_FEATURE_USER_MANAGEMENT_PASSWORDvalue in the service's Variables tab. - In Files, upload a document and click Upload and Index.
- 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
OPENAI_API_KEY
Your OpenAI API key (platform.openai.com/api-keys), or a key for the OpenAI-compatible API set in OPENAI_API_BASE. Used for chat and embeddings.

