Home News What is a Debian preseed file, and how does it automate an install?
What is a Debian preseed file, and how does it automate an install?
A preseed file is a plain-text answer key for debian-installer: each line supplies the answer to one installer question, so the install runs from boot to reboot without a keyboard. The installer reads it over HTTP from the kernel command line, loads the values into debconf, and only stops if a critical question has no answer.

What a preseed file actually is
debian-installer is a question-and-answer program. Before it touches a disk it asks a few dozen things: which locale, which keyboard, which network interface, which mirror, how to partition, what to install, where to put the boot loader. A preseed file is that list of questions with the answers already filled in.
The answers are not passed as a script. They are pushed into debconf, the configuration database the installer itself reads, so the installer simply finds every question already answered and skips straight to the next step. That is why preseed is sometimes called a "debconf answer key" rather than an installation script: it changes no logic, it only supplies values.
The format: four fields per line
Each line is owner question type value:
d-i debian-installer/locale string en_US.UTF-8
d-i netcfg/get_hostname string pxe-node-01
d-i netcfg/get_domain string lab.example.com
- owner is almost always
d-i(the installer). A few questions belong to other owners, such astaskselorpopularity-contest. - question is the debconf template name, for example
netcfg/get_hostname. - type is
string,boolean,select,multiselect,passwordornote. - value is everything after the third space, so values may contain spaces.
Get the type wrong and the line is ignored without an error. A boolean written as string is the single most common reason a "working" preseed file still stops to ask a question.
A minimal preseed that finishes on its own
This is a complete, realistic file for a single-disk Debian server:
# Locale and keyboard
d-i debian-installer/locale string en_US.UTF-8
d-i keyboard-configuration/xkb-keymap select us
# Network
d-i netcfg/choose_interface select auto
d-i netcfg/get_hostname string pxe-node-01
d-i netcfg/get_domain string lab.example.com
# Mirror
d-i mirror/country string manual
d-i mirror/http/hostname string deb.debian.org
d-i mirror/http/directory string /debian
d-i mirror/http/proxy string
# Clock
d-i clock-setup/utc boolean true
d-i time/zone string UTC
# Partitioning
d-i partman-auto/method string regular
d-i partman-auto/disk string /dev/sda
d-i partman-auto/choose_recipe select atomic
d-i partman-partitioning/confirm_write_new_label boolean true
d-i partman/choose_partition select finish
d-i partman/confirm boolean true
d-i partman/confirm_nooverwrite boolean true
# Accounts
d-i passwd/root-login boolean false
d-i passwd/user-fullname string Deploy
d-i passwd/username string deploy
d-i passwd/user-password-crypted password $6$rounds=4096$SALT$HASH
# Packages
tasksel tasksel/first multiselect standard, ssh-server
d-i pkgsel/include string curl qemu-guest-agent
d-i pkgsel/upgrade select full-upgrade
popularity-contest popularity-contest/participate boolean false
# Boot loader and finish
d-i grub-installer/only_debian boolean true
d-i grub-installer/bootdev string default
d-i finish-install/reboot_in_progress note
Two details in there matter more than they look. passwd/user-password-crypted expects a crypt(3) hash, not a plain password, so generate it with mkpasswd -m sha-512 or openssl passwd -6. And grub-installer/bootdev string default lets the installer pick the disk it just partitioned, which avoids hard-coding /dev/sda a second time.
How the installer finds the file
A preseed file has to be reachable before the installer starts, so the usual route is the kernel command line handed over by the boot loader:
linux /debian/install.amd/vmlinuz auto=true priority=critical \
url=http://pxe.lab.example.com/preseed/debian-12.cfg ---
auto=true switches the installer into unattended mode, and priority=critical hides everything except critical questions, which keeps a stray low-priority prompt from blocking the run. The url= parameter is what actually fetches the file over HTTP; a local path works too with preseed/file=, and preseed/include pulls in extra fragments when one file becomes unmanageable.
In a PXE or iPXE setup the boot loader is already serving that command line, so adding the url= parameter is the whole integration. If you run bare metal provisioning from a central console, the same parameter is what a per-server or per-group preseed template ends up rendering into.
Where unattended installs usually break
- A missing answer. Any critical question with no value stops the installer and waits for a keyboard, and the run sits there until someone notices.
- A mistyped question name.
netcfg/hostnameinstead ofnetcfg/get_hostnameis silently ignored, so the install stops on exactly the question you thought you had answered. - An unreachable mirror. A preseed that points at the public Debian mirror works in the lab and fails in an isolated rack. Point
mirror/http/hostnameat a local mirror you control. - Disk names in the partitioning recipe.
/dev/sdadoes not exist on an NVMe box. Either pinpartman-auto/diskper hardware profile or let partman choose. - Commands that need the installed system.
preseed/late_commandruns inside the installer environment, so anything that must run on the target needsin-targetin front of it.
Debugging a run that stops
Add DEBCONF_DEBUG=5 to the kernel command line and the installer logs every debconf question and answer, which shows immediately whether your file was read at all. On a failed install, /var/log/installer/syslog on the installed system holds the full transcript. For a first attempt on new hardware, preseed/early_command is a convenient place to drop a marker file or start a shell, so you can confirm the preseed was parsed before the partitioning step begins.
Preseed is not the only answer
Preseed applies to debian-installer, which covers Debian and its derivatives. Kickstart does the equivalent job for RHEL-family installers, and Ubuntu has moved its server installer to cloud-init autoinstall YAML, where preseed no longer applies. If a fleet mixes distributions, the boot layer is the part worth unifying: one PXE or iPXE entry point, one per-distribution answer file behind it. That is the model behind Linux provisioning and PXE server software, where the preseed is just one template among several.
Checklist before the first real run
- Serve the file over HTTP and open it from a browser on the target's network segment.
- Confirm every critical question in your hardware profile has a line.
- Check each line's type against the debconf template, not against memory.
- Use a crypted password hash, never a plain one.
- Boot one machine with
DEBCONF_DEBUG=5and watch it reach the reboot without a prompt. - Only then put it behind the whole group.
Questions worth asking first
Does a preseed file replace debian-installer?
No. It only pre-answers the installer's questions. debian-installer still runs, still partitions the disk and still installs the packages; preseed just removes the prompts.
What happens if one question is missing from the preseed file?
The installer stops at that question and waits for an answer on the console, so the install is no longer unattended. With priority=critical only critical questions block the run, which is why the answer file has to cover every critical question for that hardware profile.
What is the difference between preseed and Kickstart?
They solve the same problem for different installers. Preseed is debconf answers for debian-installer (Debian and derivatives); Kickstart is a single file for the RHEL-family anaconda installer. Neither works with the other's installer.
Can I use a preseed file to install Ubuntu?
Only on older Ubuntu releases that still ship debian-installer. Current Ubuntu server installs use cloud-init autoinstall YAML, where preseed lines are ignored.
How do I know whether the installer read my preseed file?
Boot with DEBCONF_DEBUG=5 on the kernel command line and watch the installer log each question and answer, or read /var/log/installer/syslog after the install. If no preseed questions appear there, the file was never fetched, so check the url= parameter and the network path to it.
Can partitioning be fully automated with preseed?
Yes, with partman-auto. The catch is the disk device: /dev/sda does not exist on NVMe hardware, so pin partman-auto/disk per hardware profile or let partman choose the disk.