To set up a MariaDB Galera cluster on Ubuntu: give every node the same full member list — wsrep_cluster_address = "gcomm://10.0.0.11,10.0.0.12,10.0.0.13" — add the settings MariaDB’s shipped sample marks mandatory (binlog_format=ROW, innodb_autoinc_lock_mode=2, InnoDB only), open ports 3306, 4567, 4568 and 4444 between nodes, then run galera_new_cluster on the first node only and systemctl start mariadb on the rest.
The single most important line in a Galera config is wsrep_cluster_address, and this is the wrong value to put on every node:
# WRONG -- on all nodes
wsrep_cluster_address="gcomm://"
An empty gcomm:// means “start a new cluster from me”. In Galera’s own source, the bootstrap check reads if ((bootstrap == true || cluster_url == "gcomm://") && safe_to_bootstrap_ == false) — an empty address is treated identically to an explicit bootstrap. Put it on three nodes and you get three separate one-node clusters, each believing it is the whole thing, each accepting writes, none replicating to the others. Nothing errors. You find out when the data disagrees. The correct value lists every member and is the same on every node:
wsrep_cluster_address = "gcomm://10.0.0.11,10.0.0.12,10.0.0.13"
wsrep_node_address = "10.0.0.11" # this node
wsrep_node_name = "node1"
wsrep_cluster_name = "hw_cluster"
Table of Contents
The settings MariaDB marks mandatory are not optional
MariaDB ships its own sample at /usr/share/mariadb/wsrep.cnf. Read out of mariadb-server_11.8.8-1_amd64.deb, the first four lines of this block (down to bind-address) sit under its heading “mysqld options _MANDATORY_ for correct opration of the cluster”, while wsrep_on, wsrep_provider and wsrep_sst_method appear in later sections of the same file. MariaDB’s Galera configuration documentation lists binlog_format=ROW, default_storage_engine=InnoDB, wsrep_on=ON and wsrep_provider as mandatory, but not bind-address or wsrep_sst_method, and it files innodb_autoinc_lock_mode=2 under performance options:
binlog_format=ROW
default-storage-engine=innodb # "Currently only InnoDB storage engine is supported"
innodb_autoinc_lock_mode=2 # "to avoid issues with 'bulk mode inserts' using autoinc"
bind-address=0.0.0.0
wsrep_on=1
wsrep_provider=/usr/lib/galera/libgalera_smm.so
wsrep_sst_method=rsync
That comment settles which storage engines Galera supports: only InnoDB. Writes to a MyISAM table are not replicated. Every node accepts them locally and the nodes quietly disagree — the same failure mode as the gcomm:// bug, arrived at from a different direction.
The provider path above is right, incidentally: galera-4 26.4.23 installs the library at /usr/lib/libgalera_smm.so with a symlink at /usr/lib/galera/libgalera_smm.so.
Three ports, not one
sudo ufw allow 3306/tcp alone does not configure the firewall for Galera. Galera needs three more, so a cluster with only that port open could never form:
sudo ufw allow from 10.0.0.0/24 to any port 3306 proto tcp # client traffic
sudo ufw allow from 10.0.0.0/24 to any port 4567 # replication (tcp + udp)
sudo ufw allow from 10.0.0.0/24 to any port 4568 proto tcp # IST, incremental state transfer
sudo ufw allow from 10.0.0.0/24 to any port 4444 proto tcp # SST, full state snapshot
Note the source restriction. ufw allow 3306/tcp with no source opens MySQL to every host that can route to the machine, and the bind-address=0.0.0.0 above means it is listening. Galera nodes should talk to each other on a private network, not the internet.
wsrep_sst_auth is a plaintext password on every node
State snapshot transfer needs credentials, and MariaDB’s own sample carries wsrep_sst_auth=root: — user and password, in a config file, in the clear, on every node you add. Nothing encrypts it. Use a dedicated account rather than root, hold it to the privileges your SST method documents, and keep the file off world-readable mode:
sudo chown root:mysql /etc/mysql/mariadb.conf.d/60-galera.cnf
sudo chmod 640 /etc/mysql/mariadb.conf.d/60-galera.cnf
Do not install MariaDB 10.5
Adding a third-party mirror pinned to 10.5/ubuntu bionic using apt-key adv has three separate problems. apt-key has been withdrawn in favour of signed-by keyrings — it still ships in Ubuntu 24.04’s apt 2.7.14, but it is gone from apt 3.1.6 in 25.10, so that command now simply fails. bionic is Ubuntu 18.04. And MariaDB 10.5 is finished — its last release was 10.5.29 on 8 May 2025, and it no longer appears in MariaDB’s own list of maintained series. From downloads.mariadb.org‘s REST API on 10 August 2026, the supported long-term series are 12.3 (EOL 2029-06-12), 11.8 (EOL 2030-02-13), 11.4 and 10.11. Take the current repository configuration from mariadb.org/download, or just use the mariadb-server and galera-4 packages in Ubuntu itself, which is the simpler path.
Bringing it up, in order
# node 1 only, and only when no node is already running:
sudo galera_new_cluster
# every other node, one at a time, waiting for each to join:
sudo systemctl start mariadb
# on any node:
SHOW STATUS LIKE 'wsrep_cluster_size'; -- must equal your node count
SHOW STATUS LIKE 'wsrep_local_state_comment'; -- must say 'Synced'
wsrep_cluster_size alone is not enough: a node can be counted while it is still receiving a state transfer. Check wsrep_local_state_comment too. Restarting an existing cluster later has its own order of operations and its own way to lose data — see restarting a Galera cluster safely.
What was not tested
No cluster was built. Galera is Linux-only and this article was written on macOS with no Linux host and no container runtime, so nothing above was executed against a running MariaDB. What was executed: unpacking galera-4 26.4.23 and mariadb-server 11.8.8 from the Ubuntu archive to read the shipped wsrep.cnf and confirm the library path; querying MariaDB’s release API for the version and end-of-life dates; and reading the Galera source for the gcomm:// bootstrap rule. A Linux host is not needed to repeat those three steps: setup-galera-cluster-ubuntu.sh downloads and unpacks the galera-4 and mariadb-server packages, queries the release API and reads the Galera source, and it also tests the apt-key claim above; it installs nothing, starts no cluster, reports the ufw rules and port list as skipped, and skips everything when the Ubuntu archive is unreachable.
Treat the port list as documentation and prove it on your own staging cluster before production.