Self-host LightRAG with Levelrail

Graph based retrieval augmented generation server with a web UI and API. Runs on local file storage; point it at a model provider with the LLM and embedding settings.

  • AuthorHKUDS
  • LicenceMIT
  • Memory1 GiB
  • Services1

How to self-host LightRAG

  1. Pull the images

    One image is pulled on your server.

    Show images
    • ghcr.io/hkuds/lightrag:v1.5.7
  2. Create the app

    One service starts in a single Compose app, with 2 named volume mounts for your data, on port 9621.

  3. Fill in the secrets

    1 secret is generated and stored encrypted, 11 settings are preset, you do not have to fill in anything.

  4. Open it

    Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.

After the first start

  • Set the LLM and embedding settings for your provider, then open the address to upload documents and query them. The generated API key protects the API.

LightRAG requirements

Memory
About 1 GiB
Architectures
amd64 unknown, arm64 unknown
Ports
9621
Domain
Optional, an sslip.io address is used without one
Settings
none to fill in
License
MIT, permissive license
  • Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.

Install Levelrail first

On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then LightRAG. New to Levelrail? Install it on a fresh VPS first.

docker pull ghcr.io/glincker/levelrail:latest

Then levelrail-cli login --device. See Getting started and the LightRAG docs page.

Deploy LightRAG your way

Every format below deploys the same pinned images. Pick the one that fits how you work.

Deploy LightRAG from the CLI

Add --domain SERVICE=HOST to serve a service on your own domain, for example --domain lightrag=app.example.com.

levelrail-cli templates install lightrag --name my-lightrag

Deploy LightRAG with the API

Create a token in the dashboard first. Name, env and domains are the request fields.

curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
  https://levelrail.example.com/api/v1/service-templates/lightrag/install \
  -d '{
    "name": "my-lightrag"
  }'

LightRAG configuration

LightRAG services

ServiceImagePortsVolumes
lightrag ghcr.io/hkuds/lightrag:v1.5.7 9621 rag -> /app/data/rag_storageinputs -> /app/data/inputs

LightRAG environment variables

VariableServiceValue
EMBEDDING_BINDING lightrag Preset by the template
EMBEDDING_BINDING_API_KEY lightrag Preset by the template
EMBEDDING_BINDING_HOST lightrag Preset by the template
EMBEDDING_DIM lightrag Preset by the template
EMBEDDING_MODEL lightrag Preset by the template
HOST lightrag Preset by the template
LIGHTRAG_API_KEY lightrag Generated at deploy
LLM_BINDING lightrag Preset by the template
Show all 12 variables
  • LLM_BINDING_API_KEYlightragPreset by the template
  • LLM_BINDING_HOSTlightragPreset by the template
  • LLM_MODELlightragPreset by the template
  • PORTlightragPreset by the template

Ports and volumes

Ports
9621
Volumes
2 named mounts: rag -> /app/data/rag_storage, inputs -> /app/data/inputs

LightRAG FAQ

How much memory does LightRAG need?

The catalog lists about 1 GiB of memory for LightRAG.

Does LightRAG run on arm64?

For LightRAG, arm64 support is not confirmed; amd64 is unknown.

What licence is LightRAG under?

LightRAG is licensed under MIT, which is permissive, with few conditions on reuse.

Does LightRAG need configuration before it starts?

No. The template fills in its own defaults and generates secrets at deploy time.

Which ports does LightRAG use?

LightRAG listens on port 9621 inside the stack.

Where does LightRAG keep its data?

In named volumes: rag mounted at /app/data/rag_storage and inputs mounted at /app/data/inputs.

Can I deploy LightRAG on Dokploy or Dokku?

The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for LightRAG, so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image ghcr.io/hkuds/lightrag:v1.5.7 is what you deploy there.

levelrail-cli templates install lightrag --name my-lightrag