Skip to main content

Mealie on Google Cloud Run

Mealie on Google Cloud Run

Mealie is an open-source, self-hosted recipe manager and meal planner with a FastAPI backend and a Vue frontend, offering automatic recipe import by URL alongside a manual UI editor. This module deploys Mealie on Cloud Run v2 on top of the App_CloudRun foundation, which provisions and manages the shared Google Cloud infrastructure.

This guide focuses on the cloud services Mealie uses and how to explore and operate them from the Google Cloud Console and the command line. For the mechanics common to every Cloud Run application — service identity, ingress and load balancing, scaling and concurrency, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC Service Controls, backups, and the deployment lifecycle — refer to the App_CloudRun foundation guide rather than repeating them here.


1. Overview

Mealie runs as a single FastAPI/Vue container on Cloud Run v2. The deployment wires together a small, focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2FastAPI service, 1 vCPU / 512 MiB by default, scale-to-zero
DatabaseCloud SQL for PostgreSQL 15Mealie reads discrete POSTGRES_* env vars, not a constructed DSN
Object storageCloud StorageA data bucket is created for recipe images, but not auto-mounted
Cache & queuenoneMealie has no Redis or queue dependency
SecretsSecret ManagerDatabase password only — Mealie has no env-configurable admin credential
IngressCloud Run URLDefault run.app URL; optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • PostgreSQL 15 is the standardized engine. Mealie_Common fixes database_type = "POSTGRES_15" and sets DB_ENGINE=postgres explicitly — Mealie defaults to embedded SQLite otherwise.
  • No custom container build. Mealie's discrete Postgres env vars need no DSN construction, so the official prebuilt image (ghcr.io/mealie-recipes/mealie) is used directly.
  • Default admin account, not first-registration — and it is NOT configurable. Unlike some apps in this catalogue, Mealie does not let the first visitor self-register as admin, and unlike earlier Mealie versions its initial credential can no longer be set via environment variables (the underlying settings are private, non-env-bindable fields as of v3.x — see the Common guide for the source-level detail). Every deployment boots the same well-known account: changeme@example.com / MyPassword. Log in immediately after first deploy and change both the password and, ideally, the admin email — Mealie forces a password reset on first login, which is the real security boundary here, not secrecy of the initial credential.
  • Recipe images are not persisted by default. A GCS bucket is created but not auto-mounted at Mealie's /app/data path — add a gcs_volumes entry if uploaded recipe images need to survive a revision restart. Recipe text data is unaffected (stored in PostgreSQL).
  • Request-based billing by default. cpu_always_allocated = false, min_instance_count = 0 — Mealie's URL-import scraping runs synchronously within the triggering request, not as a background job.

2. Google Cloud Services & How to Explore Them

All commands assume PROJECT and REGION are set. Service and resource names are reported in the deployment Outputs.

A. Cloud Run — the Mealie service

  • Console: Cloud Run → select the service for revisions, traffic, logs, and metrics.
  • CLI:
    gcloud run services list --project "$PROJECT" --region "$REGION"
    gcloud run services describe <service-name> --project "$PROJECT" --region "$REGION"

See App_CloudRun for scaling, concurrency, and traffic splitting.

B. Cloud SQL for PostgreSQL 15

Mealie stores all recipes, meal plans, and user data in a managed Cloud SQL for PostgreSQL 15 instance, connected privately via the Cloud SQL Auth Proxy over a Unix socket. On first deploy, an initialization Job creates the application database and user.

  • Console: SQL → select the instance for connections, backups, flags, metrics.
  • CLI:
    gcloud sql instances list --project "$PROJECT"
    gcloud sql connect <instance-name> --user=<db-user> --database=<db-name> --project "$PROJECT"

C. Cloud Storage

A data bucket is provisioned automatically for recipe images, but is not mounted into the container by default — see the Pitfalls table.

  • CLI:
    gcloud storage buckets list --project "$PROJECT" --filter="name~mealie"

D. Secret Manager

  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~mealie"
    gcloud secrets versions access latest --secret=<secret-name> --project "$PROJECT"

E. Networking & ingress

  • CLI:
    gcloud run services describe <service-name> --region "$REGION" --format='value(status.url)'

F. Cloud Logging & Monitoring

  • CLI:
    gcloud run services logs read <service-name> --project "$PROJECT" --region "$REGION" --limit 50

3. Mealie Application Behaviour

  • First-deploy database setup. An initialization Job runs create-db-and-user.sh using postgres:15-alpine, idempotently creating the application role and database.
  • Schema migrations on start. Mealie applies its own internal migrations automatically on every startup.
  • Fixed default admin credential — not configurable. Mealie creates changeme@example.com / MyPassword on first database initialisation. This is a hardcoded upstream default (no env var overrides it as of v3.x), not a generated secret — a password reset is forced on first login, and operators must complete it immediately after deploy.
  • Health path. Startup and liveness probes target /api/app/about — Mealie's real, unauthenticated info endpoint.
  • Inspect job execution:
    gcloud run jobs executions list --job <job-name> --project "$PROJECT" --region "$REGION"

4. Configuration Variables

Variables are grouped exactly as they appear on the deployment platform. Only settings specific to or notable for Mealie are listed; every other input is inherited from App_CloudRun with its standard behaviour.

Group 3 — Application Identity

VariableDefaultDescription
application_namemealieBase name for resources.
application_versionlatestMealie publishes a genuine latest tag — no remapping needed.

Group 4 — Runtime & Scaling

VariableDefaultDescription
container_image_sourceprebuiltNo custom build needed — discrete Postgres env vars require no DSN construction.
container_port9000Mealie's native default port.
cpu_always_allocatedfalseRequest-based billing.
min_instance_count / max_instance_count0 / 1Scale-to-zero default.

Group 11 — Storage & Filesystem

VariableDefaultDescription
storage_bucketsone data bucketCreated but not auto-mounted — add gcs_volumes to persist recipe images.
gcs_volumes[]Add an entry mounted at /app/data for persistent recipe image storage.

Group 12 — Database Backend

VariableDefaultDescription
database_typePOSTGRES_15Fixed by Mealie_Common.
db_host_env_var_namePOSTGRES_SERVERAliases the platform DB_HOST onto Mealie's expected name.
db_user_env_var_namePOSTGRES_USERAliases DB_USER.
db_password_env_var_namePOSTGRES_PASSWORDAliases DB_PASSWORD.
db_name_env_var_namePOSTGRES_DBAliases DB_NAME.
db_port_env_var_namePOSTGRES_PORTAliases DB_PORT.

Group 14 — Observability & Health

VariableDefaultDescription
startup_probe / liveness_probeHTTP /api/app/about 30s delayProbes target Mealie's real info endpoint.

5. Outputs

OutputDescription
service_name / service_urlCloud Run service name and default run.app URL.
database_instance_name / database_name / database_user / database_host / database_portCloud SQL connection details.
storage_bucketsThe data bucket for recipe images.
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.

6. Configuration Pitfalls & Sensible Defaults

Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).

SettingSensible valueRiskConsequence if wrong
application_database_name / application_database_userSet onceCriticalImmutable after first deploy; renaming recreates the DB/user and destroys all data.
container_image_sourceprebuilt (default)High"custom" triggers an unnecessary Cloud Build with no Dockerfile in this module — the build fails.
Default admin credential (changeme@example.com / MyPassword)Log in and change it immediately after first deployCriticalThis is a fixed, publicly documented upstream default — not a generated secret — as soon as the DB initialises, anyone who knows Mealie's default credential can log in until you complete the forced first-login password reset.
gcs_volumes for recipe imagesAdd explicitly if neededMediumWithout it, uploaded recipe images live on Cloud Run's ephemeral filesystem and do not survive a revision restart — recipe text is unaffected.
db_*_env_var_name variablesLeave at their Mealie-specific defaultsCriticalChanging/clearing these breaks Mealie's Postgres connection entirely — it reads POSTGRES_*, not DB_*.

For the foundation behaviour referenced throughout — service identity, scaling and concurrency, ingress and load balancing, CI/CD, Cloud Armor, IAP, Binary Authorization, VPC-SC, backups, and image mirroring — see App_CloudRun. Mealie-specific application configuration shared with the GKE variant is described in Mealie_Common.