Installation
Which method to choose
Use the RPM on RHEL/AlmaLinux/Rocky Linux, the DEB on Ubuntu, and Docker for evaluation or container platforms. Build from source when you are developing or need a custom build.
RPM Package (Recommended)
For RHEL, AlmaLinux, Rocky Linux 9/10, download from GitHub Releases:
# EL9 (RHEL/AlmaLinux/Rocky Linux 9)
sudo rpm -i mygramdb-*.el9.x86_64.rpm
# EL10 (RHEL/AlmaLinux/Rocky Linux 10)
sudo rpm -i mygramdb-*.el10.x86_64.rpmThis installs:
/usr/bin/mygramdb- Server binary/usr/bin/mygram-cli- CLI client/etc/mygramdb/config.yaml.example- Configuration template- systemd service file
Create and edit the service configuration before starting it:
sudo cp /etc/mygramdb/config.yaml.example /etc/mygramdb/config.yaml
sudoedit /etc/mygramdb/config.yaml
sudo systemctl enable --now mygramdbDocker
Prepare a config file before starting
For production use under Docker, mount a config file containing the MySQL connection, replication settings, target tables, network.allow_cidrs, and api.admin_token. The mounted config must set api.tcp.bind: 0.0.0.0 and, when HTTP is enabled, api.http.bind: 0.0.0.0 so the published ports can reach the container. Keep the loopback host mappings below and a restrictive CIDR allowlist; expose the service through a reverse proxy only after setting an admin token. Simply starting the image does not complete the initial sync of existing data.
docker pull ghcr.io/libraz/mygram-db:latest
docker run -d \
-p 127.0.0.1:11016:11016 \
-p 127.0.0.1:8080:8080 \
-v /path/to/config.yaml:/etc/mygramdb/config.yaml \
ghcr.io/libraz/mygram-db:latestAvailable tags:
ghcr.io/libraz/mygram-db:1.10.0ghcr.io/libraz/mygram-db:latest
Supports both linux/amd64 and linux/arm64.
DEB Package
For Ubuntu 22.04 (Jammy) and 24.04 (Noble):
# x86_64
sudo dpkg -i mygramdb_*_amd64.deb
# ARM64
sudo dpkg -i mygramdb_*_arm64.debStart the service:
sudo systemctl enable --now mygramdbBuild from Source
Prerequisites
RHEL/AlmaLinux/Rocky Linux:
sudo dnf install -y gcc-c++ cmake mysql-devel libicu-develUbuntu/Debian:
sudo apt-get update
sudo apt-get install -y pkg-config libmysqlclient-dev libicu-dev cmake g++macOS:
brew install cmake mysql-client@8.4 icu4c pkg-configBuild
git clone https://github.com/libraz/mygram-db.git
cd mygram-db
makeInstall System-wide
sudo make installRunning as a Service
If you built from source (RPM already includes the service):
Create User
sudo useradd -r -s /bin/false mygramdbSetup Directories
sudo mkdir -p /etc/mygramdb /var/lib/mygramdb/dumps
sudo chown -R mygramdb:mygramdb /var/lib/mygramdbInstall systemd Service
sudo cp support/systemd/mygramdb.service /etc/systemd/system/
sudo systemctl daemon-reload
sudo systemctl enable --now mygramdbCheck Status
sudo systemctl status mygramdb
sudo journalctl -u mygramdb -fVerify Installation
What is still needed after installing
Installing the package or pulling the image does not load any searchable data. After configuring the MySQL connection, the target tables, and the allowed network range, run SYNC <table> once to build the index from existing rows.
mygramdb --help
mygram-cli --helpSecurity Note
DANGER
MygramDB refuses to run as root for security. Always run it as a dedicated non-privileged user.
Next Steps
- Configuration - Configure your instance
- Query Guide - Learn the search syntax