123DevOps··10 min read

Installing Ubuntu Desktop with autoinstall: from USB stick to an automated dev workstation

Get to know the current Ubuntu releases, do an interactive Ubuntu Desktop install, then automate it all with a commented autoinstall.yaml file, tested in a VM and finished with post-install tweaks.

Linux

Installing Ubuntu once is easy. Repeating the same screens and the same twenty commands on the fifth machine is repetitive work, and repetitive work is what we automate. In this guide you’ll look at the current Ubuntu releases, do a normal Ubuntu Desktop install, and then turn your choices into a YAML file that the installer reads on its own.

First things first: “customize.yml” or autoinstall?

Many people search for a “customize.yml” to customize the Ubuntu install. The idea is right, but the official name is different: the mechanism is called autoinstall, and the file is called autoinstall.yaml. No official Ubuntu documentation uses customize.yml, which is why this article teaches the autoinstall format.

The good news: when you provide the file by URL, you choose the address, so you can serve the content under whatever name you like (even customize.yml). What matters is the format of the content. When the file goes at the root of the USB stick, though, the installer looks for exactly autoinstall.yaml.

The current Ubuntu releases

Ubuntu has two kinds of releases. LTS (Long Term Support) releases come out every two years, in April of even years, and get 5 years of standard support, 10 with Ubuntu Pro ESM and 15 with the Legacy add-on. Interim releases come out every six months and get only 9 months of support.

Release Codename Type Released Standard support Extended support (Ubuntu Pro)
26.04 LTS Resolute Raccoon LTS Apr 23, 2026 (26.04.1 on Aug 27, 2026) until May 2031 ESM until May 2036; Legacy until May 2041
26.10 Stonking Stingray interim Oct 15, 2026 until Jul 2027 (9 months) not applicable
24.04 LTS Noble Numbat LTS Apr 2024 until 2029 (official pages disagree between May and June) ESM for 5 more years

26.04 LTS ships kernel 7.0 and GNOME 50, uses sudo-rs as the default sudo, and offers TPM-backed disk encryption right in the installer. 26.10 comes with Linux 7.3 and GNOME 51. The next release, 27.04, is expected in April 2027, but that date has not been confirmed by an official page yet.

For a workstation, use the LTS. 26.04 recommends a 2 GHz dual-core CPU, 6 GB of RAM and 25 GB of disk.

Interactive install, in short

Download and check the image

Download the Ubuntu Desktop ISO from ubuntu.com and, from the release directory, the SHA256SUMS file, which confirms the image isn’t corrupted. The commands below are general-purpose and were not run for this article:

cd ~/Downloads
sha256sum -c SHA256SUMS --ignore-missing   # should print "OK" for your ISO

Write the USB stick

The ISOs are hybrid and can be written straight to a USB stick. On Linux, find the device with lsblk (before and after plugging in the stick) and write to the whole disk, such as /dev/sdb, never to a partition such as /dev/sdb1. On Windows or macOS, balenaEtcher does the job. The detailed walkthrough, with dd, is in the Debian installation article.

lsblk                                           # identify the USB stick carefully
sudo dd if=ubuntu-desktop.iso of=/dev/sdX bs=16M status=progress oflag=sync

The installer screens

The Ubuntu Desktop installer is a Flutter app on top of the Subiquity backend. For 26.04, the official tutorial lists: Choose your language, Accessibility, Keyboard layout, Internet connection, Try or install Ubuntu, Type of installation (Interactive or Automated), Applications, Optimise your computer (third-party software and extra media formats), Disk setup, conditional encryption screens, Create your account, Select your timezone, Ready to install and Installation complete.

Autoinstall on Ubuntu Desktop

Ubuntu Desktop supports autoinstall since version 23.04 (Server since 20.04). 24.04 LTS added the page for loading the file by URL, and Subiquity 24.04.1 brought it to every Desktop flavor.

Three ways to provide the file

Method How it works File name
In the UI Under “Type of installation”, choose Automated installation and enter a URL (on 26.04 you can also use another USB stick or Landscape) your choice, it’s the address you type
On the install medium Put the file at the root of the USB stick, on the partition that holds the casper/ folder autoinstall.yaml
On the kernel command line Add subiquity.autoinstallpath=path/to/autoinstall.yaml at boot whatever the path says

If there is more than one source, the precedence order is: kernel command line, root of the installer system, cloud-config and, last, root of the ISO. There is also cloud-init NoCloud (autoinstall ds=nocloud-net;s=http://_gateway:3003/), more common on servers.

Serving the file on your local network

For the URL method, the HTTP server built into Python is all you need (if the terminal is still new to you, see how to use the terminal):

cd ~/autoinstall              # folder with autoinstall.yaml
python3 -m http.server 3003   # serves the folder on port 3003

In the installer, enter http://YOUR-MACHINE-IP:3003/autoinstall.yaml. Find the IP with ip -brief address. This server has no password and no HTTPS: use it only on your own network and stop it with Ctrl + C when you’re done.

A complete autoinstall.yaml for a dev workstation

Generating the password hash

The user’s password never goes in as plain text: the password field takes a SHA-512 hash. Commands as given in the official documentation:

openssl passwd -6                          # prompts for the password and prints the $6$... hash
sudo apt install whois && mkpasswd -m sha-512   # alternative

Put the hash in quotes in the YAML, because it contains $.

The commented file

Every key below comes from the official autoinstall reference. Since 24.04, the file may have the autoinstall: key at the top, as here:

autoinstall:
  version: 1                      # required

  # [] = fully automatic. Use, for example, [storage] to pick the disk on screen
  interactive-sections: []

  source:
    id: ubuntu-desktop-minimal    # or ubuntu-desktop (extended selection)

  locale: pt_BR.UTF-8
  keyboard:
    layout: br
    variant: ""
  timezone: America/Sao_Paulo

  identity:
    realname: "Dev User"
    username: dev
    hostname: dev-workstation
    # hash generated with: openssl passwd -6   (always quoted)
    password: "$6$example$REPLACE_WITH_YOUR_HASH"

  storage:
    layout:
      name: lvm                   # default; other options: direct, zfs, btrfs, hybrid (TPM)
      # password: "disk-passphrase"  # uncomment to encrypt (LUKS on LVM)

  ssh:
    install-server: true          # needs access to the Ubuntu archive online
    allow-pw: false               # key-based login only
    authorized-keys:
      - "ssh-ed25519 AAAA...YOUR_PUBLIC_KEY [email protected]"

  codecs:
    install: true                 # extra media formats
  drivers:
    install: true                 # third-party drivers (e.g. GPU)

  updates: security               # or all

  packages:
    - git
    - curl
    - vim
    - build-essential
    - htop
    - jq
    - flatpak

  snaps:
    - name: code                  # Visual Studio Code
      classic: true

  late-commands:
    # runs in the installed system (mounted at /target) before first boot
    - curtin in-target -- apt-get -y autoremove

  shutdown: reboot                # or poweroff

The example uses a Brazilian setup (pt_BR.UTF-8, br keyboard, São Paulo time zone); swap in your own locale, layout and time zone. Watch out: with password, the lvm layout turns on LUKS, but the passphrase sits in plain text, so don’t expose that file on the network. The Desktop ISO has no openssh-server, so ssh.install-server needs internet access. And there’s no gsettings in late-commands because curtin in-target runs as root, without the user’s graphical session; that belongs in the post-install script.

Validating before you use it

One indentation error takes down the whole install, so check the syntax first (requires the python3-yaml package):

python3 -c "import yaml,sys; yaml.safe_load(open(sys.argv[1]))" autoinstall.yaml && echo "YAML ok"

This example passed that check and had its keys compared against the official reference, but it was not actually installed on a machine. There is also an official validator in the Subiquity repository (scripts/validate-autoinstall-user-data.py); it assumes a Server install, so it may reject the Desktop source.id values, and it must never be run with sudo.

Test in a virtual machine first

With interactive-sections: [], the installer wipes the disk without asking. So always test in a VM before using it on a real machine: GNOME Boxes, virt-manager (QEMU/KVM) or VirtualBox will do. On Windows, WSL is great for editing and validating the YAML, but it doesn’t replace a VM for testing the install.

Post-install customization

Drivers with ubuntu-drivers

sudo ubuntu-drivers list                     # lists the available drivers
sudo ubuntu-drivers install --recommended    # installs the recommended one (26.04 release notes)

Flatpak or Snap?

Snap and App Center are Ubuntu’s defaults, and in 26.04 snaps integrate better with XDG portals and show up in GNOME search. Flatpak isn’t preinstalled: in our YAML it comes in through the packages list, and you add the Flathub repository by following the instructions on flathub.org. Rule of thumb: use Snap by default and Flatpak when an app only exists on Flathub.

GNOME tweaks with gsettings

This script runs as your user (no sudo), inside the graphical session. It only sets a key if that key exists in your GNOME version, because the names haven’t been confirmed for GNOME 50. It passed bash -n and shellcheck. If shell scripting is still new to you, read what is a shell and shell scripting.

#!/usr/bin/env bash
# gnome-settings.sh: GNOME preferences for the workstation
# Run as your user (no sudo), inside the graphical session.
set -euo pipefail

# Only set the key if the schema and key exist in this GNOME version
set_key() {
  local schema="$1" key="$2" value="$3"
  if gsettings list-keys "$schema" 2>/dev/null | grep -qx "$key"; then
    gsettings set "$schema" "$key" "$value"
    echo "ok: $schema $key = $value"
  else
    echo "skipping: $schema $key (not available here)" >&2
  fi
}

set_key org.gnome.desktop.interface color-scheme "'prefer-dark'"
set_key org.gnome.desktop.interface show-battery-percentage true
set_key org.gnome.desktop.interface clock-show-weekday true
set_key org.gnome.desktop.peripherals.touchpad tap-to-click true
set_key org.gnome.desktop.wm.preferences button-layout "'appmenu:minimize,maximize,close'"
set_key org.gnome.desktop.input-sources sources "[('xkb', 'br')]"
set_key org.gnome.shell.extensions.dash-to-dock dock-position "'BOTTOM'"

Extensions

The Extension Manager app (package gnome-shell-extension-manager) is a popular way to manage extensions, though it isn’t an official Ubuntu recommendation. Install only a few: each extension may break with the next GNOME release.

Troubleshooting

Where are the logs? The official documentation consulted for this article doesn’t give the path. In general, the installer writes its logs to /var/log/installer/, both in the live environment and on the installed system; confirm it in the documentation for your release.

YAML error? Most of the time it’s indentation (use spaces, never tabs), an unquoted hash or a misspelled key. Run the Python check above and compare each key with the official reference (the schema describes what goes inside autoinstall:). If the installer ignores the file, open the URL from another computer and see whether python3 -m http.server logged the request.

Once you’ve mastered Ubuntu, it’s worth getting to know the distribution it’s based on: see how to join the Debian community.

Checklist

  • Pick the current LTS release for the workstation
  • Check the ISO against SHA256SUMS before writing the USB stick
  • Generate the password hash with openssl passwd -6 and put it in quotes
  • Validate autoinstall.yaml with Python before every use
  • Test the automated install in a VM before the real machine
  • Run ubuntu-drivers and the gsettings script after the first login
  • Keep autoinstall.yaml in a Git repository to version your changes

Click through the screens once to learn; write the YAML so you never have to click again.

Get updates on new posts and stay in the loop!