Skip to content

Mealie

Mealie is a self hosted recipe manager and meal planner (with a RestAPI backend and a reactive frontend application built in Vue for a pleasant user experience) for the whole family.

Easily add recipes into your database by providing the url1, and mealie will automatically import the relevant data or add a family recipe with the UI editor.

Mealie Screenshot

Mealie also provides a secure API for interactions from 3rd party applications.

Why does my recipe manager need an API?

An API allows integration into applications like Home Assistant that can act as notification engines to provide custom notifications based of Meal Plan data to remind you to defrost the chicken, marinade the steak, or start the CrockPot. See the official docs for more information. Additionally, you can access any available API from the backend server. To explore the API spin up your server and navigate to http://yourserver.com/docs for interactive API documentation.

Ingredients

Ingredients

Already deployed:

Related:

  • Traefik Forward Auth to secure your Traefik-exposed services with an additional layer of authentication

Preparation

Setup data locations

First we create a directory to hold the data which mealie will serve:

mkdir /var/data/mealie

Create environment

There's only one environment variable currently required (db_type), but let's create an .env file anyway, to keep the recipe consistent and extensible.

mkdir /var/data/config/mealie
cat << EOF > /var/data/config/mealie/mealie.env
db_type=sqlite
EOF

Setup Docker Swarm

Create a docker swarm config file in docker-compose syntax (v3), something like this:

Tip

I automatically and instantly share (with my sponsors) a private "premix" git repository, which includes necessary docker-compose and env files for all published recipes. This means that sponsors can launch any recipe with just a git pull and a docker stack deploy 👍.

🚀 Update: Premix now includes an ansible playbook, so that sponsors can deploy an entire stack + recipes, with a single ansible command! (more here)

version: "3.2" # https://docs.docker.com/compose/compose-file/compose-versioning/#version-3

services:
  app:
    image: hkotel/mealie:latest
    env_file: /var/data/config/mealie/mealie.env
    volumes:
      - /var/data/mealie:/app/data
      - /etc/localtime:/etc/localtime:ro
    deploy:
      labels:
        # traefik
        - traefik.enable=true
        - traefik.docker.network=traefik_public

        # traefikv1
        - traefik.frontend.rule=Host:mealie.example.com
        - traefik.port=9000
        - traefik.frontend.auth.forward.address=http://traefik-forward-auth:4181
        - traefik.frontend.auth.forward.authResponseHeaders=X-Forwarded-User
        - traefik.frontend.auth.forward.trustForwardHeader=true        

        # traefikv2
        - "traefik.http.routers.mealie.rule=Host(`mealie.example.com`)"
        - "traefik.http.routers.mealie.entrypoints=https"
        - "traefik.http.services.mealie.loadbalancer.server.port=9000"
        - "traefik.http.routers.mealie.middlewares=forward-auth"

    networks:
      - traefik_public

networks:
  traefik_public:
    external: true

Serving

Mealie is served!

Launch the mealie stack by running docker stack deploy mealie -c <path -to-docker-compose.yml>. The first time you access Mealie at https://YOUR FQDN, you might think there's something wrong. There are no recipes, and no instructions. Hover over the little plus sign at the bottom right, and within a second, two icons appear. Click the "link" icon to import a recipe from a URL:

Mealie Screenshot

Chef's notes 📓


  1. I scraped all these recipes from https://www.food.com/search/penguin 

  2. If you plan to use Mealie for fancy things like an early-morning alarm to defrost the chicken, you may need to customize the Traefik Forward Auth rules, or even remove them entirely, for unauthenticated API access. 

  3. If you think Mealie is tasty, encourage the developer 🧑‍🍳 to keep on cookin', by sponsoring him ❤ 

Tip your waiter (sponsor) 👏

Did you receive excellent service? Want to make your waiter happy? (..and support development of current and future recipes!) Sponsor me on Github / Patreon, or see the contribute page for more (free or paid) ways to say thank you! 👏

Flirt with waiter (subscribe) 💌

Want to know now when this recipe gets updated, or when future recipes are added? Subscribe to the RSS feed, or leave your email address below, and we'll keep you updated. (*double-opt-in, no monkey business, no spam)

Notify me 🔔

Be the first to know when recipes are added / improved!

    We won't send you spam. Unsubscribe at any time. No monkey-business.

    Powered By ConvertKit

    Your comments? 💬


    Last update: February 4, 2021