
Deploy LightRAG
Graph-based RAG server with web UI, login and API key on by default
LightRAG
Just deployed
/data
Deploy and Host LightRAG on Railway
LightRAG is an open-source retrieval-augmented generation (RAG) server from HKU Data Intelligence Lab. It extracts entities and relationships from your documents into a knowledge graph, stores text chunks as vectors, and answers questions using both. It ships with a REST API, an Ollama-compatible chat API and a web UI.
About Hosting LightRAG
Hosting LightRAG means running its Python API server, keeping its storage on disk, and pointing it at an LLM and an embedding model. This template runs the official LightRAG image pinned to v1.5.7 as one service, with a Railway volume at /data for the knowledge graph, vector index, document status and uploaded files. Authentication is on from the first start: the web UI asks for a login, the API needs an API key, and the Ollama-compatible routes are no longer left open. Railway generates the admin password, API key and JWT secret. You only add your LLM provider's API key. The default is OpenAI, and any OpenAI-compatible endpoint or Ollama works too.
Common Use Cases
- Question answering over internal documents, notes or manuals, with answers grounded in a knowledge graph
- A private RAG backend for chat apps or agents through the REST API or the Ollama-compatible
/api/chatendpoint - Exploring how entities and relationships connect across a document collection in the graph viewer
Dependencies for LightRAG Hosting
- LightRAG Server v1.5.7 (official
ghcr.io/hkuds/lightragimage, pinned by digest) - A Railway volume mounted at
/data - An API key for an LLM and embedding provider (OpenAI by default), or your own OpenAI-compatible or Ollama endpoint
Deployment Dependencies
- LightRAG source code and v1.5.7 release notes
- LightRAG Server documentation and all configuration options (
env.example)
Implementation Details
- Sign in: open your Railway domain and sign in as
admin(or theADMIN_USERNAMEyou set) with the password in theADMIN_PASSWORDvariable. - API access: send the
LIGHTRAG_API_KEYvalue in anX-API-Keyheader, for examplecurl -H "X-API-Key: YOUR_API_KEY" https://YOUR-APP.up.railway.app/documents/pipeline_status. The interactive API docs are at/docs. - LLM provider: set
LLM_BINDING_API_KEYbefore you upload documents. The defaults are OpenAIgpt-5.4-miniandtext-embedding-3-large(3072 dimensions). To use another provider, changeLLM_BINDING,LLM_MODEL,LLM_BINDING_HOSTand the matchingEMBEDDING_*variables. The embedding model and dimension are fixed once documents are indexed, so choose them before your first upload. - Ollama-compatible routes:
/api/*requires the API key in this template (WHITELIST_PATHS=/health). SetWHITELIST_PATHS=/health,/api/*only if you want them public. - Storage: the graph (NetworkX), vectors (NanoVectorDB), key-value data and uploads are files under
/data, which suits small and medium collections. For large collections, LightRAG also supports PostgreSQL with pgvector, Neo4j, Milvus, Qdrant and others through theLIGHTRAG_*_STORAGEvariables.
Why Deploy LightRAG 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 LightRAG 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
LightRAG
ghcr.io/hkuds/lightrag:v1.5.7

