Where Does LXD Store Data and Config?
LXD data directory for snap and deb installs, with the database, logs and storage layout.
Last updated
LXD stores server state in a data directory whose path depends on the install method. Snap installs, the common case on Ubuntu, use a directory under /var/snap. Traditional deb installs use /var/lib/lxd instead. Both hold the database, logs, storage pools and network state together.
The database is the heart of it. Global config lives in database/global.sqlite, and instance storage pools hang off storage-pools beside it. Direct edits to the database invite corruption, so the supported inspection route is lxc query and lxc config rather than sqlite surgery.
Where LXD stores this, by platform
/var/snap/lxd/common/lxd
Key children: database/global.sqlite for config, storage-pools for dir driver data, logs per instance, and unix.socket for local CLI access. Deb based installs use /var/lib/lxd with the same interior layout. Root access required either way.
Frequently asked questions
how do i back up an lxd host
Tarball the data directory with the daemon stopped. Like Incus, LXD splits state between its database and on disk storage, so partial copies restore nothing usable. Snap users must catch the right root, since /var/lib/lxd does not exist on their systems.
is lxd data in var lib or var snap
Check which install you have first: snap uses /var/snap/lxd/common/lxd and deb uses /var/lib/lxd. Guides quoting the wrong one send you to a nonexistent folder, which is the most common confusion in LXD file hunts.
Notice an outdated path? Let us know.