Some people use Kodi in headless mode. This headless mode is not in upstream for some reason, and they use a very simple patch to make Kodi work without a GUI.
To do so, they have a docker project at https://hub.docker.com/r/linuxserver/kodi-headless/ (source: https://github.com/linuxserver/docker-kodi-headless) which applies the patch and then recompiles Kodi.
There has been some discussion about this on the LXD forum and I believe that the easiest solution would be to adapt the existing snapcraft.yaml of Kodi to make a snap for Kodi Headless. Since Kodi Headless does not require any graphics suppose, it would be easy to take away all GUI dependencies.
Is anyone familiar enough with this to take it over? It would be much easier to install than the way of docker-headless.