How to Install Tandoor Recipes on a VPS with Docker: Recipes, Meal Plans, and Shopping Lists


Your family's best recipes are scattered everywhere: some saved as bookmarks you never open again, some as screenshots in your phone gallery, and some only half-remembered — "was it two cloves of garlic, or three?" When it is time to cook, you spend longer hunting down the recipe than cooking it. A weekly meal plan never happens either, because putting one together means opening five different sources and writing a shopping list by hand.

Tandoor Recipes pulls all of that into one place you control. This open source Django app stores recipes, imports them straight from cooking websites by URL, builds meal plans, and turns those plans into shopping lists — with cookbooks and separate spaces for each member of the household. This guide installs it on a VPS with Docker Compose following the official docs at docs.tandoor.dev, with PostgreSQL and Nginx with HTTPS.

Prerequisites

  • A Linux VPS with Docker and Docker Compose v2 installed.
  • SSH access to the VPS with sudo rights.
  • One domain already pointing at the VPS IP if you want HTTPS access, for example recipes.example.com. This guide uses that domain as an example; replace it with your own. Without a domain yet, you can still test the install at http://YOUR-VPS-IP:8080.

Check Docker and Compose first:

docker --version
docker compose version

Expected result: both commands print version numbers without errors.

Step 1: create the working folder and download the config template

Create a folder at /opt/tandoor and move into it:

sudo mkdir -p /opt/tandoor
cd /opt/tandoor

Tandoor keeps all of its configuration in a .env file, and the project ships an official template for it in the repository. Download that template straight from the official repository, as instructed on docs.tandoor.dev:

sudo wget https://raw.githubusercontent.com/vabene1111/recipes/develop/.env.template -O .env

Expected result: a .env file appears in /opt/tandoor. Its initial contents hold only the required options: SECRET_KEY, TZ, ALLOWED_HOSTS, and the POSTGRES_* settings.

Step 2: fill in the three required values in .env

Open .env for editing:

sudo nano .env

Three values are mandatory — the official documentation stresses all three:

  1. SECRET_KEY — Django's secret key. Generate a random one with this command (run it in the terminal, then paste the result into .env):

bash base64 /dev/urandom | head -c50

Expected result: a single line of 50 random characters. This command is exactly the one shown in the official .env template.

  1. ALLOWED_HOSTS — fill in your domain, for example recipes.example.com. If you are testing by IP first, put the VPS IP here. Django rejects requests from hosts not listed here, so a wrong value will make Tandoor answer with an error — not because the install is broken, but because the host has not been allowed yet.

  2. POSTGRES_PASSWORD — the password for the PostgreSQL database. Make it long and random, for example with openssl rand -base64 24.

Also adjust TZ to your timezone, for example TZ=Asia/Jakarta (the shipped template uses Europe/Berlin). Leave the other template values as they are — DB_ENGINE=django.db.backends.postgresql, POSTGRES_HOST=db_recipes, POSTGRES_DB=djangodb, POSTGRES_PORT=5432, POSTGRES_USER=djangouser — because they already match the Compose file you will write in the next step.

When done, read through .env once more and make sure neither SECRET_KEY nor POSTGRES_PASSWORD is empty. Tandoor will not run correctly if either one is blank.

Step 3: write the Compose file

Create a compose.yml file:

sudo nano compose.yml

Fill it with the following configuration, which follows the "Plain" example on docs.tandoor.dev — with one adjustment: the host port changes from 80:80 to 127.0.0.1:8080:80, so Tandoor only listens on localhost and the host's Nginx serves the internet (the same pattern the docs' "Apache proxy" example uses):

services:
  db_recipes:
    restart: always
    image: postgres:16-alpine
    volumes:
      - ./postgresql:/var/lib/postgresql/data
    env_file:
      - ./.env

  web_recipes:
    restart: always
    image: vabene1111/recipes
    env_file:
      - ./.env
    ports:
      - 127.0.0.1:8080:80
    volumes:
      - staticfiles:/opt/recipes/staticfiles
      - ./mediafiles:/opt/recipes/mediafiles
    depends_on:
      - db_recipes

volumes:
  staticfiles:

A quick walk through each part: the db_recipes service is PostgreSQL 16 (the lightweight Alpine variant) — Tandoor 2 uses Postgres as its database, and the official docs use the postgres:16-alpine image in every example. The web_recipes service is the Tandoor app itself from the vabene1111/recipes image (latest tag when none is given); inside that container Nginx already serves the app on port 80, so no extra web server is needed in the stack. The ./mediafiles volume holds recipe photos and uploads, the ./postgresql holds the database data, and both belong in your backups. depends_on makes sure the database starts before the app.

One warning from the official docs worth noting: Tandoor offers no way to downgrade the database to an older version. If you are ever tempted by the beta or develop tags, remember that going back is not as simple as pulling a tag — for an install you rely on daily, stay on latest.

Step 4: start it and wait for the migrations to finish

Start the stack:

sudo docker compose up -d
sudo docker compose ps

Expected result: both containers, db_recipes and web_recipes, show as running (or Up). Now, wait. The official docs put it firmly: always wait at least 2–3 minutes after the very first start, since migrations take some time. Do not open the browser yet and panic at an error page — unfinished migrations are the most common cause of errors in the first minute.

While waiting, check the app logs:

sudo docker compose logs --tail=30 web_recipes

Expected result: log lines showing migrations running and then finishing, with no database connection errors. After 2–3 minutes, test from inside the VPS:

curl -s -o /dev/null -w "%{http_code}\n" http://localhost:8080

Expected result: the number 200 or 302 (a redirect to the login page). If you get 000, the container is not ready yet or port 8080 is already in use by another app — see Troubleshooting below.

Step 5: create the superuser account on the setup page

Open http://YOUR-VPS-IP:8080 in a browser. On a fresh install, Tandoor shows a setup page — not the regular login page. On that page, fill in the username and password you want, then click the button to create the superuser account. This account becomes your first admin.

After logging in, Tandoor asks you to create a Space — a workspace holding your recipes, meal plans, and shopping lists. Name it after your home or family, for example "Family Kitchen". The space is Tandoor's sharing unit: you can invite other household members into the same space, and each person can keep a space of their own if they wish.

If the setup page does not appear and you see the regular login page instead, you can still create a superuser with the official command from the Tandoor FAQ: enter the container, activate the virtual environment, then run createsuperuser:

sudo docker compose exec web_recipes sh
source venv/bin/activate
python manage.py createsuperuser

Answer the prompts (username, email, password), then leave the container with exit. This route is also handy if you ever lose admin access and need a new admin account.

Step 6: import your first recipe from a URL and build a meal plan

This is the feature that sets Tandoor apart from a folder of bookmarks: importing recipes from cooking sites. In Tandoor, open the recipe creation menu and choose import from URL. Paste the address of a recipe from a cooking site you like. Tandoor reads the page and fills in the recipe name, ingredients, steps, and cooking time automatically.

Check the result: sometimes ingredient amounts or a step or two need tidying, because every site writes recipes in a different format. Fix what needs fixing, save, then try the meal plan: open Meal Plan and assign the newly imported recipe to dinner two days from now. Finally, open the Shopping List — Tandoor has already built it from the ingredients in your meal plan, with the quantities you need. These three moves — import, plan, shop — are Tandoor's daily flow, and you can try all of them within ten minutes of finishing the install.


Step 7: put Nginx with HTTPS in front

Do not leave Tandoor on plain HTTP at port 8080 if it will be reachable from the internet. Create the file /etc/nginx/sites-available/tandoor:

server {
    listen 80;
    server_name recipes.example.com;

    location / {
        proxy_pass http://127.0.0.1:8080;
        proxy_http_version 1.1;
        proxy_set_header Host $http_host;
        proxy_set_header X-Forwarded-Proto $scheme;
        proxy_set_header X-Real-IP $remote_addr;
        proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
    }
}

Note the two headers the official Tandoor docs require: Host $http_host and X-Forwarded-Proto $scheme. Without them, Tandoor can misjudge its own address and produce broken redirects or links. Enable the configuration and issue a certificate:

sudo ln -s /etc/nginx/sites-available/tandoor /etc/nginx/sites-enabled/
sudo nginx -t
sudo systemctl reload nginx
sudo certbot --nginx -d recipes.example.com

Expected result: nginx -t answers test is successful, and Certbot reports the certificate was issued. After that, reach Tandoor at https://recipes.example.com. One thing to adjust: if you access it by domain, make sure that domain is already in ALLOWED_HOSTS in .env — then run sudo docker compose up -d again so the change is picked up.

Step 8: set up a backup for the database and media

Two things in Tandoor must never be lost: the PostgreSQL database in ./postgresql and the recipe photos and attachments in ./mediafiles. The .env and compose.yml files are worth keeping too, but they are small and easy to rewrite — the database contents and your recipe photos are not replaceable.

Make your first manual backup now:

sudo docker compose stop web_recipes
sudo tar -czf ~/tandoor-first-backup.tar.gz -C /opt/tandoor postgresql mediafiles .env compose.yml
sudo docker compose start web_recipes

Expected result: a .tar.gz archive that grows with the number of recipes and photos. The web container stops briefly during the copy so nothing is written mid-backup. Store that archive outside the VPS and schedule it to repeat regularly; a backup that stays on the same server does not help when that server itself has a problem.

To update Tandoor, pull the newest image and recreate the containers — and remember, update only to the same tag or a newer one, since database downgrades are not supported:

cd /opt/tandoor
sudo docker compose pull
sudo docker compose up -d

After an update, wait 2–3 minutes again as on the first start, because database migrations may run again.

Troubleshooting

The page shows a 400 or "Bad Request" error after login. Almost always because ALLOWED_HOSTS in .env does not contain the domain or IP you use to reach Tandoor. Check that value, add the correct host, then run sudo docker compose up -d to recreate the containers with the new configuration.

Error page or 502 in the first minute after up -d. Wait first. Tandoor's initial migrations take 2–3 minutes, and opening the page before they finish shows errors. Check the logs with sudo docker compose logs --tail=50 web_recipes — if they show migrations still running, wait until they finish before concluding something is broken.

web_recipes keeps restarting and the log mentions a failed database connection. Check three things: POSTGRES_PASSWORD in .env is filled in (not empty), the db_recipes container is Up, and no other process uses port 8080 on the host (sudo ss -tlnp | grep 8080). If the password was changed after the first start, the old database was already created with the old password — the cleanest fix is to stop the stack, delete the ./postgresql folder, and start from scratch.

curl returns 000 or the browser cannot connect. Check both containers with sudo docker compose ps. If web_recipes is running but does not respond, check its logs with sudo docker compose logs --tail=50 web_recipes. If port 8080 is already taken by another app, change the mapping in compose.yml to "127.0.0.1:8081:80", adjust proxy_pass in Nginx, and restart.

Importing a recipe from a URL produces messy ingredients or steps. That is normal: every cooking site writes recipes in a different structure, and Tandoor's importer reads that structure as well as it can. Fix the ingredients and steps by hand after importing — still faster than typing the whole recipe from scratch, and the corrected result stays neatly in your own database.

Recipe photos stop showing after an update. Check that the ./mediafiles folder still exists in /opt/tandoor and is linked in compose.yml (- ./mediafiles:/opt/recipes/mediafiles). If that folder was accidentally deleted, the lost photos can only come back from the backup in Step 8.

Summary table

Component Function Port Notes
web_recipes Tandoor app (Django + Nginx inside the container) 127.0.0.1:8080 → 80 Image vabene1111/recipes (latest tag)
db_recipes PostgreSQL 16 database 5432, inside container only Image postgres:16-alpine; data in ./postgresql
.env All configuration (SECRET_KEY, ALLOWED_HOSTS, POSTGRES_*) /opt/tandoor/.env Download from the official template; three values mandatory
./mediafiles Recipe photos and attachments — Host volume; included in backups
Nginx on host Reverse proxy + HTTPS 80 / 443 Host and X-Forwarded-Proto headers required
compose.yml Defines both services /opt/tandoor/compose.yml Wait 2–3 minutes on first start

Check before you finish

  • Both containers (db_recipes and web_recipes) are running and curl http://localhost:8080 returns 200 or 302.
  • SECRET_KEY, ALLOWED_HOSTS, and POSTGRES_PASSWORD in .env are filled in (none empty).
  • The superuser account was created on the setup page and the first Space exists.
  • One recipe was imported from a URL and shows complete ingredients and steps.
  • The meal plan contains that recipe and the Shopping List was built from the meal plan.
  • Tandoor is reachable at https://recipes.example.com (replace with your domain) with a valid certificate.
  • The first backup (postgresql + mediafiles + .env + compose.yml) exists and is stored outside the VPS.

That first imported recipe is only the beginning. After a week, your collection will start telling its own story: which recipes keep landing in the meal plan, and which ingredients keep running out. Which recipe will you import first — a family dish that has only lived in memory until now, or a new one you want to try this weekend? Tell us in the comments, and if any step above does not work on your VPS, paste the error message so it can be discussed.

Read also: the Rnevio article Firefly III guide for tracking household money on your own VPS helps you cost the shopping Tandoor's lists produce, while the companion guide in this batch is the Grocy guide for managing pantry stock and shopping.

Diskusi

Ada pertanyaan atau pengalaman yang ingin dibagikan?

0komentar

Komentar ditinjau sebelum ditampilkan. Mari berdiskusi dengan sopan dan sesuai topik.