Linux

Where Does etcd Store Data?

etcd persists snapshots and WAL in its data dir, defaulting to default.etcd with /var/lib/etcd for packages.

Last updated

etcd writes everything into one data directory per member. Snapshots and write ahead logs sit together there, keyed by the data-dir flag or ETCD_DATA_DIR variable. Bare binaries default to a folder in the working directory.

Package installs and Kubernetes distributions relocate it to system paths. Never copy the folder while the member runs. Backups go through etcdctl snapshot commands, which read consistently without stopping the cluster.

Where etcd stores this, by platform

Linux
/var/lib/etcd

Conventional system path on package installs and managed clusters. Bare binaries default to default.etcd under the working dir. Confirm with the active data-dir flag.

Frequently asked questions

How do I back up etcd?

Run etcdctl snapshot save to a file with the right endpoints and certs. File copies of a live data dir corrupt silently. Restore with snapshot restore onto stopped members.

Where does k3s keep etcd data?

Embedded under /var/lib/rancher/k3s/server/db/etcd for its bundled datastore. External etcd setups use the system path instead. Check the k3s config for the active backend.

Notice an outdated path? Let us know.