Deploy LightRAG Server

Graph RAG server with web UI, login on, and all storage in PostgreSQL

Deploy LightRAG Server

Database

Just deployed

/var/lib/postgresql

LightRAG

Just deployed

/data

Deploy and Host LightRAG Server on Railway

LightRAG is an open-source retrieval-augmented generation server from the HKU Data Intelligence Lab. It turns your documents into a knowledge graph of entities and relationships plus a vector index, and answers questions from both. It ships a web UI for uploading documents, exploring the graph and querying, a REST API, and an Ollama-compatible chat API.

About Hosting LightRAG Server

This template runs LightRAG 1.5.7 with every storage backend in one private PostgreSQL 18 database with pgvector: documents, chunks, the LLM cache, vectors, document status, and the knowledge graph in plain tables (no Apache AGE extension needed). LightRAG is the only public service. PostgreSQL has a 5 GB volume, and LightRAG keeps uploaded files on its own 5 GB volume.

Login is on from the first boot. The template generates an admin password, a token-signing secret and an API key, and closes the Ollama-compatible routes that upstream leaves open by default. A start check refuses to run LightRAG with weak or missing credentials. Enter your LLM provider key when you deploy; OpenAI works with the defaults, and any OpenAI-compatible API, Azure OpenAI, Gemini, Bedrock or Ollama can be configured.

After deployment, open the LightRAG domain and sign in as admin with the LIGHTRAG_ADMIN_PASSWORD variable. API clients send the LIGHTRAG_API_KEY variable as the X-API-Key header.

Why Deploy LightRAG Server on Railway

LightRAG's default setup keeps its graph and vectors in local files and starts with authentication off. This template puts all of it in PostgreSQL, so your index survives restarts and redeploys and can be backed up with standard tools, and it turns on access control with generated credentials. Both images are pinned by digest, and the whole path from document upload through entity extraction to a graph-backed answer was tested on Railway before publication.

Common Use Cases

  • Ask questions over a document collection with answers that combine graph relationships and passages.
  • Build a knowledge graph from reports, manuals or research papers and explore it in the web UI.
  • Give an application or agent a RAG backend through the REST API or the Ollama-compatible API.

Dependencies for LightRAG Server Hosting

The deployment uses LightRAG and PostgreSQL with pgvector, plus an LLM and embedding provider that you supply.

Deployment Dependencies

  • An API key for an LLM and embedding provider (OpenAI by default)
  • One public Railway domain, on LightRAG only
  • A 5 GB volume for PostgreSQL and a 5 GB volume for uploaded files
  • Generated admin password, token secret and API key

Indexing a document makes several LLM calls, so provider costs grow with the size of your corpus. Source: HKUDS/LightRAG, vector extension: pgvector.


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