How to Install Mealie (Recipe Manager) on Debian12

Estimated reading: 4 minutes 207 views

Introduction

Mealie is a self-hosted recipe manager that helps you organize recipes, create meal plans, manage shopping lists, and access your recipe collection from a web browser.

In this tutorial, you will install Mealie on a Debian 12 server using Docker Compose. PostgreSQL 16 will be used as the database backend, while Nginx will work as a reverse proxy. You will also secure the installation with a free Let’s Encrypt SSL certificate.

Before starting, make sure you have:

  • A Debian 12 server
  • Root access to the server
  • A domain pointing to the server’s public IP address
  • Ports 80 and 443 open

Step 1: Connect to the Debian 12 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 Mealie with Docker Compose

2.1 Update the System

apt update

Updates the package index.

apt upgrade -y

Upgrades all installed packages.

2.2 Install Required Dependencies

apt install ca-certificates curl gnupg lsb-release

Installs tools required for secure repository management.

mkdir -p /etc/apt/keyrings

Creates a directory for trusted GPG keys.

2.3 Add Docker Repository

curl -fsSL https://download.docker.com/linux/debian/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg

Downloads and registers Docker’s GPG key.

echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/debian bookworm stable" > /etc/apt/sources.list.d/docker.list

Adds the Docker repository for Debian 12.

apt update

Refreshes package lists.

2.4 Install Docker and Docker Compose

apt install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin

Installs Docker Engine and Docker Compose plugin.

docker --version

Verifies Docker installation.

docker compose version

Verifies Docker Compose availability.

Step 3: Configure Mealie

3.1 Create Project Directory

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

3.2 Create Docker 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 setup:

  • Uses PostgreSQL 16 as the database backend
  • Restricts Mealie access to localhost
  • Prepares the app for reverse proxy and HTTPS

3.3 Create Persistent Storage Directories

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

3.4 Start Mealie

docker compose pull

Pulls 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 Check Nginx

apt install nginx
systemctl status nginx

4.2 Create Nginx Virtual Host

nano /etc/nginx/sites-available/mealie

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 Enable the Site

ln -s /etc/nginx/sites-available/mealie /etc/nginx/sites-enabled/
rm /etc/nginx/sites-enabled/default
nginx -t
systemctl reload nginx

Step 5: Verify the Installation

Open your browser:

https://YOUR_SERVER_IP

Check container status:

docker compose ps

Verify Nginx:

systemctl status nginx

If Mealie loads correctly over HTTP. the installation is complete.

Conclusion

You have successfully installed Mealie on Debian 12 using Docker Compose, PostgreSQL 16, and Nginx.

Mealie runs inside a Docker container and listens only on the local server interface. Nginx securely forwards incoming web traffic to Mealie.

You can now open your IP in a browser and begin managing your recipes, meal plans, and shopping lists through the Mealie web interface.

Share this Doc

How to Install Mealie (Recipe Manager) on Debian12

Or copy link

CONTENTS