easy path: use `dd` to an img after all your needed is installed.
balanced path: use ubuntu-cloud image, the `.img` version like [this]( https://mirrors.ustc.edu.cn/ubuntu-cloud-images/noble/20240612/noble-server-cloudimg-amd64.img) , then you can mount the loop device, `chroot` into it and do what you want to do. For encrypt disk purpose like LUKS, you can fdisks it. Finally use `dd` to install.
official path: rebuild whole image. add script in live-install step.