Deploy LightRAG

Graph-based RAG server with web UI, login and API key on by default

Deploy 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/chat endpoint
  • 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/lightrag image, 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

Implementation Details

  • Sign in: open your Railway domain and sign in as admin (or the ADMIN_USERNAME you set) with the password in the ADMIN_PASSWORD variable.
  • API access: send the LIGHTRAG_API_KEY value in an X-API-Key header, for example curl -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_KEY before you upload documents. The defaults are OpenAI gpt-5.4-mini and text-embedding-3-large (3072 dimensions). To use another provider, change LLM_BINDING, LLM_MODEL, LLM_BINDING_HOST and the matching EMBEDDING_* 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). Set WHITELIST_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 the LIGHTRAG_*_STORAGE variables.

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

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.

bento
1