For homelab (but not only) you can install Proxmox Virtual Environment on your physical machine. You end up with a way to create VMs and containers with a web UI. It supports cloud-init too. If you have a spare machine it's excellent for experimenting and learning.
https://www.proxmox.com/en/proxmox-virtual-environment/overv...
https://proxmox-helper-scripts.vercel.app/