You only need this page to run your own installation. On ManyLayers Cloud the gateway is already running at
https://app.manylayers.io/v1 and the console at https://app.manylayers.io. In a self-hosted install those addresses are your own: expose the gateway (port 8180) and the workspace (port 8190) on hostnames you control, and use them wherever the docs show the hosted ones.How it works
The gateway, workspace and deployer also serve
/health, /healthz, /ready, /readyz, /version and /metrics; the worker serves /health, /ready and /metrics (its /ready is 503 until its consumers attach). All services read the same config file and the same PostgreSQL database.
Run it
- Docker Compose
- Docker image
- Binaries
The repository has three stacks in
infra/docker/, each one compose file plus one env file:make prod-deploy runs pull, migrate, start and health check in one step. Pin IMAGE_TAG to a real tag rather than latest. Put the gateway behind your TLS ingress or load balancer; keep Workspace and Deployer on a private network or behind a VPN. For local development run make dev-migrate then make dev-up.No service migrates the schema on startup. Run
dbtool migrate (the compose migrate job) before starting or upgrading, so several gateway replicas never race on a migration.Health and readiness
Never point liveness at
/ready: a database blip would restart healthy replicas. The image has no shell or curl, so container health checks run the binary itself — /gateway -readycheck (or -healthcheck) probes its own port over loopback and exits 0 or 1. /workspace and /deployer take the same flags.
Graceful shutdown
OnSIGTERM each service:
- Marks itself draining —
/readyreturns503,/healthstays200. - Keeps serving for
SHUTDOWN_DRAIN_DELAY(default0s) so load balancers stop sending new requests. - Stops accepting connections and lets in-flight requests finish for up to
SHUTDOWN_TIMEOUT(default20s; YAMLserver.shutdown_timeout). If the deadline passes it logsshutdown deadline exceededand exits non-zero.
SHUTDOWN_DRAIN_DELAY to 5–10s behind a real load balancer or in Kubernetes, and keep your orchestrator’s grace period above SHUTDOWN_DRAIN_DELAY + SHUTDOWN_TIMEOUT (the production compose file uses stop_grace_period: 40s).
Scaling
- Gateway: add replicas behind a load balancer; they hold no local state. Configure Redis so rate limits, budgets and the exact cache are shared — without it each replica enforces limits independently.
- One Redis: run a single Redis (or one logical cluster). Several independent Redis instances would each keep their own limiter state, multiplying every caller’s limit.
- Workspace and Deployer: one instance each; Workspace runs the workflow, connector, billing and sweep workers.
- Credential key: set
MANYLAYERS_ENCRYPTION_KEYexplicitly. Without it each service generatesdata/credentials.keylocally, and replicas cannot read each other’s stored provider keys. In the production compose stack the root filesystem is read-only, so nothing can be generated: pasted provider keys are refused (encryption_not_configured) until the variable is set (make env-filesgenerates one).
Environment variables
Environment variables override the config file. Inside the file,${VAR}, ${VAR:-default} and ${vault:secret/data/path#key} are expanded at load time.
The shipped container config (
configs/gateway.container.yaml) also reads these through ${…} references:
Container config overrides
The baked-inconfigs/gateway.container.yaml overrides several built-in defaults, so an installation from the image will not see the values printed on Routing and Caching:
Next steps
Metrics
Scrape
/metrics on every replica.gateway.yaml reference
Every config key the services read.
Caching
Share the cache across replicas with Redis.
Request Logging & Audit
Retention and body capture for your deployment.