LightRAG Docker & Self-Hosted Deployment

GitHub

[EMNLP2025] LightRAG: Simple and Fast Retrieval-Augmented Generation

40,271 stars Python Python 1 file ยท ~10,199 tokens #docling#genai#gpt#graphrag#knowledge-graph#large-language-models#llm#mineru
RAW Compose
1. Pull Image (GHCR) docker pull ghcr.io/hkuds/lightrag
2. Docker Run (1-Click Launch) docker run -d --name lightrag -p 9621:9621 --restart always ghcr.io/hkuds/lightrag:latest
3. Podman Run podman run -d --name lightrag -p 9621:9621 --restart always ghcr.io/hkuds/lightrag:latest
4. Skopeo Inspect (Zero-Pull Manifest) skopeo inspect docker://ghcr.io/hkuds/lightrag:latest
5. ORAS Pull (OCI Artifact) oras pull ghcr.io/hkuds/lightrag:latest
6. Compose Deployment docker compose up -d
docker-compose.podman.yml
Download .yml
# Podman-compatible compose file for LightRAG
#
# Usage:
#   podman-compose -f docker-compose.podman.yml up -d
#
# Key differences from docker-compose.yml:
#   - Uses top-level `restart` instead of `deploy.restart_policy`
#     (Podman does not support the deploy block for restart policies)
#   - No `extra_hosts` with `host-gateway` (Podman fails on this special
#     value; Podman auto-provides host.containers.internal for host access)
#   - When connecting to host services (e.g. LLM, embedding, rerank),
#     use `host.containers.internal` instead of `host.docker.internal`
#     in your .env binding host configuration

services:
  lightrag:
    image: ghcr.io/hkuds/lightrag:latest
    build:
      context: .
      dockerfile: Dockerfile
      tags:
        - ghcr.io/hkuds/lightrag:latest
    ports:
      - "${HOST:-0.0.0.0}:${PORT:-9621}:9621"
    volumes:
      - ./data/rag_storage:/app/data/rag_storage
      - ./data/inputs:/app/data/inputs
      - ./data/prompts:/app/data/prompts
      # Optional user-defined UI content bundle (welcome page, login blurb
      # and user agreement, query empty state, brand logo). Read-only: the
      # server only ever reads it. See docs/UserDefinedUI.md.
      #
      # Left commented out here, unlike docker-compose.yml: Podman is stricter
      # than Docker about a bind mount whose host source is missing, and this
      # feature is off by default, so an unconditional mount would make an
      # optional feature a startup prerequisite for everyone. Uncomment this
      # line together with UI_TEMPLATES_DIR below, after creating the
      # directory:  mkdir -p ./data/ui_templates
      # - ./data/ui_templates:/app/data/ui_templates:ro
      - ./config.ini:/app/config.ini
      - ./.env:/app/.env
    restart: on-failure:10
    environment:
      WORKING_DIR: "/app/data/rag_storage"
      INPUT_DIR: "/app/data/inputs"
      PROMPT_DIR: "/app/data/prompts"
      # The container must listen on 0.0.0.0 to be reachable via the published port.
      # SECURITY: set LIGHTRAG_API_KEY (or AUTH_ACCOUNTS with TOKEN_SECRET) in .env
      # so the exposed server is authenticated โ€” without it every endpoint is public.
      HOST: "0.0.0.0"
      PORT: "9621"
      # Activates the bundle mounted at /app/data/ui_templates. Leave it
      # commented out to keep the built-in LightRAG branding (the normal
      # state); uncomment it once ./data/ui_templates holds a complete
      # bundle. A set but invalid bundle makes the server refuse to start.
      # UI_TEMPLATES_DIR: "/app/data/ui_templates"