Skip to main content

Passbolt on Google Cloud Run

Passbolt on Google Cloud Run

Passbolt (Community Edition) is a free, open-source, team-oriented password manager with GPG-based encryption and per-user/group credential sharing — AGPL-3.0 licensed, ~6k GitHub stars. It occupies a different niche from this catalog's Vaultwarden module: Vaultwarden is a personal/Bitwarden-compatible vault, while Passbolt is built around organization-wide GPG-encrypted credential sharing between users and groups. This module deploys the official passbolt/passbolt image 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 Passbolt 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

Passbolt runs as a single Apache/PHP container on Cloud Run v2. The deployment wires together a focused set of Google Cloud services:

CapabilityGoogle Cloud serviceNotes
ComputeCloud Run v2Apache/PHP container, port 80, 1 vCPU / 2Gi by default, min_instance_count = 0 (scale-to-zero)
DatabaseCloud SQL for MySQL (MYSQL_8_0)Required — Passbolt is a MySQL-only CakePHP application; discrete DATASOURCES_DEFAULT_* env vars, not a single DSN
Cryptographic stateTwo dedicated GCS buckets (storage, jwt)Hold the vendor-self-generated GPG server keypair and JWT keypair — not Terraform-generated secrets
SecretsSecret ManagerOnly the database password is generated by the foundation — Passbolt itself contributes no secret at all (Passbolt_Common's secret_ids output is always empty)
IngressCloud Run URL / Cloud Load BalancingDefault run.app URL; optional external HTTPS load balancer + custom domain

Sensible defaults worth knowing up front:

  • MySQL is mandatory. database_type = "MYSQL_8_0" is fixed by Passbolt_Common; Passbolt is built on CakePHP with a MySQL-only schema.
  • No server-side application secret. Unlike WordPress (multiple salts) or Laravel-family apps (APP_KEY), Passbolt has no Terraform-generated encryption key at all. Its security model is entirely client-side: the browser extension generates a GPG keypair and master password locally during setup. The server's own GPG keypair (for encrypting data to Passbolt) and its JWT keypair (API auth tokens) are both self-generated by the vendor's own entrypoint on first boot and persisted on dedicated GCS volumes — not created or rotated by Terraform.
  • Two purpose-built GCS volumes, not one, and not the whole /etc/passbolt directory. storage mounts narrowly at /etc/passbolt/gpg; jwt mounts narrowly at /etc/passbolt/jwt. Mounting a single volume over all of /etc/passbolt would shadow baked-in config/PHP files (app.php, bootstrap.php, routes.php) that live directly in that directory in the image — the same class of bug this catalog previously hit with Cloudreve.
  • HTTPS = "on" is always injected. Passbolt's bootstrap.php has $trustProxy = false hardcoded, so it does not honor X-Forwarded-Proto by default — but it does check the literal env('HTTPS') value directly. Since Cloud Run terminates TLS at the edge and forwards plain HTTP to the container, this static override makes Passbolt generate https:// URLs correctly in emails and absolute links.
  • enable_cloudsql_volume defaults to false at this module's variable level — asymmetric with Passbolt_GKE, where it defaults true (both match Passbolt_Common's own default of true). Set it explicitly to true for socket-based MySQL connections on Cloud Run.
  • No first-visit web setup wizard. The only way an admin account exists is via the admin-bootstrap init job, which prints a one-time setup URL to Cloud Logging for the operator to open in a Passbolt-compatible browser extension.
  • No Redis. enable_redis = false by default — Passbolt has no Redis integration used by this module.

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 Passbolt 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"
    gcloud run revisions list --service <service-name> --project "$PROJECT" --region "$REGION"

See App_CloudRun for scaling, concurrency, execution environment, and traffic splitting.

B. Cloud SQL for MySQL

Passbolt stores all application data — users, groups, folders, encrypted password resources, sharing permissions — in a managed Cloud SQL MySQL 8.0 instance. The database connection uses Passbolt's own discrete env var names (DATASOURCES_DEFAULT_HOST/_USERNAME/_PASSWORD/_DATABASE, confirmed against the vendor's own /passbolt/env.sh), aliased from the Foundation's standard DB_* values by the Application Module.

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

See App_CloudRun for the connection model, backups, and password rotation.

C. Cloud Storage — the GPG and JWT keypair volumes

Two GCS buckets are provisioned by Passbolt_Common and mounted via GCS Fuse: storage at /etc/passbolt/gpg, jwt at /etc/passbolt/jwt. These are not generic upload/media buckets — they hold the vendor-self-generated server GPG keypair and JWT keypair, both generated once on first boot and reused on every subsequent boot. Losing either bucket invalidates every credential Passbolt has encrypted server-side and every issued JWT session.

  • Console: Cloud Storage → find the two buckets (names include storage and jwt suffixes).
  • CLI:
    gsutil ls -p "$PROJECT" | grep passbolt
    gsutil ls gs://<storage-bucket-name>/ # expect serverkey.asc, serverkey_private.asc

D. Secret Manager

Passbolt itself contributes no secret — the only Secret Manager entry related to this deployment is the database password, managed by the Foundation.

  • Console: Security → Secret Manager.
  • CLI:
    gcloud secrets list --project "$PROJECT" --filter="name~passbolt"

E. Networking & ingress

The service is reachable at its run.app URL by default. An external HTTPS load balancer with a custom domain, Cloud CDN, and Cloud Armor can be layered on; ingress settings and VPC egress control connectivity.

  • Console: Cloud Run (service URL); Network services → Load balancing.
  • CLI:
    gcloud run services describe <service-name> --region "$REGION" --format='value(status.url)'

See App_CloudRun.

F. Cloud Logging & Monitoring

Container logs flow to Cloud Logging — including the admin-bootstrap init job's one-time setup URL output. Cloud Run and Cloud SQL metrics flow to Cloud Monitoring, with optional uptime checks and alert policies.

  • Console: Logging → Logs Explorer; Monitoring → Dashboards / Alerting.
  • CLI:
    gcloud run services logs read <service-name> --project "$PROJECT" --region "$REGION" --limit 50

3. Passbolt Application Behaviour

  • The 2-stage initialization job chain, and why the second job is genuinely non-trivial. Passbolt_Common defines two ordered Cloud Run Jobs, both with execute_on_apply = true:

    1. db-init (mysql:8.0-debian) — creates the MySQL role and database (the shared catalog-wide db-init.sh, caching_sha2_password-safe).

    2. admin-bootstrap (passbolt/passbolt:<version>, depends_on_jobs = ["db-init"]) — registers the initial admin account.

      Cloud Run Jobs invoke a container's command/args directly, bypassing the vendor's own /docker-entrypoint.sh chain entirely — so a bare cake passbolt register_user on a freshly-provisioned container fails with an Internal Error 500, because the GPG server keypair (normally generated during the vendor entrypoint's own boot sequence) doesn't exist yet, and the schema hasn't been installed either. The job instead sources the vendor's own entrypoint functions (/passbolt/entrypoint.sh, /passbolt/env.sh, /passbolt/deprecated_paths.sh), generates/imports the GPG server keypair if missing, generates a self-signed SSL cert if missing, runs the vendor's own install() function (which also handles JWT keypair generation and the database schema install/migrate), and only then runs cake passbolt register_user -u <admin_email> -f <admin_first_name> -l <admin_last_name> -r adminwithout the -q/quiet flag, so the one-time setup URL is printed and lands in Cloud Logging. Confirmed against the real vendor /passbolt/entrypoint.sh source. Idempotent: gpg_gen_key/install() no-op once the keys and schema already exist from a prior run.

  • No first-visit setup wizard, and a genuinely different bootstrap model from most apps in this catalog. Passbolt requires the client (a browser extension) to generate its own GPG keypair and master password — there is no server-side password to seed and nothing to retrieve from Secret Manager. Retrieve the one-time setup URL instead:

    gcloud logging read \
    'resource.type="cloud_run_job" AND resource.labels.job_name~admin-bootstrap' \
    --project "$PROJECT" --limit 20 --format='value(textPayload)' | grep '/setup/start/'
  • Health endpoint. GET /healthcheck/status.json returns an unauthenticated 200 with {"header":{"status":"success",...},"body":"OK"} once ready — confirmed via local container testing and live deployment. Both the startup and liveness probes target this path by default.

  • Inspect job execution:

    gcloud run jobs list --project "$PROJECT" --region "$REGION"
    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 Passbolt are listed; every other input is inherited from App_CloudRun with its standard behaviour.

Group 1 — Project & Identity

VariableDefaultDescription
project_id(required)Target Google Cloud project.
regionus-central1Region for the service and regional resources.

Group 2 — Deployment Environment

VariableDefaultDescription
tenant_deployment_iddemoShort suffix that makes resource names unique per environment. Use a distinct value (e.g. cr) from any co-deployed Passbolt_GKE (gke) to avoid a naming collision.
support_users[]Emails granted project access and monitoring alerts.
resource_labels{}Labels applied to all resources.

Group 3 — Application Identity

VariableDefaultDescription
application_namepassboltBase name for resources. Do not change after first deploy.
display_namePassboltHuman-readable name shown in the Console.
application_versionlatestpassbolt/passbolt image tag.
admin_emailadmin@example.comEmail for the admin account registered by admin-bootstrap.
admin_first_name / admin_last_nameAdmin / UserName fields for the initial admin account.
enable_gcs_storage_volumetrueMounts the storage (GPG) and jwt GCS volumes. Keep enabled.

Group 4 — Runtime & Scaling

VariableDefaultDescription
deploy_applicationtrueSet false to provision infrastructure only.
container_image_sourceprebuiltDeploys the official image directly; Passbolt only supports the prebuilt image.
cpu_limit1000m1 vCPU.
memory_limit2GiMemory limit — PHP 8.x + Apache.
min_instance_count0Scale-to-zero by default.
max_instance_count1Single instance by default.
container_port80Passbolt (Apache) listens here.
execution_environmentgen2Required execution environment.
enable_cloudsql_volumefalseAsymmetric with Passbolt_GKE's default of true. Set true for socket-based MySQL connections — Passbolt's DATASOURCES_DEFAULT_HOST accepts the socket directory directly.
cloudsql_volume_mount_path/cloudsqlContainer path for the Auth Proxy socket.
container_protocolhttp1"http1" or "h2c".
enable_image_mirroringtrueMirrors the Passbolt image into Artifact Registry.

Group 5 — Access & Networking

VariableDefaultDescription
ingress_settingsallTraffic ingress control.
vpc_egress_settingPRIVATE_RANGES_ONLYVPC egress control.
enable_iapfalseIdentity-Aware Proxy.

Group 6 — Environment Variables & Secrets

VariableDefaultDescription
environment_variables{}Extra non-secret settings. HTTPS = "on" and (when known) APP_FULL_BASE_URL are set automatically.
secret_environment_variables{}Map of env var → Secret Manager secret name. Passbolt itself contributes none.

Group 11 — Cloud Storage

VariableDefaultDescription
gcs_volumes[]Additional GCS buckets to mount, on top of the two Passbolt provisions automatically (storage, jwt).
enable_nfstrueProvisions a Filestore volume. Not used by Passbolt's own persistence model — the GPG/JWT keypairs live on dedicated GCS volumes and everything else is in MySQL. Harmless generic default.

Group 12 — Database Backend

VariableDefaultDescription
database_typeMYSQL_8_0Cloud SQL engine. Passbolt requires MySQL.
db_namepassboltMySQL database name.
db_userpassboltMySQL application user.
database_password_length32Generated password length (16–64).
db_host_env_var_name / db_user_env_var_name / db_name_env_var_name / db_password_env_var_nameDATASOURCES_DEFAULT_HOST / _USERNAME / _DATABASE / _PASSWORDSet by passbolt.tf, not user-facing — Passbolt reads discrete CakePHP/PDO env var names, not the Foundation's standard DB_* names.

Group 13 — Jobs & Scheduled Tasks

VariableDefaultDescription
initialization_jobs[]Leave empty for Passbolt_Common's default 2-job chain (db-initadmin-bootstrap). A non-empty list replaces it entirely.
cron_jobs[]Passbolt has no platform-scheduled recurring tasks by default.

Group 14 — Observability & Health

VariableDefaultDescription
startup_probeHTTP /healthcheck/status.json, 20s delay, 20 retriesPassbolt's unauthenticated status endpoint.
liveness_probeHTTP /healthcheck/status.json, 60s delaySame endpoint.
uptime_check_config{ enabled=false, path="/" }Cloud Monitoring uptime check.

Group 21 — Redis

VariableDefaultDescription
enable_redisfalseNot used by Passbolt. Present for platform compatibility.

Group 22 — VPC Service Controls & Audit Logging

Standard App_CloudRun VPC-SC integration — see App_CloudRun.


5. Outputs

Returned on a successful deployment — the quickest way to locate and explore the running resources.

OutputDescription
service_nameCloud Run service name.
service_urlDefault run.app URL of the service.
service_locationRegion the service runs in.
database_instance_nameCloud SQL instance name.
database_name / database_userApplication database name / user.
database_password_secretSecret Manager secret holding the DB password.
database_host / database_portDB endpoint / port.
storage_bucketsThe storage (GPG) and jwt GCS buckets.
container_imageDeployed image.
initialization_jobsNames of the created init jobs (db-init, admin-bootstrap).
deployment_id / tenant_id / resource_prefixNaming identifiers.
project_id / project_numberProject identifiers.
cicd_enabled / github_repository_urlCI/CD status.
vpc_sc_enabled / vpc_sc_perimeter_name / vpc_sc_dry_run_modeVPC-SC status.

6. Configuration Pitfalls & Sensible Defaults

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

Inherited plan-time validation. This module passes its configuration through the App_CloudRun foundation engine, which validates values and combinations at plan time. Invalid configuration fails the plan with a clear, named error before any resource is created.

SettingSensible valueRiskConsequence if wrong
database_typeMYSQL_8_0CriticalPassbolt's CakePHP schema is MySQL-only — any other engine breaks startup entirely.
enable_gcs_storage_volumetrueCriticalDisabling loses the persistent volumes for the self-generated GPG server keypair and JWT keypair — every credential Passbolt has encrypted server-side, and every issued JWT session, becomes unrecoverable on the next container restart.
initialization_jobs order (db-initadmin-bootstrap)Leave [] unless you fully understand the dependencyCriticalThe admin-bootstrap job's replication of the vendor's own GPG-key-generation/schema-install sequence is load-bearing — a naive replacement job that just runs cake passbolt register_user directly fails with an Internal Error because the GPG server keypair and schema don't exist yet.
enable_cloudsql_volumetrue (note: defaults false on this variant)MediumPassbolt's DATASOURCES_DEFAULT_HOST works over the Cloud SQL Auth Proxy Unix socket directly; leaving this at its Cloud-Run-side default of false uses direct TCP instead, which still works but forgoes the socket's TLS termination and matches neither Passbolt_Common's own default nor the GKE variant.
admin_email / admin_first_name / admin_last_nameSet intentionally before first deployMediumThese seed the one and only admin account the admin-bootstrap job creates; there is no in-app way to change them after the fact except through Passbolt's own admin UI once logged in.
No admin password to lose track ofUnlike most apps in this catalog, there is no Secret-Manager-held admin credential to retrieve. If the one-time setup URL is missed and expires, the fix is deleting and re-running the admin-bootstrap job (it is idempotent for the GPG/JWT/schema steps, but register_user itself may need a fresh invocation for a new URL — check Passbolt's own CLI docs for re-issuing a setup link).

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. Passbolt-specific application configuration shared with the GKE variant is described in Passbolt_Common.