Skip to content

Self-hosting

Host Cookpal yourself

Cookpal runs with Docker Compose on your own server. Your recipes, your week plan and your shopping lists stay with you.

What you need

  • A server or computer with Docker and Docker Compose.
  • For public use, a domain and a reverse proxy with HTTPS.
  • SMTP access, so activation and password mails can be sent.

Docker Compose starts five containers: the proxy, the web frontend, the API server, PostgreSQL and a recipe import service.

Installation

1. Download the project and change into the compose folder.

git clone https://github.com/steve192/opencookbook
cd opencookbook/compose

2. Edit the .env file. At the very least change DB_PASSWORD. The most important settings are in the next section.

3. Start Cookpal.

docker compose up -d

The app is then reachable on the port set by httpPort (default 3009). For public use, put a reverse proxy with HTTPS in front.

The compose folder on GitHub

Important settings

SettingMeaning
tagThe version that is started.
httpPortThe port the app is reachable on (default 3009).
DB_PASSWORDThe database password. Change it.
INSTANCE_URLThe public address without /app. It is used for links in mails and shares.
SMTP_*, MAIL_FROMCredentials and sender for activation and password mails.
LANDING_ENABLEDShows this project page at /. Off by default, then / opens the app.
LEGAL_DIRFolder with the legal texts shown in the app (default ./legal).
MAX_UPLOAD_SIZE_MBThe largest upload in megabytes.

All settings in the .env

The Android app with your own server

The Android app connects to your server once you enter its address as the server address in the login settings (the cog icon).

Updating

Always update all images together, because app and server of one release belong together. Set tag to the new version if needed, then:

docker compose pull && docker compose up -d

A reverse proxy must pass the frontend's Cache-Control headers through unchanged, or browsers may keep showing the old version after an update.

Backups

Back up two directories: the database directory (DATABASE_MOUNT_DIR) and the images directory (IMAGES_MOUNT_DIR). It is best to stop the containers briefly before copying the database.