Config generators
Proxmox cloud-init template generator
Build a Proxmox VE VM template from an official Debian or Ubuntu cloud image: a cloud-init user-data file with your user, SSH keys, packages and the QEMU guest agent, plus the exact qm commands to import the image and turn it into a template you can clone in seconds.
- ⚠ Add at least one SSH public key (password login stays disabled)
snippets/debian-vm-user.yaml
#cloud-config
hostname: debian-vm
timezone: UTC
users:
- name: admin
groups: [sudo]
shell: /bin/bash
sudo: "ALL=(ALL) NOPASSWD:ALL"
lock_passwd: true
ssh_authorized_keys:
ssh_pwauth: false
package_update: true
package_upgrade: true
packages:
- qemu-guest-agent
- curl
- htop
runcmd:
- [systemctl, enable, --now, qemu-guest-agent]
Proxmox host commands
# On the Proxmox host (as root). The snippet storage needs the "snippets" content type:
# pvesm set local --content iso,vztmpl,backup,snippets
# Save the user-data as /var/lib/vz/snippets/debian-vm-user.yaml (path of the "local" storage).
wget -O /root/debian-12-genericcloud-amd64.qcow2 https://cloud.debian.org/images/cloud/bookworm/latest/debian-12-genericcloud-amd64.qcow2
qm create 9000 --name debian-vm-template --ostype l26 --memory 2048 --cores 2 --cpu host \
--net0 virtio,bridge=vmbr0 --scsihw virtio-scsi-single --agent enabled=1 \
--serial0 socket --vga serial0
qm set 9000 --scsi0 local-lvm:0,import-from=/root/debian-12-genericcloud-amd64.qcow2,discard=on
qm resize 9000 scsi0 32G
qm set 9000 --ide2 local-lvm:cloudinit --boot order=scsi0 --ipconfig0 ip=dhcp
qm set 9000 --cicustom "user=local:snippets/debian-vm-user.yaml"
qm template 9000
# New VM from the template (full clone), then start it:
# qm clone 9000 9001 --name debian-vm --full && qm start 9001
How to use it
- Enter hostname, user and at least one SSH public key; password login stays disabled.
- Pick the cloud image and the VM ID, storage and bridge names of your Proxmox host.
- Enable the "snippets" content type on the snippet storage and save the user-data file in its snippets folder (/var/lib/vz/snippets for the "local" storage).
- Run the commands on the Proxmox host as root, then clone the template (full clone) for each new VM.
Formula and method
qm create VM with virtio network, virtio-scsi-single, serial console, guest agent qm set --scsi0 <storage>:0,import-from=<image> (import the cloud image as the disk) qm resize scsi0 <size>G qm set --ide2 <storage>:cloudinit --boot order=scsi0 --ipconfig0 ip=dhcp qm set --cicustom "user=<snippet storage>:snippets/<file>" qm template <vmid>
- import-from needs Proxmox VE 7.2 or newer; on older versions use qm importdisk and attach the disk by hand.
- With --cicustom user=… your file replaces the user part that Proxmox would generate, so the cloud-init user and SSH key fields in the web interface are not used for that VM.
- Cloud images change regularly; the commands download the current image from cloud.debian.org or cloud-images.ubuntu.com.
Worked example
For Debian 12 with VM ID 9000 on local-lvm the commands download debian-12-genericcloud-amd64.qcow2, import it with qm set 9000 --scsi0 local-lvm:0,import-from=/root/debian-12-genericcloud-amd64.qcow2, grow it with qm resize 9000 scsi0 32G, attach the cloud-init drive and snippets/debian-vm-user.yaml, and finish with qm template 9000.
FAQ
Why use a cloud image instead of the installer ISO?
Cloud images are small, preinstalled systems built for cloud-init. A clone boots in seconds with your user, keys and packages already set up, instead of going through the installer for every VM.
Why install the QEMU guest agent?
It lets Proxmox show the VM’s IP addresses, shut it down cleanly and freeze the file system for consistent backups and snapshots.
Can I set a static IP address?
Yes: replace --ipconfig0 ip=dhcp with, for example, --ipconfig0 ip=192.168.1.50/24,gw=192.168.1.1 on the clone, or set it per VM in the Cloud-Init tab.
Related tools
- Docker Compose generator — Build a clean compose.yaml service — image, ports, volumes, environment, restart policy — with correct YAML quoting.
- 3-2-1 backup & retention calculator — Storage needed for daily, weekly and monthly restore points across your backup copies, and a 3-2-1 rule check.
Formulas reviewed November 27, 2026 by Novian · runs entirely in your browser · methodology