Create LXC Image from Container or Snapshot

I’d like to be able to produce an image with an app like MediaWiki and all its dependencies in it so it is easy to install multiple wikis on my server.

With Incus, it looks like it easy to create an image from a container or snapshot. Even so, I’m not yet convinced Incus is the best fit for my project. I’ve been reading Incus documentation and I think I will need very little Incus functionality. For example, I don’t need or want the Incus daemon on my server. I’m still investigating Incus but, so far, LXC seems like a better fit.

It looks like reasonably sophisticated task to write a quality YAML configuration file for distrobuilder to be able to create an LXC image.

Is there a way to create an LXC image from a container (created with lxc-create) or snapshot (created with lxc-snapshot).

You should be able to make a .tar.xz tarball of /var/lib/lxc/NAME/rootfs/ as well as manually putting together a meta.tar.xz tarball, then pass both to the local template to create a new container.