Mealie Installation Guide on AlmaLinux 9 (Docker Compose + PostgreSQL + Nginx Reverse Proxy)

Estimated reading: 4 minutes 703 views

Introduction

Mealie is a self-hosted recipe manager designed for personal and family use. It provides a clean web interface for saving recipes, organizing them into categories, importing recipes from URLs, and managing meal planning.

In this guide, you will install Mealie on an AlmaLinux 9 server using Docker Compose with a PostgreSQL database. Mealie will run privately on localhost, and Nginx will be used as a reverse proxy to expose the application publicly.

This deployment is stable, secure, and easy to maintain.

Step 1: Requirements

Before starting, make sure you have:

  • An AlmaLinux 9 server

  • Root SSH access

  • Port 80 open/allowed (Firewall / Security Group)

  • Basic command-line knowledge


Step 2: Connect to the AlmaLinux 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 3: Install Docker and Docker Compose

3.1 Update the System

dnf update -y

Updates all system packages to the latest versions.


3.2 Install Required Dependencies

dnf install -y ca-certificates curl gnupg2 dnf-utils

Installs tools required for secure repository and package management.


3.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 AlmaLinux 9.

Refresh repository metadata:

dnf makecache

3.4 Install Docker Engine and Docker Compose Plugin

dnf install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Installs Docker Engine and Docker Compose plugin.

Enable Docker at boot:

systemctl enable docker

Start Docker service:

systemctl start docker

Verify Docker installation:

docker --version

Verify Docker Compose availability:

docker compose version

Step 4: Configure Mealie with Docker Compose

4.1 Create Project Directory

mkdir -p /opt/mealie
cd /opt/mealie

4.2 Create Docker Compose File

Create a compose file:

nano 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: https://mealie.example.com
volumes:
     - /opt/mealie/data:/app/data
depends_on:
     - db

This configuration:

  • Uses PostgreSQL 16 as the database backend

  • Restricts Mealie to localhost access only (127.0.0.1)

  • Prepares the application for reverse proxy usage

  • Stores persistent data in /opt/mealie/

  • Disables public account registration (ALLOW_SIGNUP: false)


4.3 Create Persistent Storage Directories

mkdir -p /opt/mealie/db
mkdir -p /opt/mealie/data

4.4 Start Mealie

Download the required images:

docker compose pull

Start the containers in detached mode:

docker compose up -d

Confirm containers are running:

docker compose ps

Step 5: Configure Nginx Reverse Proxy

5.1 Install and Enable Nginx

Install Nginx:

dnf install -y nginx

Enable Nginx at boot:

systemctl enable nginx

Start Nginx:

systemctl start nginx

Verify Nginx is running:

systemctl status nginx

5.2 Create Nginx Configuration for Mealie

Create the config file:

nano /etc/nginx/conf.d/mealie.conf

Paste the following configuration:

server {
    listen 80 default_server;;
    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;
    }
}

This configuration:

  • Listens on port 80 (HTTP)

  • Accepts requests without requiring a domain name

  • Proxies traffic to Mealie running on 127.0.0.1:9000

  • Allows large recipe/media uploads up to 100M


5.3 Test and Reload Nginx

Test configuration:

nginx -t

Reload Nginx:

systemctl reload nginx

Step 6: Verify the Installation

Open in browser:

http://YOUR_SERVER_IP

Check container status:

docker compose ps

Verify Nginx:

systemctl status nginx

If Mealie loads correctly in your browser, the installation is complete.


Conclusion

You have successfully installed Mealie on AlmaLinux 9 using Docker Compose, connected it to a PostgreSQL 16 database, and exposed it publicly through an Nginx reverse proxy.

This setup is stable and production-friendly:

  • Mealie is protected by running locally on 127.0.0.1

  • PostgreSQL runs as a separate persistent container

  • Nginx provides a clean public entry point

  • Easy upgrades can be done using Docker Compose commands

Your Mealie server is now ready for personal or family recipe management.

Share this Doc

Mealie Installation Guide on AlmaLinux 9 (Docker Compose + PostgreSQL + Nginx Reverse Proxy)

Or copy link

CONTENTS