Mealie Installation Guide on AlmaLinux 9 (Docker Compose + PostgreSQL + Nginx Reverse Proxy)
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
Windows
Use PowerShell, Windows Terminal, or PuTTY:
Once connected, you should be logged in as root.
Step 3: Install Docker and Docker Compose
3.1 Update the System
Updates all system packages to the latest versions.
3.2 Install Required Dependencies
Installs tools required for secure repository and package management.
3.3 Add Docker Repository
Adds the official Docker repository compatible with AlmaLinux 9.
Refresh repository metadata:
3.4 Install Docker Engine and Docker Compose Plugin
Installs Docker Engine and Docker Compose plugin.
Enable Docker at boot:
Start Docker service:
Verify Docker installation:
Verify Docker Compose availability:
Step 4: Configure Mealie with Docker Compose
4.1 Create Project Directory
4.2 Create Docker Compose File
Create a compose file:
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
4.4 Start Mealie
Download the required images:
Start the containers in detached mode:
Confirm containers are running:
Step 5: Configure Nginx Reverse Proxy
5.1 Install and Enable Nginx
Install Nginx:
Enable Nginx at boot:
Start Nginx:
Verify Nginx is running:
5.2 Create Nginx Configuration for Mealie
Create the config file:
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:
Reload Nginx:
Step 6: Verify the Installation
Open in browser:
Check container status:
Verify 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.