Sub topic 5
Walking through the installer choices
This chapter assumes you can use a shell, edit files in a terminal editor, and know what a disk, a network address and a package manager are. It covers the questions a Linux server installer asks after you have booted it and chosen a disk layout. Each answer changes what the first boot looks like, so the aim is to know what each choice does before you make it.
What the installer decides for you
Whatever the distribution, the installer collects roughly the same information:
- Language, keyboard layout and locale.
- Network configuration and hostname.
- Mirror or package source.
- Disk layout (covered in the previous chapter).
- The first user account, and whether root gets a password.
- Software selection.
- Bootloader placement.
Debian uses the text-mode Debian Installer, Ubuntu Server uses Subiquity, and the RHEL family (Rocky, Alma, Fedora Server) uses Anaconda. The screens differ in order and wording, but each answer ends up in the same places on the installed system. That is also why [automated installs](#) can replay them from a file.
Language, keyboard and locale
The language you pick sets the system locale, which controls message language, date formats and sorting. For servers, en_US.UTF-8 (or C.UTF-8) is a safe default. Translated messages make log lines harder to search and to paste into bug reports. Choose a UTF-8 locale so filenames and text with non-ASCII characters behave correctly.
The keyboard layout matters most for typing the disk encryption passphrase and the first password. Choose the layout of the keyboard you are actually using, including when you are on a virtual console. If you later find that a symbol is not where you expect, you can change it with localectl set-keymap.
Network and hostname
Most installers configure the network with DHCP by default. That is fine for a first install and for cloud or virtual machines where the platform assigns addresses. For a server that other machines must reach, you have two common options:
- Keep DHCP and create a reservation on the router or DHCP server that always gives the same address to this machine's MAC address.
- Enter a static address, prefix length, gateway and DNS servers in the installer.
A static address typed in the installer is easy to get wrong. A wrong gateway or prefix leaves you with a machine that boots but cannot be reached. If you are unsure, take DHCP now and change it after the first login, when you can test changes from the console.
The hostname you enter becomes the system's static hostname. Use a short, lowercase name made of letters, digits and hyphens, such as web01. If the installer asks for a domain, enter it only if you have one that you control. Otherwise leave it empty. You can change both later with hostnamectl.
Mirror or package source
The installer downloads packages from a mirror. The choices are:
- Official or country mirror. Fast for most users and the default for Debian and Ubuntu.
- Local or internal mirror. Use this in networks with restricted internet access.
- Install from the image only. A full DVD or "offline" ISO can install without a network. The package set is then as old as the image, so plan to update straight away.
If you use an HTTP proxy, enter it when asked. A missing proxy is a common reason for installs that stall at the mirror step.
Users and the root account
Installers handle the first account in different ways, and the difference changes how you log in the first time.
| Distribution | Default behavior | Result |
|---|---|---|
| Ubuntu Server | Creates one user, locks the root password | The user gets `sudo`. Root cannot log in with a password. |
| Debian | Asks for a root password, then for a user | If you set a root password, no `sudo` is installed for the user. If you leave it empty, root is disabled and the user is added to `sudo`. |
| RHEL family (Anaconda) | Separate root password and optional user | Tick "Make this user administrator" to add the user to `wheel`. |
Choose the form that leaves you with a non-root administrative account and no usable root password. The next chapters create the admin user and move to SSH keys, so a throwaway password is acceptable at this stage as long as you replace it. Use a long passphrase and not something short, because the account is reachable from the network as soon as SSH is running.
Software selection
This screen has the largest effect on your attack surface and on how much there is to maintain. Packages that are installed but not needed are code you must patch.
- Choose a minimal or standard system utilities profile for most servers.
- Select OpenSSH server so that you can reach the machine remotely. Ubuntu Server offers it as a checkbox, Debian lists "SSH server" in the task selection, and Anaconda's "Minimal Install" environment enables
sshdby default. - Do not install a desktop environment on a server. It adds hundreds of packages and often a display manager that listens on the network.
- Skip role bundles such as "web server" or "DNS server" unless you want exactly what the installer picks. You can install a specific package later with full control over its configuration.
A smaller installation also boots faster and produces a shorter list of pending updates after the first login.
Bootloader and encryption
On UEFI systems the installer writes the bootloader to the EFI System Partition. On BIOS systems it writes to the disk's boot sector, so select the whole disk (for example /dev/sda), not a partition. Choosing the wrong target here is the most common cause of a machine that installs successfully and then does not boot.
If you enabled disk encryption (LUKS) in the partitioning step, remember that every boot waits for the passphrase at the console. That is a real constraint for a remote server. Decide before you install whether you can supply the passphrase through a console, hypervisor or out-of-band management interface.
Review before you commit
Every installer shows a summary before writing to disk. Read it for the following items:
- The target disk is the one you intend. Installing over the wrong disk destroys its data.
- The partitions or logical volumes match what you planned.
- The bootloader target is correct.
- The network settings are what you typed.
After this step the disk changes are not reversible, so stop here if anything looks wrong.
Checking what you chose
After the first boot, you can confirm several of these decisions from the shell:
localectl status # locale and keyboard layout
hostnamectl # static hostname
ip -br addr # network addresses
lsblk -f # disks, filesystems, mount points
id # your user's groups (look for sudo or wheel)If a value is wrong, each of these has a matching command or file that changes it, and later chapters show how.
Exercise
You install Debian on a BIOS machine and the installer asks where to place the bootloader. Which target do you choose, and what happens if you choose a partition such as /dev/sda1 instead?
Show answer
Choose the whole disk, for example /dev/sda. On a BIOS system the bootloader belongs in the disk's boot sector. If you pick a partition, the firmware may find no bootloader code at the start of the disk, and the machine installs but fails to boot.
Exercise
Why is it usually safer to accept DHCP in the installer and set a static address after the first login?
Show answer
A mistake in a static address, prefix length or gateway can leave the machine unreachable over the network, and you would have to fix it from the console. After the first login you can test and adjust the network settings, and a DHCP reservation can give the machine a stable address without typing any of it into the installer.