Miget is now Lyngbak. Same platform, same plans, same API.Why the name →

Startups get $300 or more in Lyngbak credits.Apply →

Moving production infrastructure? We migrate it for you, free.Talk to us →

PricingEnterpriseDashboard
Start for Free
← All templates

MariaDB Galera

3-node synchronous multi-primary MySQL-family HA on the official image - every node writes, any node can die.

3 GiB

3 services, 15 GB disk

$24/mo

flat resource

$0.037/h

Usage Billing

What is MariaDB Galera?

MySQL-family high availability got harder to ship in 2025 when Broadcom paywalled the Bitnami images everyone’s tutorials used. The good news, verified by actually running clusters: the OFFICIAL mariadb image carries the Galera library, and a 3-node multi-primary cluster forms from pure command-line flags plus one env var.

Galera is synchronous: every node accepts writes, every commit lands on the quorum, and a node loss costs availability nothing. The traps are operational, and this template handles each one found in testing - the bootstrap flag fires only on a genuinely first boot (a permanent flag crash-loops on restart), stop_grace_period is 2 minutes (the 10-second default SIGKILLs mariadbd and poisons cluster state), and the cold-start recovery procedure is documented rather than discovered at 3am.

An app database and user replicate to all nodes at bootstrap. Apps connect to any node - list all three for driver-level failover.

What you get

  • Synchronous multi-primary: write to any node, lose any node
  • Official mariadb:11.8 LTS image - no forks, no paywalled registries
  • Flag-driven clustering; bootstrap-once wrapper (tested) on node 1
  • stop_grace_period and recovery runbook handled, not hand-waved
  • App database/user replicated cluster-wide at bootstrap
  • Per-node volumes; healthchecks via the image’s --galera_online

How it runs on Lyngbak

ServiceRolePublic
galera-1node + bootstrap-once wrapper (:3306)no
galera-2, galera-3nodes (join via SST/IST)no

Before you deploy

  • MARIADB_ROOT_PASSWORD

    root on all nodes

  • MARIADB_APP_PASSWORD

    the replicated app user/database

Sizing and billing

Nodes idle near 135 MiB with default buffer pools - 1 GiB each leaves real working-set room. Three nodes is the quorum minimum; scale by adding blocks to the gcomm list.

Hobby resource$24/mo2 vCPU, 2 GiB + 1 GiB RAM add-on, 60 GiB disk, shared CPU
Pro resource$30.75/mo1 vCPU, 2 GiB + 1 GiB RAM add-on, 15 GiB disk incl. add-on, dedicated CPU
Usage Billing, shared CPU$0.037/h1.5 vCPU, 3 GiB reserved. $27/mo for a full month, billed by the second.
Usage Billing, dedicated CPU$0.14/h3 vCPU, 6 GiB reserved. $102/mo for a full month, billed by the second.

A resource is a flat monthly price, with RAM and disk add-ons when the stack needs a little more than a tier, and room for your own apps on a larger one. On Usage Billing each service takes the smallest size that fits it and is billed by the second it runs, so a stopped stack stops costing CPU and RAM. Its 14.65 GiB of volumes cost $0.15 per GiB a month ($2.20/mo) for as long as they exist. One workspace can use both. See pricing

Run it locally first

The same compose file runs with plain Docker Compose. Clone the template source, copy .env.example to .env, and run docker compose up -d.

Questions

Why not the managed MySQL?

The managed MySQL is the right default for a single instance. This template exists for the HA case - synchronous multi-primary across three nodes - which managed single-instance offerings do not provide. Different reliability class, same project network.

What happened to the Bitnami images everyone used?

Broadcom moved Bitnami to paid “Secure Images” in late 2025; the free mariadb-galera images are frozen without security updates. This template needs none of that: the official mariadb image has shipped the Galera library all along, configured via flags.

What does the bootstrap wrapper actually solve?

Galera’s classic foot-gun: --wsrep-new-cluster must run exactly once, on the first node’s first boot. Left in the command permanently, the safe_to_bootstrap guard crash-loops the node on every restart - verified by testing. The wrapper checks for grastate.dat and adds the flag only when the datadir is genuinely new.

What if the whole cluster stops uncleanly?

Galera refuses to guess which node has the newest data - by design. The README gives the two-step recovery (pick the highest-seqno node, flip safe_to_bootstrap, start it first). It is a documented 2-minute procedure, not an outage mystery.

More in Databases

ClickHouse Cluster

3-node ClickHouse cluster - one shard, three replicas, embedded Keeper. Real replicated OLAP without ZooKeeper pods.

Open the template →

MariaDB

The community MySQL fork, as a single self-hosted node - drop-in compatible.

Open the template →

MariaDB Replication

Asynchronous primary/replica MariaDB - a writable primary streaming to a read-only replica.

Open the template →
MariaDB Galera: a MariaDB Galera cluster with Docker Compose | Lyngbak (formerly Miget)