Browse documentation Architecture
Learn Architecture

Architecture

LocalCloud packages a Java gateway, the web console, local facades, and external emulator processes in one Docker container. “One container” does not mean every service shares the same protocol, process, storage engine, or compatibility level.

Request flow

  1. localcloud start selects a Docker data volume, discovers or creates one compatible loopback-bound runtime, and may remap occupied canonical ports.
  2. localcloud env resolves that runtime and returns endpoint values for the selected project and caller.
  3. SDK, REST, gRPC, and Terraform requests reach a direct emulator port or the gateway on canonical container port 24080.
  4. The gateway handles operator routes and routes facade/API traffic to local implementations.

Runtime identity and ownership

The named Docker volume mounted at /var/lib/localcloud is the only durable runtime selector; the default is localcloud-data. The CLI verifies the configured image and selects the unique compatible container using that volume. Immutable container ID is live process identity. A recorded ID is only a revalidated tie-break hint.

CLI-created container, network, and volume resources carry exact ownership labels. Ownership is independent per resource. The CLI can start, stop, restart, inspect, and use an attached compatible container, but it never removes or relabels a Docker resource it does not own. Ambiguous volume use, incompatible images, invalid labels, and shared-volume conflicts fail before mutation. Full reset --all-projects requires a fully managed runtime.

Root operator routes include /health, /health/{service}, /readiness, /env, /services, /seed, /reseed, /import, /reset, /terraform/readiness, /graphql, /api-docs, and /docs.

Process and storage model

ComponentCurrent implementationPersistence boundary
Gateway and local facadesJava/Armeria servicesMany facade records use internal PostgreSQL beneath /var/lib/localcloud/pgdata; operation-specific limits still apply.
Cloud Storagefake-gcs-server processObject data is stored beneath the mounted LocalCloud data root.
Pub/SubGoogle emulator processVolatile across process restart; topics, subscriptions, and messages require recreation/reseeding.
FirestoreGoogle emulator processFirestore seeding is disabled; do not infer seed or persistence guarantees from process presence.
Bigtablelittle_bigtable artifactLocalCloud Docker uses PostgreSQL under the mounted data root. Confirm release-unverified extended features against the exact image version you run.
BigQueryDuckDB-backed emulator processDuckDB files live beneath the LocalCloud data root; feature claims are release-sensitive.
SpannerExtended emulator processLevelDB row data plus JSON metadata beneath its data directory; mounted storage is needed across container replacement and known recovery/corruption limits apply.
MemorystoreExternal Valkey-compatible process on canonical port 24089Do not describe it as the old in-process PostgreSQL-backed RESP handler.
Cloud SQLPostgreSQL and MySQL data planes on 24090 and 24091 plus gateway administrationStarts by default; backups, replicas, PSC, and production HA behavior remain limited.

A retained volume improves restart/container-replacement behavior only for stores that actually persist. It does not provide production replication, backups, disaster recovery, transaction parity, or durability guarantees.

Canonical container ports

The host CLI may dynamically remap these ports; generated endpoint output is authoritative for a running LocalCloud runtime.

PortPurpose
24080Gateway, console, operator APIs, and facades
24081Cloud Storage
24082Pub/Sub
24083Firestore
24084Bigtable
24085Spanner gRPC
24086Spanner REST/grpc-gateway — not PostgreSQL wire
24087BigQuery REST
24088BigQuery Storage API profile
24089Memorystore/Valkey
24090Cloud SQL PostgreSQL
24091Cloud SQL MySQL
24092GKE/k3d infrastructure
24093Transparent DNS/UDP listener
24443Optional native gateway HTTPS (configurable with tls.port)

Transparent networking and Docker socket

Both features are disabled by default in the host CLI.

  • Transparent networking maps host 53/udp to container 24093/udp, host 80 to gateway 24080, and host 443 to the configured native TLS port (default 24443). It requires scoped host DNS changes and certificate trust and is used only for clients that ignore custom endpoint variables.
  • Docker-socket access grants the container control over the host Docker daemon. It is required only for runtime workflows that deliberately create subordinate containers/clusters. Do not mount it in the beginner path.

Outbound behavior

LocalCloud is not categorically offline or zero-egress. Depending on configuration and feature use, the runtime can send telemetry, probe certificate storage, check image updates, validate licenses, validate live IAM bearer tokens, or dispatch scheduled/HTTP work. Core local workflows can continue offline after required images are present, but review Privacy and disable or isolate outbound features according to your environment.

Production boundary

Local emulation does not reproduce Google Cloud IAM enforcement, quotas, managed networking, regional behavior, concurrency, performance, replication, or disaster recovery. Consult each service operation and support level, then run an explicit real-Google-Cloud validation before release.

Maintained by LocalCloud