The “Next – Next – Finish” Nightmare for 100 Servers
When I first started my career, I remember a task I’ll never forget: installing the OS on over 20 physical servers in a single afternoon to hand over to the Dev team. At the time, I only knew how to do it manually: plug in the USB, select the language, partition the disks, set the user/password… and repeat that 20 times. The result was over 5 hours of work, exhausted eyes, and worst of all, 2 servers had incorrect hostnames because of typos made while I was tired.
If you are managing a Lab, Cloud infrastructure, or simply need to quickly create dozens of VMs for testing, clicking through every step is a massive waste of time. Ubuntu Autoinstall (based on Subiquity and cloud-init) is the lifesaver. This tool allows you to define the entire configuration in a single file. You just plug in the ISO, hit boot, and go grab a coffee; 5 minutes later, the server is ready.
Quick Start: Try Autoinstall in 5 Minutes
To see how powerful it is, let’s try creating a minimal configuration file. This file will automatically set the language, keyboard layout, and create an admin user without you lifting a finger.
Create a user-data file with the following content:
#cloud-config
autoinstall:
version: 1
identity:
hostname: itfromzero-server
password: "$6$exDY1SdbMBRfv89B$2lsE9mU78788.16n9E.D0bw9.6.D0bw9.6.D0bw9.6"
realname: IT Admin
username: itadmin
locale: en_US.UTF-8
keyboard:
layout: us
ssh:
install-server: true
allow-pw: true
storage:
layout:
name: direct
Important note: Passwords in the file must be hashed for security. You can generate this hash string with a quick Python command: python3 -c 'import crypt; print(crypt.crypt("mypassword", crypt.mksalt(crypt.METHOD_SHA512)))'.
The fastest way to test is using KVM/QEMU or VMware. Simply attach this user-data file as a secondary drive (NoCloud data source). When the Ubuntu Server ISO boots, the system will automatically find this file and automate the entire installation process from start to finish.
How It Works: Why Is Autoinstall So Powerful?
Since the 20.04 LTS version, Ubuntu has retired the aging Debian Installer (preseed) in favor of Subiquity. The most valuable upgrade is the use of the easy-to-read YAML format and the ability for deep customization through cloud-init.
1. The user-data File: The Heart of the System
This is the blueprint for your future server. It contains every instruction from disk partitioning to software installation. Every standard configuration file must start with the line #cloud-config.
2. Essential Components
- storage: Decides the fate of the hard drive. You can use
layout: directto use the entire disk or configure complex LVM/RAID for specialized server lines. - identity: Where you declare server identity such as hostname and login credentials.
- packages: Automatically pre-installs tools like
vim,git,docker-ceas soon as the machine boots for the first time. - late-commands: The “finalizing” commands before reboot. You can use them to download SSH keys from GitHub or send a Telegram notification once the installation is complete.
Advanced: Building a “Plug-and-Play” ISO
Providing configuration files via virtual drives can sometimes be a bit cumbersome. If you want to be more professional, embed the configuration file directly into the original ISO. This way, you only need a single USB to “sweep through” every physical server.
The process for building a custom ISO usually involves these steps:
# 1. Extract the original ISO (Example: version 22.04.3)
mkdir -p /tmp/iso
7z x ubuntu-22.04.3-live-server-amd64.iso -o/tmp/iso
# 2. Place the config file in the nocloud directory
mkdir -p /tmp/iso/nocloud
cp my-user-data /tmp/iso/nocloud/user-data
touch /tmp/iso/nocloud/meta-data
# 3. Edit boot parameters in grub.cfg
# Add 'autoinstall ds=nocloud;s=/cdrom/nocloud/' so the installer knows where to get the data
sed -i 's/---/autoinstall ds=nocloud;s=\/cdrom\/nocloud\/ ---/g' /tmp/iso/boot/grub/grub.cfg
# 4. Repack the ISO using xorriso
Pro tip: If you’re tired of typing long xorriso commands, look for the ubuntu-autoinstall-generator tool on GitHub. It will help you package the ISO with a single command, saving a lot of time.
Real-world Experience to Avoid Headaches
Through many real-world deployments, I’ve gathered 4 important notes to help you avoid silly mistakes:
Be Careful with YAML Syntax
YAML is extremely picky about whitespace (indentation). Just one extra space and the installer will freeze and force you to intervene manually. Always check your files through online linters before building.
Prioritize SSH Keys over Passwords
For security and ease of management, declare your SSH Keys right in the configuration file. This allows you to SSH into the server immediately without needing to remember complex hashed passwords.
ssh:
install-server: true
authorized-keys:
- ssh-rsa AAAAB3Nza... user@itfromzero
Don’t Forget Static Network Configuration
In Data Center environments without DHCP, the server will hang while trying to request an IP. Declare a specific Static IP in the network section to ensure the installation process goes smoothly.
Leverage late-commands to Install Agents
I often use late-commands to install Zabbix Agent or Prometheus Exporter. This way, as soon as the server is installed, it automatically appears on the monitoring dashboard without needing post-installation configuration.
late-commands:
- curtin in-target -- target apt-get update
- curtin in-target -- target apt-get install -y qemu-guest-agent
In summary, Ubuntu Autoinstall isn’t just for massive systems. Even if you only have 2-3 servers, creating a standard configuration file will keep your environment consistent and professional. Let the machines handle the repetitive tasks so you can spend your time researching more interesting things.

