Ubuntu LTS Server Installation: Subiquity Autoinstall, LVM-on-LUKS2, Netplan & De-Snapping
Created: 2026-11-06 · Last updated: 2026-11-13 · Nejat Hakan
Management Summary: Ubuntu LTS (
24.04 Noble Numbat) powers a massive proportion of global cloud instances, AI/CUDA compute clusters, and enterprise production workloads. However, an unmodified out-of-the-box installation bundles background telemetry,snapdsquashfs loop mounts, an unsegregated single-LV storage layout, and opaque auto-update mechanisms. This comprehensive masterclass details the production deployment of Ubuntu LTS Server across 9 technical chapters: from Subiquity/Curtin internals and GPG ISO verification to a CIS-compliant LVM-on-LUKS2 storage topology, unattended zero-touch provisioning viaautoinstall.yaml, TPM2 and Clevis/Tang Network-Bound Disk Encryption (NBDE), and complete de-snapping, culminating in redundant Netplan networking (LACP bonding, VLAN trunks, bridges), DEB822 repositories, and an operational troubleshooting runbook.
-
Subiquity &
autoinstall.yaml
Provision bare-metal and KVM servers unattended using Cloud-Init-compatible YAML manifests declaring disk partitions, LUKS2, LVM, and SSH.
-
LVM-on-LUKS2 & Clevis/Tang
Argon2id full disk encryption with strict LV isolation (
/var,/var/log,/tmp) and automated decryption via TPM2 or Tang servers. -
De-Snapping & Telemetry Purge
Purge
snapdsquashfs loop mounts,ubuntu-report,apport, and outbound MOTD news HTTP calls, locking them out via APT pinning. -
Enterprise Netplan (
networkd)
Orchestrate resilient 802.3ad LACP bonds, 802.1Q VLAN trunks, and KVM software bridges declaratively in
/etc/netplan/with rollback protection.
1. Architecture of the Provisioning Pipeline: Subiquity, Curtin & Cloud-Init
Unlike the traditional Debian Installer (d-i), which extracts thousands of individual .deb packages sequentially via dpkg, Ubuntu Server employs a high-speed three-stage provisioning pipeline:
- Subiquity: The Python-based server installer framework (TUI and autoinstall engine) that ingests and validates operator inputs or an
autoinstall.yamlspecification. - Curtin (THE CURT Installer): A high-throughput block-level installer. It partitions NVMe drives, initializes LUKS2 and LVM structures, and extracts a pre-assembled squashfs root image directly onto the target filesystem in seconds.
- Cloud-Init: Executes during initial system boot (as well as during the chroot
late-commandsphase) to customize host identity: hostname, SSH host keys, administrative accounts, Netplan networking, and additional package installation.
%%{init: {'flowchart': {'wrappingWidth': 350}}}%%
flowchart TB
ISO["Ubuntu Live-Server ISO<br/>(Kernel + Casper Squashfs)"] ==> Subiquity["1. Subiquity Engine<br/>(Parses autoinstall.yaml / TUI)"]
Subiquity --> Curtin["2. Curtin Block Installer<br/>(GPT, LUKS2, LVM & Image Write)"]
Curtin --> TargetChroot["Target Chroot (/target)<br/>(Initramfs, GRUB2 & late-commands)"]
TargetChroot ==> Reboot["Initial System Boot<br/>(UEFI Secure Boot -> Kernel)"]
Reboot --> CloudInit["3. Cloud-Init First-Boot<br/>(Netplan, SSH Keys, Identity)"]
CloudInit --> HardenedOS["Hardened Production Host<br/>(AppArmor, De-Snapped, DEB822)"]
2. Cryptographic ISO Verification & UEFI Secure Boot Preparation
Prior to flashing installation media, the cryptographic integrity and authenticity of the downloaded ISO must be verified against official Canonical signing keys.
1. Downloading Installation Media and Signature Manifests
# Download Ubuntu 24.04 LTS Live-Server ISO and checksum manifests
wget https://releases.ubuntu.com/24.04/ubuntu-24.04.1-live-server-amd64.iso
wget https://releases.ubuntu.com/24.04/SHA256SUMS
wget https://releases.ubuntu.com/24.04/SHA256SUMS.gpg
2. Importing Canonical Signing Keys and Verifying Signatures
# Retrieve official Ubuntu CD Image Signing Key from keyserver
gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys \
843938DF228D22F7B3742BC0D94AA3F0EFE21092
# Inspect key fingerprint explicitly
gpg --list-keys --with-fingerprint 843938DF228D22F7B3742BC0D94AA3F0EFE21092
# Validate cryptographic signature of the SHA256SUMS manifest
gpg --verify SHA256SUMS.gpg SHA256SUMS
Output must confirm:
gpg: Good signature from "Ubuntu CD Image Automatic Signing Key (2012) <cdimage@ubuntu.com>"
3. Validating SHA-256 Image Checksum
Only after receivingubuntu-24.04.1-live-server-amd64.iso: OK should the image be written to USB media or mounted via BMC/IPMI virtual media (iDRAC, iLO).
3. Enterprise Storage Architecture: LVM-on-LUKS2 & CIS Mount Isolation
The Hazard of Ubuntu's Default LVM Layout
Selecting the default "Use an entire disk and set up LVM" option in the Ubuntu installer causes Subiquity to create a single monolithic Logical Volume (ubuntu-lv) mounted at /—while frequently leaving 50% of the Volume Group unallocated!
Production Risk: If /var/log fills up due to a runaway service or DDoS flood, or a local process exhausts /tmp, the entire root filesystem reaches 100% capacity and crashes the operating system.
CIS-Compliant Partition and Logical Volume Schema
For hardened production hosts, critical system hierarchies are segregated into dedicated Logical Volumes inside an Argon2id-protected LUKS2 container:
| Volume / Partition | Mountpoint | Size (e.g., 500 GB NVMe) | Filesystem | Mandatory CIS Mount Flags |
|---|---|---|---|---|
/dev/nvme0n1p1 |
/boot/efi |
1 GB | FAT32 (vfat) |
umask=0077,noexec,nodev,nosuid |
/dev/nvme0n1p2 |
/boot |
2 GB | Ext4 | defaults,nodev,nosuid |
vg_ubuntu/lv_root |
/ |
40 GB | Ext4 / XFS | defaults,errors=remount-ro |
vg_ubuntu/lv_var |
/var |
80 GB | Ext4 / XFS | defaults,nodev |
vg_ubuntu/lv_log |
/var/log |
30 GB | Ext4 / XFS | defaults,nodev,nosuid,noexec |
vg_ubuntu/lv_audit |
/var/log/audit |
10 GB | Ext4 / XFS | defaults,nodev,nosuid,noexec |
vg_ubuntu/lv_tmp |
/tmp |
15 GB | Ext4 / XFS | defaults,nodev,nosuid,noexec |
vg_ubuntu/lv_home |
/home |
50 GB | Ext4 / XFS | defaults,nodev,nosuid |
(Note: Intentionally leave 20–30% of the vg_ubuntu Volume Group unallocated so volumes can be expanded online at any time via lvextend -r without downtime, or used for LVM snapshots!).
4. Zero-Touch Provisioning via autoinstall.yaml (Cloud-Init)
For repeatable, deterministic fleet provisioning (Infrastructure as Code), Ubuntu replaces legacy Debian preseed files with declarative autoinstall.yaml manifests.
Complete Production Manifest (user-data)
Create a file named user-data (accompanied by an empty meta-data file):
# user-data (Subiquity Autoinstall Configuration for Ubuntu 24.04 LTS)
# ==============================================================================
#cloud-config
autoinstall:
version: 1
# 1. Localization & Timezone
locale: en_US.UTF-8
keyboard:
layout: us
timezone: UTC
# 2. Minimal Package Footprint (avoids unnecessary bloat)
source:
id: ubuntu-server-minimal
search_drivers: false
# 3. Primary Administrative Identity (Generate hash via: mkpasswd -m sha-512)
identity:
hostname: prod-ubuntu-node01
username: sysadmin
password: "$6$rounds=656000$saltsalt$HashedPasswordStringHere"
# 4. Hardened OpenSSH Daemon from Initial Boot
ssh:
install-server: true
allow-pw: false
authorized-keys:
- "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAI... admin@workstation"
# 5. Explicit CIS-Compliant LVM-on-LUKS2 Storage Architecture
storage:
config:
# Initialize physical NVMe with GPT partition table
- type: disk
id: disk-nvme0
match:
size: largest
ptable: gpt
wipe: superblock-recursive
preserve: false
# Partition 1: EFI System Partition (1 GB)
- type: partition
id: part-efi
device: disk-nvme0
size: 1G
flag: boot
grub_device: true
- type: format
id: fmt-efi
volume: part-efi
fstype: fat32
label: EFI
# Partition 2: Unencrypted /boot (2 GB)
- type: partition
id: part-boot
device: disk-nvme0
size: 2G
- type: format
id: fmt-boot
volume: part-boot
fstype: ext4
label: BOOT
# Partition 3: Remaining capacity for LUKS2 Full Disk Encryption
- type: partition
id: part-luks
device: disk-nvme0
size: -1
- type: dm_crypt
id: dm-crypt0
volume: part-luks
dm_name: crypt_ubuntu
key: "InitialDeploymentPassphraseRotateImmediately!"
# LVM Volume Group atop the LUKS2 container
- type: lvm_volgroup
id: vg-ubuntu
name: vg_ubuntu
devices:
- dm-crypt0
# Logical Volumes: /, /var, /var/log, /tmp, /home
- type: lvm_partition
id: lv-root
volgroup: vg-ubuntu
name: lv_root
size: 40G
- type: format
id: fmt-root
volume: lv-root
fstype: ext4
- type: lvm_partition
id: lv-var
volgroup: vg-ubuntu
name: lv_var
size: 60G
- type: format
id: fmt-var
volume: lv-var
fstype: ext4
- type: lvm_partition
id: lv-log
volgroup: vg-ubuntu
name: lv_log
size: 20G
- type: format
id: fmt-log
volume: lv-log
fstype: ext4
- type: lvm_partition
id: lv-tmp
volgroup: vg-ubuntu
name: lv_tmp
size: 10G
- type: format
id: fmt-tmp
volume: lv-tmp
fstype: ext4
- type: lvm_partition
id: lv-home
volgroup: vg-ubuntu
name: lv_home
size: 30G
- type: format
id: fmt-home
volume: lv-home
fstype: ext4
# Bind Mountpoints with CIS Security Options
- type: mount
id: mnt-root
device: fmt-root
path: /
- type: mount
id: mnt-boot
device: fmt-boot
path: /boot
options: "defaults,nodev,nosuid"
- type: mount
id: mnt-efi
device: fmt-efi
path: /boot/efi
options: "umask=0077,noexec,nodev,nosuid"
- type: mount
id: mnt-var
device: fmt-var
path: /var
options: "defaults,nodev"
- type: mount
id: mnt-log
device: fmt-log
path: /var/log
options: "defaults,nodev,nosuid,noexec"
- type: mount
id: mnt-tmp
device: fmt-tmp
path: /tmp
options: "defaults,nodev,nosuid,noexec"
- type: mount
id: mnt-home
device: fmt-home
path: /home
options: "defaults,nodev,nosuid"
# 6. Install Essential Enterprise Packages
packages:
- curl
- git
- vim
- nftables
- auditd
- apparmor-utils
- apparmor-profiles
- unattended-upgrades
- needrestart
- cryptsetup-initramfs
# 7. Execute Post-Install Hardening Inside Target Chroot
late-commands:
- curtin in-target -- target=/target -- systemctl disable --now motd-news.timer
- curtin in-target -- target=/target -- apt-get purge -y snapd popularity-contest ubuntu-report
Delivering autoinstall.yaml at Boot
Two battle-tested methods exist to feed this manifest to the Ubuntu installer:
- Method A: Secondary USB Drive or Virtual ISO Labeled
CIDATA - Create a small FAT32 partition or ISO image bearing the filesystem volume label
CIDATAcontaininguser-dataandmeta-dataat its root: - When attached during installer boot, Subiquity detects the
CIDATAvolume label automatically and executes the unattended installation without prompts! - Method B: Network Delivery via Kernel Command Line
- Press
eat the installer GRUB menu and insert the following parameters on thelinuxline prior to---:
5. Automated Disk Unlocking: TPM2 & Clevis/Tang (NBDE)
Production servers must recover cleanly across unattended maintenance reboots. Alongside dropbear-initramfs (for manual early-boot SSH unlocking), data centers rely on two automated decryption mechanisms:
Option A: Hardware Binding to the Local TPM2 Chip
Using systemd-cryptenroll, bind a LUKS2 keyslot to the motherboard's TPM2 chip and UEFI Secure Boot state (PCR 0+7):
# Verify TPM2 support and bind LUKS2 container to PCR registers 0 and 7
sudo systemd-cryptenroll \
--tpm2-device=auto \
--tpm2-pcrs=0+7 \
/dev/nvme0n1p3
# Append tpm2-device=auto to /etc/crypttab
sudo sed -i 's/luks/luks,tpm2-device=auto/' /etc/crypttab
sudo update-initramfs -u -k all
Option B: Network-Bound Disk Encryption (NBDE) with Clevis & Tang
What happens if an adversary physically steals the entire server chassis—including its motherboard and TPM2 chip—from a branch office or colocation rack? A pure TPM2 setup would still unlock the disk when powered on at the attacker's location!
The Enterprise Countermeasure is NBDE (Clevis & Tang): * The server unlocks its LUKS2 volume during boot only if it can reach a cryptographic Tang server on the private data center management VLAN (using the McCallum-Relyea key exchange protocol, without ever transmitting secret keys across the wire). * If the physical server is removed from the rack, the Tang server is unreachable—keeping data-at-rest locked!
# 1. Install Clevis with initramfs hooks on the Ubuntu host
sudo apt-get install -y clevis clevis-luks clevis-initramfs
# 2. Bind the LUKS2 partition to the internal Tang server on the management VLAN
sudo clevis luks bind -d /dev/nvme0n1p3 tang '{"url":"http://tang.internal.lan"}'
# 3. Rebuild initramfs (embeds network stack and Clevis hook)
sudo update-initramfs -u -k all
6. De-Snapping, Telemetry Elimination & Lean Server Footprint
Ubuntu Server installs the snapd daemon by default. On dedicated backend infrastructure, snapd introduces significant operational drawbacks:
* Every installed Snap package is mounted as a compressed squashfs image via a dedicated /dev/loopX block device, polluting df -h and lsblk output.
* Snapd performs forced background updates outside the control of standard apt repositories and enterprise staging mirrors.
1. Complete Removal of snapd
# 1. Stop and disable active snapd systemd units and sockets
sudo systemctl disable --now snapd.service snapd.socket snapd.seeded.service
# 2. Cleanly purge all pre-installed snaps (lxd, core22, snapd)
for snap in $(snap list | awk 'NR>1 {print $1}'); do
sudo snap remove --purge "$snap" || true
done
# 3. Purge the snapd package and configuration remnants via APT
sudo apt-get purge -y snapd
# 4. Remove leftover snap directories from the filesystem
sudo rm -rf /snap /var/snap /var/lib/snapd /var/cache/snapd ~/snap
2. Permanent Reinstallation Block via APT Pinning
Certain Ubuntu meta-packages attempt to silently reinstall snapd as a dependency during subsequent system upgrades. Enforce an explicit negative APT pin to block it permanently:
# /etc/apt/preferences.d/nosnap.pref
# ==============================================================================
# Prevent any automatic or manual installation of snapd
# ==============================================================================
Package: snapd
Pin: release a=*
Pin-Priority: -10
3. Disabling Background Telemetry, Crash Reporters & MOTD Ads
By default, Ubuntu Server initiates outbound HTTPS connections to Canonical (motd.ubuntu.com) upon SSH login to fetch promotional banners, and collects crash dumps via apport and whoopsie:
# 1. Purge telemetry and crash-reporting packages completely
sudo apt-get purge -y ubuntu-report popularity-contest apport whoopsie ubuntu-advantage-tools
# 2. Disable outbound HTTP calls on SSH login (Dynamic MOTD News)
sudo systemctl disable --now motd-news.timer
sudo sed -i 's/ENABLED=1/ENABLED=0/' /etc/default/motd-news
sudo chmod -x /etc/update-motd.d/10-help-text /etc/update-motd.d/50-motd-news /etc/update-motd.d/88-esm-announce 2>/dev/null || true
7. Enterprise Networking with Netplan & systemd-networkd
Ubuntu uses Netplan as its declarative configuration abstraction layer. On server deployments, always specify renderer: networkd (systemd-networkd) rather than NetworkManager.
Production Topology: LACP Bonding, VLAN Trunking & KVM Bridge
In enterprise racks, hosts connect redundantly across two physical NICs (enp1s0 and enp2s0) using 802.3ad LACP to dual top-of-rack switches, carrying tagged 802.1Q VLANs and a software bridge for KVM virtual machines:
%%{init: {'flowchart': {'wrappingWidth': 350}}}%%
flowchart TB
NICs["Physical Network Interfaces<br/>(enp1s0 + enp2s0)"] ==> Bond["bond0 (802.3ad LACP)<br/>(Redundant Link Aggregation Trunk)"]
Bond --> VLAN10["vlan10 (Management VLAN)<br/>(Host IP: 10.10.10.40/24)"]
Bond --> VLAN20["vlan20 (Production VM Traffic)<br/>(Unnumbered Trunk)"]
VLAN20 ==> Bridge["br20 (KVM / Container Bridge)<br/>(Provides Layer-2 Access to VMs)"]
Create /etc/netplan/01-production-network.yaml (and remove the installer-generated 50-cloud-init.yaml):
# /etc/netplan/01-production-network.yaml
# ==============================================================================
# Enterprise Netplan Configuration: LACP Bond + VLANs + KVM Bridge
# ==============================================================================
network:
version: 2
renderer: networkd
# 1. Initialize physical interfaces without direct IP assignment
ethernets:
enp1s0:
dhcp4: false
dhcp6: false
enp2s0:
dhcp4: false
dhcp6: false
# 2. 802.3ad LACP Bond across both physical NICs
bonds:
bond0:
interfaces:
- enp1s0
- enp2s0
parameters:
mode: 802.3ad
lacp-rate: fast
mii-monitor-interval: 100
transmit-hash-policy: layer3+4
# 3. 802.1Q VLAN Interfaces atop the Bond
vlans:
vlan10:
id: 10
link: bond0
addresses:
- 10.10.10.40/24
routes:
- to: default
via: 10.10.10.1
nameservers:
addresses:
- 10.10.10.2
- 10.10.10.3
search:
- prod.internal.lan
vlan20:
id: 20
link: bond0
dhcp4: false
dhcp6: false
# 4. Layer-2 Software Bridge on VLAN 20 for KVM/QEMU VMs
bridges:
br20:
interfaces:
- vlan20
dhcp4: false
dhcp6: false
parameters:
stp: false
forward-delay: 0
Enforcing File Permissions & Fail-Safe Testing with netplan try
Starting with Netplan 0.106, Netplan emits security warnings if configuration files are readable by unprivileged users (as they may contain PSKs or WireGuard keys).
# 1. Enforce strict file permissions (root read/write only)
sudo chown root:root /etc/netplan/*.yaml
sudo chmod 0600 /etc/netplan/*.yaml
# 2. Compile configuration and activate with a 120-second automatic rollback timer!
sudo netplan try
Why netplan try is Essential for Remote Administration
If you make a typo in an IP address or default route on a remote server and run netplan apply, your SSH session drops immediately and you are locked out. netplan try applies the change and waits for interactive confirmation via ENTER. If your SSH connection drops, Netplan automatically reverts to the previous working network state after 120 seconds!
8. DEB822 Repositories (ubuntu.sources), Unattended Upgrades & AppArmor MAC
Starting with Ubuntu 24.04 LTS, Ubuntu defaults to the structured DEB822 repository format located at /etc/apt/sources.list.d/ubuntu.sources.
1. Auditing DEB822 Package Sources
# /etc/apt/sources.list.d/ubuntu.sources
Types: deb
URIs: http://archive.ubuntu.com/ubuntu/
Suites: noble noble-updates noble-backports
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
Types: deb
URIs: http://security.ubuntu.com/ubuntu/
Suites: noble-security
Components: main restricted universe multiverse
Signed-By: /usr/share/keyrings/ubuntu-archive-keyring.gpg
2. Automated Security Patching & needrestart
Ensure security updates from noble-security are applied daily and daemons holding stale shared libraries in memory are automatically restarted:
# 1. Enable unattended-upgrades
sudo dpkg-reconfigure -plow unattended-upgrades
# 2. Configure needrestart for automatic background service restarts ('a')
sudo sed -i "s/#\$nrconf{restart} = 'i';/\$nrconf{restart} = 'a';/" /etc/needrestart/needrestart.conf
3. Verifying AppArmor Mandatory Access Control
Ubuntu enables the AppArmor Linux Security Module out of the box. Verify that all system daemons operate in strict enforce mode:
# Install additional standard profiles and inspect enforcement state
sudo apt-get install -y apparmor-profiles apparmor-utils
sudo aa-status
9. Cloud-Init Finalization, Maintenance & Emergency Troubleshooting Runbook
1. Freezing Cloud-Init Following Initial Provisioning
A common operational pitfall on Ubuntu Server: when an administrator later modifies /etc/netplan/ or /etc/hostname manually, cloud-init may overwrite those changes upon subsequent reboots or NIC replacements with the initial provisioning values!
Once initial bootstrapping is complete, freeze Cloud-Init cleanly:
# 1. Verify Cloud-Init completed without errors (must report "status: done")
cloud-init status --long
# 2. Disable Cloud-Init across future reboots
sudo touch /etc/cloud/cloud-init.disabled
2. Mitigating the 2-Minute Boot Hang (systemd-networkd-wait-online)
When an Ubuntu server contains a secondary network port without an active carrier cable plugged in, the boot sequence frequently hangs for 2 minutes displaying:
A start job is running for Wait for Network to be Configured...
The Solution: Mark unused or secondary interfaces with optional: true inside your Netplan manifest so the boot target does not block waiting for link carrier:
# Inside /etc/netplan/01-production-network.yaml for disconnected ports:
ethernets:
enp3s0:
dhcp4: false
optional: true
3. Troubleshooting Matrix for Ubuntu LTS Server
| Symptom | Root Cause | Diagnostic & Remediation Workflow |
|---|---|---|
Subiquity crashes immediately during autoinstall |
YAML indentation error or invalid schema key in user-data |
Validate the manifest ahead of time on a running host:cloud-init schema --config-file user-data |
Netplan warns Permissions for /etc/netplan/*.yaml are too open |
File is readable by group or world (0644) |
Execute sudo chmod 0600 /etc/netplan/*.yaml. |
Manual edits in /etc/netplan/ are ignored |
50-cloud-init.yaml overrides settings lexically |
Run sudo rm /etc/netplan/50-cloud-init.yaml and sudo touch /etc/cloud/cloud-init.disabled. |
df -h shows / 100% full on a 500 GB NVMe |
Default installer allocated only 100 GB of the LVM VG | Check free VG extents (sudo vgs) and expand the root LV online:sudo lvextend -r -L +50G /dev/vg_ubuntu/lv_root |
With this 9-stage engineering blueprint, a default Ubuntu LTS installation is transformed into a lean, telemetry-free, fully encrypted, and resilient enterprise server platform.