Ubuntu Deployment Guide

MariaDB AI RAG - Ubuntu Native Deployment Guide

Deploy MariaDB AI RAG .deb package directly on Ubuntu (without Docker)


Quick Start

# 1. Install MariaDB
sudo apt update && sudo apt install -y mariadb-server mariadb-client
sudo systemctl start mariadb && sudo systemctl enable mariadb

# 2. Secure MariaDB (set root password during setup)
sudo mysql_secure_installation

# 3. Create database
sudo mariadb -u root -p <<EOF
CREATE DATABASE kb_chunks CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;
EXIT;
EOF

# 4. Install MariaDB AI RAG
sudo apt install -y ./ai-nexus.deb

# 5. Configure (update GEMINI_API_KEY)
cp /opt/rag-in-a-box/config/config.env.template /path/to/config.env
nano /path/to/config.env

# 6. Start services in their own terminals
/opt/rag-in-a-box/bin/rag-api --config /path/to/config.env
CONFIG_FILE=/path/to/config.env /opt/rag-in-a-box/bin/mcp-server

# 7. Verify
curl http://localhost:8000/health

Prerequisites

System Requirements

  • OS: Ubuntu 22.04 LTS or 24.04 LTS (x86_64)

  • CPU: 4+ cores (8+ recommended)

  • RAM: 8+ GB (16+ recommended)

  • Storage: 20+ GB free

  • Access: Root/sudo privileges

Required

  • Google Gemini API Key: Get from https://makersuite.google.com/app/apikey

Verify System


Step 1: Install MariaDB


Step 2: Secure MariaDB

Follow prompts:

  • Enter current password for root: [Press Enter]

  • Switch to unix_socket authentication? n

  • Change the root password? Y

    • New password: [Choose a secure password]

    • Re-enter: [Same password]

  • Remove anonymous users? Y

  • Disallow root login remotely? Y

  • Remove test database? Y

  • Reload privilege tables? Y


Step 3: Create Database

In MariaDB shell:


Step 4: Configure MariaDB

Add under [mysqld] section:

Save and restart:


Step 5: Install MariaDB AI RAG Package

Verify installation:


Step 6: Configure MariaDB AI RAG

Update these essential settings:

Save: Ctrl+X, Y, Enter


Step 7: Start Services in their own terminals

Step 8: Verify Deployment

Check listening ports:

Should show LISTEN on both ports

Test Health Endpoints

View Logs

Expected log messages:


Step 9: Test Functionality

Generate Authentication Token

Test Document Upload

Test RAG Query

Verify Database

In MariaDB:


Access Points

After successful deployment:

  • RAG API Swagger UI: http://<server-ip>:8000/docs

  • RAG API Health: http://<server-ip>:8000/health

  • MCP Server: http://<server-ip>:8002/mcp

  • MCP Health: http://<server-ip>:8002/health

Get server IP:


Troubleshooting

Services Won't Start

Check logs in the terminal windows

Common causes:

  1. MariaDB not running

  1. Configuration errors

  1. Port already in use

  1. Permission issues

Database Connection Fails

Authentication Fails

API Key Invalid

Port Already in Use

Out of Memory


Maintenance

Daily Operations

Backup Database

Update Configuration

Update MariaDB AI RAG

Optimize Database


Uninstall


Security Best Practices

Change Default Passwords

Update config:

Generate New Secret Keys

Configure Firewall

Restrict Database Access

Update config:


Quick Reference

Essential Commands

File Locations

Service Dependencies

Start order: MariaDB → RAG API → MCP Server Stop order: MCP Server → RAG API → MariaDB


Architecture Overview


Performance Tuning

MariaDB Optimization

System Resources


Deployment Complete! 🎉

Your MariaDB AI RAG is now running natively on Ubuntu.

Next Steps:

  1. Access Swagger UI: http://<server-ip>:8000/docs

  2. Generate authentication token

  3. Upload test documents

  4. Start querying with RAG

For support:

  • Check logs

  • Verify config: nano /path/to/config.env

  • Test health: curl http://localhost:8000/health

This page is: Copyright © 2025 MariaDB. All rights reserved.

Last updated

Was this helpful?