· 5 months ago · Apr 24, 2025, 10:10 PM
1# Required configuration
2autoinstall:
3 version: 1 # Defines the version of the autoinstall configuration, and is required for futureproofing; Currently, this must be set to "1".
4 identity: # Configures the initial user for the system
5 realname: "Your Name"
6 username: username
7 password: "$1$uQvy6o6V$K2F2D91R3SXMbV0CWQ5H30" # Generate a password hash with the "openssl passwd" command, and paste it here. This hash represents the password "Password".
8 hostname: computer-name
9
10# Optional configuration
11 interactive-sections: # A list of configuration steps to still show during installation
12 - network # For example, have the installer show the network screen, allowing you to change the defaults
13# early-commands: # A list of commands to run before the installation starts; Default is none
14# - wget -O /autoinstall.yaml $AUTOINSTALL.YAML_URL # For example, replace the current autoinstall configuration with one provided by a centralized server (be sure to replace $AUTOINSTALL.YAML_URL with the actual URL).
15 storage: # Specifies the partition layout to use; In this example, we'll configure a drive with LVM with full-disk encryption
16 # WARNING: THIS ERASES THE ENTIRE DISK!
17 layout:
18 name: lvm # DEFAULT
19 sizing-policy: all # Use the whole disk
20 password: "Encryption Passphrase" # When this is specified, the installer sets up full-disk encryption with this passphrase on the target system.
21 match: # Specifies which disk to use, based on certain characteristics (not all of these need to be specified). This example uses the largest disk in the system, which is the default behaviour.
22# model:
23# vendor:
24# path:
25# id_path:
26# devpath:
27# serial:
28# ssd: # Can be either true or false
29 size: largest # Can be either largest or smallest
30 keyboard: # Sets the keyboard layout (DEFAULT)
31 layout: "us" # For example, US English (DEFAULT)
32 variant: "" # Sets the variant of the specified layout (if applicable) (DEFAULT)
33 locale: "en_US.UTF-8" # Sets the locale for the installed system. For example, US English with UTF-8 character encoding (DEFAULT).
34 timezone: "Etc/UTC" # Specifies the timezone. Default is "Etc/UTC", but this should be set to your local timezone.
35 refresh-installer: # Controls whether the installer updates to a new version before continuing, and if "true", which channel the update is downloaded from
36 update: true # Update the installer before proceeding with installation; Can be either true or false
37 channel: "stable/ubuntu-$REL" # Update from the stable channel (DEFAULT)
38 source: # Specifies the variant of Ubuntu to be installed
39 id: ubuntu-desktop # For example, the "Extended" installaion of Ubuntu Desktop; NOTE: THIS IS ONLY VALID ON THE UBUNTU DESKTOP ISO! Check the autoinstall configuration reference manual for valid values on other versions of Ubuntu.
40 network: # Provide a Netplan-formatted network configuration; Default is to use DHCP on Ethernet interfaces
41 version: 2 # Defines the version of the netplan configuration, and is required for futureproofing; Currently, this must be set to "2"
42 renderer: NetworkManager # Controls the backend netplan uses (networkd or NetworkManager)
43 ethernets: # Configures wired network cards
44 wired:
45 match:
46 name: e* # Applies this configuration to ALL wired network cards in the system *To specify a particular interface, replace "e*" with the actual interface name (you can find this with the "ip a" command)
47 dhcp4: false # This is an example of a manual IPv4 configuration (so we can assign our system a static IP)
48 dhcp6: true # We will still automatically obtain the IPv6 configuration
49 addresses: # Sets the IPv4 address of the system (MUST BE IN CIDR FORM)
50 - 192.168.0.2/24 # For example, set the IP address to 192.168.0.2; "/24" represents the subnet mask "255.255.255.0"
51 nameservers: # Configures the DNS settings
52 addresses: # Let's use Cloudflare's DNS servers as an example
53 - 1.1.1.1
54 - 1.0.0.1
55 - 2606:4700:4700::1111
56 - 2606:4700:4700::1001
57 routes: # Configures the default gateway
58 - to: default
59 via: 192.168.0.1 # Be sure to replace this with your actual gateway address (if different); You can check this on another computer connected to your network
60 wifis: # Configures wireless network cards
61 wireless:
62 match:
63 name: w* # Applies this configuration to ALL wireless network cards in the system *To specify a particular interface, replace "w*" with the actual interface name (you can find this with the "ip a" command)
64 dhcp4: true # This is an example of an automatic IP configuration with DHCP
65 dhcp6: true
66 access-points: # Configures wireless access points
67 "SSID": # Be sure to replace "SSID" with your actual network's SSID (in quotes)
68 password: "Wi-fi Password"
69 apt: # Specifies the apt configuration (used both during the install and on the installed system). Below is the default apt configuration, which you can tweak according to your needs:
70 preserve_sources_list: false
71 mirror-selection: # A list of sources for apt to use (DEFAULT)
72 primary:
73 - country-mirror # Automatically select your country's local mirror; NOTE: geoip must be "true" for this to work
74 - uri: "http://archive.ubuntu.com/ubuntu"
75 arches: [i386, amd64]
76 - uri: "http://ports.ubuntu.com/ubuntu-ports"
77 arches: [s390x, arm64, armhf, powerpc, ppc64el, riscv64]
78 fallback: abort # Controls what the installer does when no primary mirror is usable; In this example, the installer will abort the installation when no primary mirror is usable (DEFAULT)
79 geoip: true # DEFAULT (can be either true or false)
80# active-directory: # Configure an Active Directory domain
81# admin-name:
82# domain-name:
83 ubuntu-pro: # Provide a valid contract token (from ubuntu.com/pro/dashboard) to enable Ubuntu Pro on the installed system
84 token: C1NWcZTHLteJXGVMM6YhvHDpGrhyy7 # NOTE: This is NOT a valid contract token!
85 ssh: # DEFAULT
86 install-server: false # Choose whether or not to install openssh-server (can be either true or false) (DEFAULT)
87 authorized-keys: [] # Provide an SSH public key(s) to install in the initial user account; Default is none
88 allow-pw: true # Choose whether or not to allow password authentication over SSH (can be either true or false) (DEFAULT)
89 codecs: # Choose whether to install the ubuntu-restricted-addons package
90 install: true # Can be either true or false
91 drivers: # Choose whether to install third-party drivers
92 install: true # Can be either true or false
93 packages: # Provide a list of packages to install on the installed system; Default is none
94 - cmatrix # For example, install cmatrix
95 snaps: # Provide a list of snaps to install on the installed system; Default is none. In this example, we'll install the hello-world snap from the stable channel with strict confinement.
96 - name: hello-world
97 channel: stable # Choose which channel to install the snap from (stable, candidate, beta, or edge) (DEFAULT)
98 classic: false # Choose whether or not to use classic confinement (can be either true or false) (DEFAULT)
99# kernel: # Specify which kernel to install
100# package: # Install a specific kernel package
101# flavour: # Install a particular kernel flavour
102 updates: all # Controls the type of updates that will be downloaded and installed after system installation; Can be either "security" (for security updates only) or "all" (for all updates, like in this example).
103 shutdown: reboot # Controls whether to reboot or poweroff the system after installation (DEFAULT)
104# late-commands: # A list of commands to run after the installation has completed successfully; Default is none
105# - while [ ! -f /run/finish ]; do sleep 1; done # For example, pause the installation just before finishing to allow manual inspection/modification (unpause by creating the "/run/finish" file)
106 error-commands: # A list of commands to run after the installation has failed.
107 - tar -czf /installer-logs.tar.gz /var/log/installer # For example, collect installer logs in /var/log/installer
108 - journalctl -b > /installer-journal.log # Collect the live system journal too
109 kernel-crash-dumps: # Choose whether to enable kernel crash dumps
110 enabled: false # Can be true, false, or null (DEFAULT); NOTE: Default behaviour in Ubuntu 24.10 and later is to enable kernel crash dumps dynamically.
111