I am happy to introduce incus-apply, a tool for declarative incus configuration management.
I have been mulling over the idea for a while. I was able to finally put something together and for the past few days adopted it for all my incus related setups.
Why?
The incus cli is very easy and simple to use, coupled with the webui. However, it is lacking an easy (and reproducible) way to define resources.
There are existing options like the terraform provider and incus-compose.
Terraform is more suited to complex infrastructure setups, and it can be an overkill when you simply want to define few instances. Incus-compose on the other hand does not fully align with incus as it provides a docker focused perspective.
incus-apply is exactly incus with no learning curve and no translation layer. If you can use the Incus cli, you can use incus-apply.
Configuration
Example config for a debian container.
# Basic Debian container
kind: instance
name: debian
image: images:debian/13
config:
limits.cpu: "2"
limits.memory: 2GiB
description: Debian container
A simple incus-apply debian.yaml afterwards would have the instance up and running. And a subsequent incus-apply -d debian.yaml would tear down the instance.
Demo
Feedbacks pls
The project is available at https://github.com/abiosoft/incus-apply. Kindly give it a try and share your experiences ![]()