Deployment
Deploy MariaDB AI RAG as a Docker stack by downloading the compose file and config template, setting a license key and model credentials, then launching with docker compose up.
MariaDB AI RAG is an all-in-one, enterprise-ready solution that handles the entire Retrieval-Augmented Generation (RAG) pipeline, including document parsing with layout extraction, chunking, embedding generation, and easy-to-use retrieval APIs backed by hybrid search (vector + full-text search), with optional reranking before sending the relevant context to a foundation model for answer generation.
MariaDB AI RAG deployed as a containerized stack using Docker. For a quick evaluation, you can also leverage a MariaDB vector store deployed in a container alongside the AI RAG stack to get an end-to-end setup faster.
As of AI RAG 1.1 release, native binary-based deployments (such as .deb or .rpm packages) are no longer available.
Prerequisites
Ensure your environment meets the following requirements before starting the deployment:
Hardware: Minimum 4 CPU cores, 8 GB RAM, and 20 GB free disk space.
Operating System: 64-bit Linux
Software: Docker Engine and Docker Compose must be installed.
Mandatory Credentials:
MariaDB License Key: A valid key is required for the application to pass the startup check.
Model Provider API Keys: Credentials for chosen model providers (e.g., Google Gemini or OpenAI).
Database: A MariaDB 11.8+ instance is required for native vector search support.
Setup & Launch Instructions
Obtain Configuration Files
Download the following essential files from the public AI RAG GitHub repository and place them in your new folder:
docker-compose.yml: The blueprint defining all services in the stack.config.env.template: The template containing all necessary environment variables.
Obtain the MariaDB License Key
The application performs a mandatory validation check at startup and will fail to start if this key is missing, invalid, or expired. Each license is valid for 30 days from the day of generation.
To get your license, follow these steps:
Navigate to the MariaDB License Portal.
Login with your MariaDB ID.

Click Get License under the RAG Trial card.

Click Generate License. You may then View, Copy, or Download the license information.

Paste this key into your
config.env.securefile asMARIADB_LICENSE_KEY.
MariaDB trial license keys are valid for 30 days from the date of issue.
Configure Database and Security Keys
For a full breakdown of every variable in config.env.secure, see the AI-RAG Configuration Guide.
Open config.env.secure in a text editor to set your environment variables.
Security & Unified Authentication
To enable unified authentication across the API and MCP server, set these three variables to the same secure string
SECRET_KEYJWT_SECRET_KEYMCP_AUTH_SECRET_KEY
Secure String Generation
You may generate a secure 32-character string to assign to the three variables using openssl rand -hex 32
Using a unique, randomly generated key prevents "replay attacks" and ensures that only your authorized MCP Gateway can trigger heavy-lifting tasks in the RAG API.
Model Provider Configuration
Specify the models and API keys for your chosen providers.
LLM Settings
LLM_PROVIDER: Choose your provider (e.g.,gemini,openai, orollama).LLM_MODEL: The specific model name (e.g.,gemini-2.5-flash-lite).GEMINI_API_KEYorOPENAI_API_KEY: Your provider-specific API key.
Embedding Settings
EMBEDDING_PROVIDER: Provider for vectorizing text (e.g.,openai,gemini).embedding_model: Specific embedding model (e.g.,gemini-embedding-001).
Model Provider Setup Examples
Choose your preferred provider by configuring the following variables:
Reranking & Search Accuracy
Reranking ensures that the most relevant document chunks are sent to the AI model, significantly reducing "hallucinations".
RERANKING_ENABLED: Set totrueto activate the secondary search pass.RERANKING_MODEL_TYPE: Defaults toflashrank(local/CPU efficient). Cloud options includecohere.RERANKING_MODEL_NAME: The specific model used for scoring. Default:ms-marco-MiniLM-L-12-v2.
Database Configuration
These variables define how the application connects to your MariaDB 11.8+ instance.Common Connection Variables:
DB_PORT: The port your database is listening on (Default:3306).DB_USER: The username for database access.DB_PASSWORD: The password for the specified user.DB_NAME: The name of the database schema.
SSL Mandatory for Cloud Databases
For cloud-hosted instances, you must set DB_SSL_ENABLED=true to ensure secure, encrypted communication over the public internet.
Update the DB_HOST variables based on your database location:
Set DB_HOST=mariadb. The hostname must match the container name provisioned with Docker Compose. Also set your preferred DB_USER, DB_PASSWORD, and DB_NAME for database that will be provisioned along AI RAG stack.
Set DB_HOST to your server IP (e.g., 192.168.1.100). Also set DB_USER, DB_PASSWORD, and DB_NAME for AI RAG to access your database.
Set DB_HOST to your cloud database URL. Also set DB_USER, DB_PASSWORD, and DB_NAME for AI RAG to access your database.
Last updated
Was this helpful?

