Install
LocalRAG is installed from its source code on GitHub. The current release is v0.1.0. There are two ways to run it:
- Docker Compose (recommended): one command starts LocalRAG and Ollama in two containers.
- pip: install LocalRAG as a Python package and use an Ollama you run yourself.
Both work on Linux, on x86-64 and arm64.
Option A: Docker
What you need
- Docker with the Compose plugin (
docker compose). - Git.
- Disk space for the models: the answer model you pull into Ollama, and the embedding model, about 130 MB.
Steps
Get the source code:
bashgit clone https://github.com/Dhiva-Labs/localrag.git cd localragBuild and start both containers in the background:
bashdocker compose up --build -dThe first build downloads Python packages and can take several minutes.
Download the answer model into the Ollama container. You do this once:
bashdocker compose exec ollama ollama pull llama3.2Open
http://localhost:8090in your browser.
Your documents, the vector store and the downloaded embedding model live in a Docker volume called localrag-data. The Ollama models live in a volume called ollama. Both survive docker compose down, but docker compose down -v deletes them.
WARNING
The Compose file publishes port 8090 on all of the computer's network connections, and LocalRAG has no login. Anyone who can reach that port can read answers from your documents and delete them. On a shared network, block the port with a firewall, or change the ports line in docker-compose.yml to "127.0.0.1:8090:8090" so only your own computer can connect.
Option B: pip
What you need
- Python 3.10 or newer.
- Ollama installed and running.
Steps
Download the answer model into Ollama, once:
bashollama pull llama3.2Get the source code:
bashgit clone https://github.com/Dhiva-Labs/localrag.git cd localragOn x86-64, install the CPU-only build of PyTorch first. This avoids several gigabytes of graphics card libraries:
bashpip install torch --index-url https://download.pytorch.org/whl/cpuInstall LocalRAG:
bashpip install .Start the server:
bashlocalrag serveOpen
http://localhost:8090in your browser.
With pip, LocalRAG keeps its data in a folder called data inside the folder where you start it. Start it from the same folder each time, or set LOCALRAG_DATA_DIR. See Configuration.
TIP
Use a Python virtual environment (python3 -m venv .venv and source .venv/bin/activate) so LocalRAG's packages do not mix with your system's.
The first document downloads a model
The first time you add a document, LocalRAG downloads the embedding model, about 130 MB. After that it works without a network connection.
Check that it works
Open http://localhost:8090/api/health. A working server returns something like:
{"status": "ok", "chroma": true, "ollama": true, "model": "llama3.2", "docs": 0}If ollama is false, LocalRAG cannot reach Ollama. See Troubleshooting.