Best way to backup lxd vm and containers live

Hi All,

Can someone explain to me what the best solution for backups is. (vm, and containers)

Now i shutdown the container and do a lxc export .tar

However this takes a long time. how can i do this more efficient? I have a zfs fileystem. Is there a way to do the backup job with zfs send?

And hwo could one retore this in lxd?

Thank you all for your support.

kind regards,


If you are using zfs, i think the best solution could be snapshot and export the snapshot to another file system. But if you are thinking about the filesystem backup then the best solution can be Bacula system.


What if i do a zfs send to a tarball file.
How could i restore this?

As noted by @cemzafer, the snapshot method seems to be the best.
We have been using this approach for a while and its very effective as you want to avoid downtime

Create the snapshot
lxc snapshot container_name snapshot_name

Snapshot to Image
lxc publish container_name/snapshot_name --alias exported_image

Convert your Image to File
lxc image export exported_image exported_image.tar.gz

You can write move your image to your backup storage


Is i no issue when running database servers?

when i lxc import the image i get a error.

Importing instance: 100% (786.77MB/s)Error: Backup is missing at “backup/index.yaml”

Not at all, from my experience

Never experience this, i will do some findings and revert

thank you

i want to use it this way but if i cant lxc import then i cant use it.

i got it working now.

i was using it wrong. I needed to lxc import the image and the launch as new container.

kind regards,


1 Like