Learn Architecture

Architecture

LocalCloud runs everything inside a single Docker container. Here’s how the pieces fit together.

Overview

Components

Armeria Gateway

The central gateway built with Armeria (Java HTTP/gRPC framework). It handles:

  • Admin API — REST endpoints at /_localcloud/ for health, status, seed data, and configuration
  • Web Console — A Solid.js SPA served at the root, providing a GCP Console-like interface
  • Facade Services — gRPC/REST implementations for services without dedicated emulators (Secret Manager, Cloud Tasks, Logging, Monitoring, Workflows, GKE, Compute Engine, Cloud Run)
  • Memorystore — RESP2 (Redis protocol) handler via Netty codec-redis on port 6379

External Emulators

Where high-quality emulators exist, LocalCloud delegates to them:

EmulatorSourcePort
fake-gcs-serverCommunity (Go)4443
Pub/SubGoogle official emulator8085
FirestoreGoogle official emulator8086
BigtableGoogle official emulator8087
SpannerExtended emulator built around the official Spanner emulator9010
BigQueryCustom emulator built from scrach9050

These run as separate processes managed by supervisord.

Facade Services

For services without existing emulators, LocalCloud implements Java facades:

  • Secret Manager — Full CRUD for secrets and versions
  • Cloud Tasks — Queue management with HTTP task dispatch and retries
  • Cloud Logging — Sink-mode log ingestion and listing
  • Cloud Monitoring — Time series ingestion and querying
  • Memorystore — RESP2 protocol over Netty, backed by PostgreSQL
  • Cloud Workflows — Full YAML expression engine with stdlib and connector shims
  • GKE — Cluster CRUD via k3d (requires Docker socket)
  • Compute Engine — Instance CRUD using Docker containers as VMs
  • Cloud Run — Service/revision management with real Docker containers

PostgreSQL

An internal PostgreSQL 17 instance provides persistence for all facade services. GCS blobs are stored on the filesystem; all other data uses PostgreSQL tables.

Docker Image

  • Base: debian:trixie-slim
  • JRE: Custom Java 25 built via jlink (~72 MB)
  • Architectures: Native arm64 (Apple Silicon) and amd64
  • Memory: Requires -m 4g for stable full operation
  • No gcloud SDK: All emulators run as direct JAR/binary execution

Port Map

PortService
8080Gateway (Admin, Console, Facades)
4443Cloud Storage
8085Pub/Sub
8086Firestore
8087Bigtable
9010Spanner (gRPC)
9020Spanner (REST)
9050BigQuery (REST)
9060BigQuery (gRPC Storage API)
6379Memorystore (Redis)

Last updated: May 2025