How to Install Mealie (Recipe Manager) on Rocky Linux 9
Introduction
This guide explains how to install Mealie on Rocky Linux 9 using Docker Compose, PostgreSQL 16, and Nginx.
Mealie will be accessed directly through the server IP address. This guide does not include Let’s Encrypt or SSL configuration.
Step 1: Connect to the Rocky Linux 9 Server
Linux / macOS
ssh root@YOUR_SERVER_IP
Windows
Use PowerShell, Windows Terminal, or PuTTY:
ssh root@YOUR_SERVER_IP
Once connected, you should be logged in as root.
Step 2: Install Docker and Docker Compose
2.1 Update the System
dnf update
Updates all system packages to their latest versions.
2.2 Install Required Dependencies
dnf install ca-certificates curl gnupg2 dnf-utils
Installs tools required to manage repositories securely.
2.3 Add Docker Repository
dnf config-manager --add-repo https://download.docker.com/linux/centos/docker-ce.repo
Adds the official Docker repository compatible with Rocky Linux 9.
dnf makecache
Refreshes repository metadata.
2.4 Install Docker Engine and Docker Compose
dnf install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin
Installs Docker Engine and Docker Compose plugin.
systemctl enable docker
Enables Docker at boot.
systemctl start docker
Starts the Docker service.
docker --version
Verifies Docker installation.
docker compose version
Verifies Docker Compose availability.
Step 3: Configure Mealie with Docker Compose
3.1 Create Project Directory
mkdir -p /opt/mealie cd /opt/mealie
3.2 Create Docker Compose File
vi docker-compose.yml
Paste the following configuration:
services:
db:
image: postgres:16
container_name: mealie-db
restart: unless-stopped
environment:
POSTGRES_DB: mealie
POSTGRES_USER: mealie
POSTGRES_PASSWORD: strong_db_password
volumes:
- /opt/mealie/db:/var/lib/postgresql/data
mealie:
image: ghcr.io/mealie-recipes/mealie:latest
container_name: mealie
restart: unless-stopped
ports:
- "127.0.0.1:9000:9000"
environment:
ALLOW_SIGNUP: "false"
DB_ENGINE: postgres
POSTGRES_DB: mealie
POSTGRES_USER: mealie
POSTGRES_PASSWORD: strong_db_password
POSTGRES_SERVER: db
POSTGRES_PORT: 5432
BASE_URL: http://YOUR_SERVER_IP
volumes:
- /opt/mealie/data:/app/data
depends_on:
- db
This configuration:
- Uses PostgreSQL 16 as the database backend
- Restricts Mealie access to localhost
- Prepares the application for reverse proxy access
3.3 Create Persistent Storage Directories
mkdir -p /opt/mealie/db
mkdir -p /opt/mealie/data
3.4 Start Mealie
docker compose pull
Downloads the latest Mealie and PostgreSQL images.
docker compose up -d
Starts the containers in detached mode.
docker compose ps
Confirms that the containers are running.
Step 4: Configure Nginx Reverse Proxy
4.1 Install and Enable Nginx
dnf install nginx
systemctl enable nginx
systemctl start nginx
systemctl status nginx
4.2 Create Nginx Configuration for Mealie
vi /etc/nginx/conf.d/mealie.conf
Paste:
server {
listen 80;
server_name _;
client_max_body_size 100M;
location / {
proxy_pass http://127.0.0.1:9000;
proxy_http_version 1.1;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header X-Forwarded-Proto $scheme;
}
}
4.3 Test and Reload Nginx
nginx -t
systemctl reload nginx
Step 5: Verify the Installation
Open your browser:
http://YOUR_SERVER_IP
Check container status:
docker compose ps
Verify Nginx status:
systemctl status nginx
If Mealie loads correctly through the server IP address, the installation is complete.
Conclusion
Mealie is now installed on Rocky Linux 9 using Docker Compose, PostgreSQL 16, and Nginx.
You can access Mealie through:
http://YOUR_SERVER_IP