Creating Virtual Machines with Templates in Proxmox
Proxmox is a powerful, free, and convenient virtualization platform that turns a single physical server into a flexible control center for virtual machines. Using a unified web interface, you can launch and manage multiple servers, create their backups, and combine them into local networks.
Virtualization is not only about environment isolation but also about deployment speed. A traditional operating system installation on virtual servers via an ISO image is a reliable but slow method: booting, manual installation, network configuration, and adding users. Such a process takes time and requires administrator attention at every step.
Modern infrastructure management practices require a different approach—fast, reproducible, and automatable.
Using ready-made cloud images in Proxmox allows you to get a working virtual machine (VM) in minutes, immediately ready for work and integration into workflows. With Cloud-Init, you can automatically add a user, set a password, add SSH keys, and configure network parameters.
In this guide, we will look at how to create a template from an Ubuntu 22.04 cloud image in Proxmox and, based on it, create new virtual machines and set up their parameters using Cloud-Init.
The described method is suitable for images in .img and .qcow2 formats.
This guide assumes that Proxmox is already deployed on your dedicated server.
Creating a Virtual Machine Copy link
Go to the Proxmox web interface at: https://your-ip-address:8006.
In it, create a VM, going through the tabs:
-
General: Set the virtual machine name and its ID. You can use any number as the ID—it is used to reference the server in console commands.

Creating a virtual machine in the Proxmox interface
-
OS: Select “Do not use any media.”

Selecting the OS in the Proxmox interface
-
System: Check the QEMU Agent box for better integration between Proxmox and the guest OS.

Selecting the system parameters in the Proxmox interface
-
Disks: Delete all disks—we will later use a disk from the image.

Configuing disks in the Proxmox interface
-
CPU: Set 1 core. Leave other parameters at default. Change them only if you know what you’re doing.

Configuing CPU parameters in the Proxmox interface
-
Memory: Set minimal parameters.

Configuing memory parameters in the Proxmox interface
-
Network: Choose the interface to be used in the virtual machine, e.g.,
vmbr0.

Configuing network parameters in the Proxmox interface
Save, but do not start the virtual machine. Remember the VMID, as you will need it later.
Adding a Cloud Disk to the Virtual Server Copy link
On the Ubuntu downloads page, copy the link to the image with architecture amd64 and extension .img.

Downloads page on the Ubuntu website
Next, you need to add a monitor emulator to the created virtual machine, since it may be missing in some images. It is required for the virtual machine console to work in the Proxmox interface.
Connect to the Proxmox server via SSH and run the following command (replace 100 with your VMID):
qm set 100 --serial0 socket --vga serial0
Then download the image to the server using wget:
wget https://cloud-images.ubuntu.com/jammy/current/jammy-server-cloudimg-amd64.imgBind the disk image to the created machine:
qm disk import 100 jammy-server-cloudimg-amd64.img local-lvmIn our case, the storage name is local-lvm, but yours may differ.
After a successful import, you will see a notification like that:

In the virtual machine settings, under Hardware, you will see the Unused disk:

The "Hardware" section in the Proxmox interface
Go into its settings, check Advanced, enable Discard and SSD emulation, then click Add.

Adding a disk in the Proxmox interface
In the same section, delete the CD/DVD device—it is no longer needed.

The "Hardware" section in the Proxmox interface
Add a Cloud-Init disk:
-
Click Add, choose CloudInit Drive.

The "Hardware" section in the Proxmox interface
-
In its settings, select the storage location.

Adding a cloudinit drive in the Proxmox interface
Next, select the disk to boot the system from:
-
Go to Options → Boot Order.

The "Options" section in the Proxmox interface
-
Uncheck existing boxes and choose the disk attached earlier.

Configuring boot order in the Proxmox interface
Check that the machine was created correctly:
-
Start it, then open the console via Start and Console in the top right corner.

The "Cloud-init" section in the Proxmox interface
-
Wait for the login prompt. If it appears, the boot was successful. You can then close the console.

Console in the Proxmox interface
Creating a Template from the Virtual Server Copy link
In Proxmox, a template is a “blueprint” for a VM with pre-configured basic parameters.
To create a template from this virtual machine:
- Right-click it in the VM list.
- In the menu, select Convert to template.

Creating a template in the Proxmox interface
After conversion, the virtual machine icon will change.
Now, based on this template, we can create virtual machines with parameters defined via Cloud-Init.
Creating a Virtual Server from the Template Copy link
For example, let’s create a virtual server with storage with the user Hostman.
- Right-click the template and select Clone.

Creating a VM from a template in the Proxmox interface
- Enter a name and choose Full Clone so that the virtual machine is independent of the template.

Creating a VM from a template in the Proxmox interface
- Open the new machine’s settings and configure CPU and RAM parameters.

Configuring CPU parameters in the Proxmox interface
To change disk size:
-
Select the disk in the list, then in Disk Action choose Resize.

Configuring disks in the Proxmox interface
- Enter how many gigabytes to add to the existing size. For example, if you add 10 GB, a disk of 12.2 GB will be created, since the original image disk size is 2.2 GB.
- Click Resize disk.

Resizing the disk in the Proxmox interface
Go to the Cloud-Init section. Here you can:
-
Specify the user and set a login.

The "Cloud-init" section in the Proxmox interface
-
Set a password.

The "Cloud-init" section in the Proxmox interface
If you specify the root user and set a password, you will be able to log in as root with the new password. This is useful if you don’t need to create a new user.
Other Cloud-Init options include:
- SSH public key: Add the SSH key for server access. By default, in a virtual server created from this image, SSH login with a password is disabled.
- Upgrade packages: Set to yes to update packages when the server is created.
- IP Config: Assign a static IP address (useful if virtual machines will use different external IPs). You can also use DHCP for a dynamic address.

Network configuration in the Proxmox interface
After specifying all required parameters:
- Start the machine and open the console.
- Log in as
Hostman.

- Verify that the server was created with the desired configuration.

Conclusion Copy link
With templates, we can quickly add virtual machines with different operating systems and required configurations, modify user parameters in Cloud-Init, and configure the network.
In addition, cloud image sizes take up significantly less disk space. For example, the Ubuntu 22.04 cloud image is only 646 MB, while the ISO image is 2 GB.
This method of creating virtual machines is especially valuable when speed, stability, and predictability of results are important: in test environments, DevOps infrastructure, and when massively deploying identical services.
Most importantly, it frees up time that would otherwise be spent on endless "Next" clicks in the installer, allowing you to focus on truly important tasks: infrastructure development and optimization.