Homebox on Google Cloud Run
Homebox is an open-source, self-hosted home inventory and organization system with a Go REST API backend (Echo-style, Ent ORM) and a Vue 3/Nuxt frontend served embedded from the same binary — track items, attach photos, and organize by location. This module deploys Homebox 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 Homebox 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
Homebox runs as a single Go binary (API + embedded frontend) on Cloud Run v2. The deployment wires together a small, focused set of Google Cloud services:
| Capability | Google Cloud service | Notes |
|---|---|---|
| Compute | Cloud Run v2 | Go/Echo service, 1 vCPU / 512 MiB by default, scale-to-zero |
| Database | Cloud SQL for PostgreSQL 15 | Homebox reads discrete HBOX_DATABASE_* env vars, not a constructed DSN |
| Object storage | Cloud Storage | A data bucket is created for item photos/attachments and auto-mounted at /data |
| Cache & queue | none | Homebox has no Redis or queue dependency |
| Secrets | Secret Manager | Database password plus HBOX_AUTH_API_KEY_PEPPER (a real, app-consumed secret) |
| Ingress | Cloud Run URL | Default run.app URL; optional external HTTPS load balancer + custom domain |
Sensible defaults worth knowing up front:
- PostgreSQL 15 is the standardized engine.
Homebox_Commonfixesdatabase_type = "POSTGRES_15"and setsHBOX_DATABASE_DRIVER=postgresexplicitly — Homebox defaults to embedded SQLite otherwise, whose default DSN forcesjournal_mode=WAL, which is unsafe over NFS/gcsfuse. - No custom container build. Homebox's discrete Postgres env vars need no
DSN construction, so the official prebuilt image
(
ghcr.io/sysadminsmedia/homebox) is used directly. - Open self-registration, not a default admin account. Unlike some apps
in this catalogue, Homebox does not ship a hardcoded credential: the first
person to submit the "Register" form on a fresh instance becomes the
initial admin user. There is no default-credential security risk, but
operators should set
HBOX_OPTIONS_ALLOW_REGISTRATION=falseafterward to close public signups — see the Common guide for detail. - Item photos are persisted by default.
Homebox_Commondeclares agcs_volumesentry mounting thedataGCS bucket at Homebox's/datapath, so uploaded item photos and attachments survive a revision restart. Item metadata is unaffected either way (stored in PostgreSQL). - Request-based billing by default.
cpu_always_allocated = false,min_instance_count = 0— Homebox is a plain request/response app with no background scheduler or queue worker.
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 Homebox 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
Homebox stores all item, location, 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 item photos and attachments,
and is mounted into the container at /data by default.
- CLI:
gcloud storage buckets list --project "$PROJECT" --filter="name~homebox"
D. Secret Manager
- CLI:
gcloud secrets list --project "$PROJECT" --filter="name~homebox"
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. Homebox Application Behaviour
- First-deploy database setup. An initialization Job runs
create-db-and-user.shusingpostgres:15-alpine, idempotently creating the application role and database. - Schema migrations on start. Homebox's Ent ORM applies its own internal migrations automatically on every startup — no separate migration job runs at the platform layer.
- Open self-registration — no default admin credential. The first
visitor to complete the "Register" form becomes the admin. There is no
credential to retrieve, reset, or rotate — set
HBOX_OPTIONS_ALLOW_REGISTRATION=falseonce the admin account exists to close public signups. - Health path. Startup and liveness probes target
/api/v1/status— Homebox's real, unauthenticated status endpoint, confirmed from the official Dockerfile's ownHEALTHCHECKinstruction. - 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 Homebox are listed; every other input is inherited from App_CloudRun with its standard behaviour.
Group 3 — Application Identity
| Variable | Default | Description |
|---|---|---|
application_name | homebox | Base name for resources. |
application_version | latest | Homebox publishes a genuine latest tag — no remapping needed. |
Group 4 — Runtime & Scaling
| Variable | Default | Description |
|---|---|---|
container_image_source | prebuilt | No custom build needed — discrete Postgres env vars require no DSN construction. |
container_port | 7745 | Homebox's native default port. |
cpu_always_allocated | false | Request-based billing. |
min_instance_count / max_instance_count | 0 / 1 | Scale-to-zero default. |
Group 11 — Storage & Filesystem
| Variable | Default | Description |
|---|---|---|
storage_buckets | one data bucket | Created and auto-mounted at /data for item photos. |
gcs_volumes | [] | Empty means "use Homebox_Common's own /data mount"; a non-empty list replaces it. |
Group 12 — Database Backend
| Variable | Default | Description |
|---|---|---|
database_type | POSTGRES_15 | Fixed by Homebox_Common. |
db_host_env_var_name | HBOX_DATABASE_HOST | Aliases the platform DB_HOST onto Homebox's expected name. |
db_user_env_var_name | HBOX_DATABASE_USERNAME | Aliases DB_USER. |
db_password_env_var_name | HBOX_DATABASE_PASSWORD | Aliases DB_PASSWORD. |
db_name_env_var_name | HBOX_DATABASE_DATABASE | Aliases DB_NAME. |
db_port_env_var_name | HBOX_DATABASE_PORT | Aliases DB_PORT. |
Group 14 — Observability & Health
| Variable | Default | Description |
|---|---|---|
startup_probe / liveness_probe | HTTP /api/v1/status 30s delay | Probes target Homebox's real status endpoint. |
5. Outputs
| Output | Description |
|---|---|
service_name / service_url | Cloud Run service name and default run.app URL. |
database_instance_name / database_name / database_user / database_host / database_port | Cloud SQL connection details. |
storage_buckets | The data bucket for item photos and attachments. |
deployment_id / tenant_id / resource_prefix | Naming identifiers. |
project_id / project_number | Project identifiers. |
6. Configuration Pitfalls & Sensible Defaults
Risk: Critical (data loss / outage / security) — High (service degraded) — Medium (cost or partial degradation) — Low (minor).
| Setting | Sensible value | Risk | Consequence if wrong |
|---|---|---|---|
application_database_name / application_database_user | Set once | Critical | Immutable after first deploy; renaming recreates the DB/user and destroys all data. |
container_image_source | prebuilt (default) | High | "custom" triggers an unnecessary Cloud Build with no Dockerfile in this module — the build fails. |
| First registration | Complete promptly after deploy | Medium | The first person to register on a fresh, publicly reachable instance becomes the admin — until you register and set HBOX_OPTIONS_ALLOW_REGISTRATION=false, anyone who discovers the URL can claim the admin account. |
gcs_volumes for item photos | Leave empty (use the module's own /data mount) | High | Homebox_Common already mounts the data bucket at /data. Supplying a non-empty gcs_volumes list replaces that mount entirely — if the replacement does not also cover /data, uploaded item photos and attachments fall back to Cloud Run's ephemeral filesystem and do not survive a revision restart. Item metadata is unaffected. |
db_*_env_var_name variables | Leave at their Homebox-specific defaults | Critical | Changing/clearing these breaks Homebox's Postgres connection entirely — it reads HBOX_DATABASE_*, 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. Homebox-specific application configuration shared with the GKE variant is described in Homebox_Common.
Related guides
- Hands-on lab: Homebox on Cloud Run — deploy it step by step, with the console screens and commands at each stage.
- Homebox on GKE Autopilot — the same application on Kubernetes, for when you need the other deployment target.
- Homebox Common — Shared Application Configuration — the configuration shared by both deployment targets.