Install with Docker Compose¶
This page installs the RAG Platform on one host with Docker Compose. The deployment files are in the rag-docker repository at the tag matching the selected version.
Prerequisites¶
dockerwith the Compose plugin on the host machine- Access to an OpenAI-compatible inference provider (base URL and token) with an embedding model that returns 4096-dimensional vectors, and a generation model
bash,opensslandpython3on any machine, to create API keys
Get the deployment files¶
Clone the repository and check out the tag:
git clone --branch 1.1.0 https://gitlab.git.nrw/ki-expertisezentrum.nrw/apps/rag/rag-docker.git
cd rag-docker
The image versions are pinned in docker-compose.yml. Don't edit them there! Instead, to run a
different image, see Upgrade to 1.1.
Configure¶
Copy the example environment file and fill it in:
At minimum, set the following required variables:
- Gateway database credentials:
POSTGRES_PASSWORD,POSTGRES_USER,POSTGRES_DB - RAG database credentials:
DB_USER,DB_PASSWORD(Yes, these are confusing in this version...) - Message broker credentials:
MB_USER,MB_PASSWORD - Inference provider in RAG-Web (chat completions):
EndpointOptions__Base,EndpointOptions__Token. EndEndpointOptions__Basewith/(for examplehttps://provider.example/api/v1/). Without it, RAG Web drops the last path segment, and completions and/v1/modelsfail with404. - Inference provider in RAG-System (embeddings and generation):
DEFAULT_EMB_BASE_URL,DEFAULT_EMB_MODEL_VERSION,DEFAULT_EMB_TOKEN,DEFAULT_GEN_BASE_URL,DEFAULT_GEN_MODEL_VERSION(Recommended: Use a generation model with vision-processing capabilities, such as Mistral-4),DEFAULT_GEN_TOKEN FilesOptions__Token: the service credential RAG Web presents to RAG System. Choose a long random value.DEFAULT_TENANT_ID: recommended. Set it to a fixed UUID (version 4).
For a detailed breakdown, check the configuration reference.
Start¶
Compose starts the databases, waits for them to become healthy, runs both
migration jobs, and then starts the services. Only web-gateway publishes a port:
WEB_GATEWAY_HOST_PORT (default 8000) on the host, mapped to port 8080 in the
container. Put a TLS-terminating reverse proxy in front of it before you expose it
to other machines.
Check the installation¶
The response names the running RAG Web version and the product release:
/version is an exception in that it doesn't need an API key!
Next steps¶
- Create a tenant and an API key.
- Hand the base URL and the key to the client developer, together with the API quickstart.
Use existing infrastructure¶
You can replace a bundled dependency with one you already run:
- Gateway database: point
ConnectionStrings__DefaultConnectionat your PostgreSQL server. Theweb-gateway-migrationsjob still applies the migrations. You can also take the migration script out of that image and run it yourself. - Valkey: set
Valkey__ConnectionString. - RAG System: if RAG System runs elsewhere, set
FilesOptions__Endpoint.
The RAG database must use the rag-system/postgres image or provide the same
extensions (pgvector and pg_search).