Installing a Linux server means making four decisions: the distribution, the installation media, the disk layout and the way to repeat the operation. This guide explains them, with the reasons for each choice, then shows how to automate the installation with autoinstall, preseed, Kickstart and cloud-init. It is aimed at a beginner who already knows what a virtual machine is. It does not walk through the installer screens: to see them one by one, follow Install Linux in a VM, then the tutorial for your distribution.
What you will learn
- Choose the distribution, the architecture and the ISO image, and check that image with its SHA-256 checksum
- Decide on a partitioning scheme: the whole disk for learning, LVM and separate partitions for production, swap following the RHEL 10 rule
- Tell apart the network card, which is hardware, from the IP address, which is a setting
- Automate the installation with autoinstall, preseed or Kickstart, then configure the first boot with cloud-init
- Check that the installed server is healthy before using it
Why does a correct installation matter?
An installation is easy to redo in a VM, much less so on a server in service. A disk split too tightly can no longer be fixed without downtime, and an image downloaded without checking can install a modified system. The decisions below are the ones worth making once, correctly, before starting the installer.
Prepare the installation
Preparation comes down to three choices: the distribution, the hardware (or the VM) that hosts it, and the ISO image to download.
Choose the Linux distribution
Each distribution has its own management tools and philosophy. The Choose a server distribution guide compares the options in detail; here are the most common ones on a server:
- Ubuntu Server: known for its ease of use and its large support community.
- Debian: famous for its reliability and its commitment to open source software; the stable release is Debian 13.
- RHEL and its rebuilds (AlmaLinux, Rocky Linux): the enterprise reference, with a ten-year support cycle.
- Fedora Server: offers the latest features and technologies, suited to development environments.
Take into account your needs, your knowledge and the compatibility with the tools you plan to use.
Hardware requirements
The hardware (or the VM) must meet the minimums of the chosen distribution, otherwise the installer fails or the server stays too slow to be useful. Four elements matter:
- Processor (CPU): speed and number of cores depend on the expected workload.
- RAM: it determines how many applications the server can run, and the size of the swap (see below).
- Storage space: it must hold the system, the applications and the data.
- Network card: it is the hardware (or the virtual card of a VM) that connects the server to the network. Check that the distribution recognises it.
The IP address is another question, and it does not depend on the hardware: it is a software setting, either obtained automatically from a DHCP server (the network service that hands out addresses) or set by hand (a static address). You choose it during or after the installation. For a training homelab, the Homelab hardware page details proven configurations.
Download the ISO image
Download the ISO image from the distribution's official website or from a trusted mirror. Take the version matching the server's architecture: amd64 (also called x86_64) for most machines, arm64 (aarch64) for ARM servers. 32-bit images have disappeared from mainstream server distributions. Choose the "server" or "minimal" image: a server is driven from the command line and needs no graphical desktop.
Then check the image's SHA-256 checksum with sha256sum, comparing it with
the one the distribution publishes (SHA256SUMS or CHECKSUM file). A
modified image would install a compromised system from the very first
minute. The details of downloading and checking are in
Install Linux in a VM.
Create a bootable USB stick
On a physical machine, you have to copy the ISO onto a bootable USB stick, which the server reads at startup in place of its disk. On a virtual server, this step disappears: the hypervisor (the software that runs the VM) mounts the ISO directly as a virtual drive.
You need a utility that transfers the ISO image to the stick while making it bootable. Several free tools do the job:
- Balena Etcher: available for Windows, macOS and Linux, Etcher is a friendly tool with a reputation for reliability.
- Rufus: mainly aimed at Windows, Rufus offers many customisation options.
- UNetbootin: available for Windows, macOS and Linux, UNetbootin creates bootable sticks from a variety of Linux distributions.
dd: already present on every Linux machine, it copies the image byte by byte, for examplesudo dd if=debian-13.iso of=/dev/sdX bs=4M status=progress. Check the/dev/sdXthree times withlsblk:ddoverwrites the device you give it without asking for confirmation.
Write the ISO image to the USB stick
The only real difficulty is choosing the right stick: with dd, Etcher and Rufus,
writing the image erases all the data on the chosen stick (UNetbootin does not
reformat the stick), and a device mistake can wipe a whole disk. Reread the device
name before confirming, and unplug the other external drives during the operation.
Disk partitioning
Partitioning divides the disk into sections, each with its own file system. It is decided at installation time because that is when it costs the least: revisiting it afterwards means backing up the data, recreating the partitions, then restoring them, unless you chose LVM. The Partition a disk guide details the tools; this section focuses on the choices to make.
Managing partitions and disks
Two situations call for two different answers.
To learn, in a test VM, choose the installer's whole disk option (guided partitioning). This is the recommendation of Install Linux in a VM: it is the simplest, and the machine stays disposable. The layout is then done without you having to design it.
For a production server, the layout becomes an operations decision: you choose LVM and separate certain directories, for the reasons detailed below. The Partition a disk guide and the LVM guide give the gestures.
Even though it is decided at installation, the layout is not frozen: you can still create new partitions later, provided you back up the existing data and put it back once the file system is created and mounted. With LVM, growing a volume can even be done online.
Partitioning the disks
Separating partitions gives better organisation and limits the damage: if a file system gets corrupted, or a service fills up the disk, only the partition concerned is affected, and the rest of the system keeps working.
A layout for a production server
Here is an example of a layout that separates the system components from user
data. The minimum sizes of / and /boot, as well as the swap rule, follow
the RHEL 10 installation documentation:
-
Root partition (
/):- Size: at least 10 GB.
- Purpose: holds the operating system and the main applications.
-
Home partition (
/home):- Size: depending on users' needs.
- Purpose: stores the users' personal data.
-
Var partition (
/var):- Size: at least 10 GB.
- Purpose: holds variable data other than logs, such as mail spools and
caches. Beware: if you use Docker, its images and volumes are stored here
too, under
/var/lib/docker!
-
Var Log partition (
/var/log):- Size: 10 GB or more, depending on the volume of logs generated.
- Purpose: specifically stores log files. A dedicated partition for
/var/logisolates the space used by logs and prevents excessive growth from affecting the rest of the system.
-
Boot partition (
/boot):- Size: at least 2 GB, the RHEL 10 recommendation.
- Purpose: holds the kernel and the system's boot files.
-
Swap partition:
- Size: depends on RAM. Red Hat recommends twice the RAM below 2 GB, as much as the RAM between 2 and 8 GB, from 4 GB to half the RAM between 8 and 64 GB, and at least 4 GB beyond. The old "one to two times the RAM" rule wastes disk on a server with plenty of memory.
- Purpose: overflow memory, detailed in the swap guide.
A dedicated /tmp partition is possible, but on Debian 13, /tmp is a
tmpfs by default: a file system that lives in RAM and is emptied at every
reboot. In that case no partition is needed, but large temporary files consume
RAM: by default, /tmp can use up to half of it.
Why this layout rather than the whole disk? Because on a server in service, one
directory filling up (runaway logs, a growing cache) must not block the whole
system, and because its needs change: a /var that is too tight is fixed with LVM
without reinstalling, whereas a single partition forces you to start over. Adapt
the layout to the usage profile: a database server, a Docker host and a jump
host have neither the same critical partitions nor the same sizes.
Volume and storage management
Volume management most often relies on LVM (Logical Volume Manager), a logical volume management system that the Debian, Ubuntu and RHEL installers offer directly.
LVM offers great flexibility in storage management. It lets you easily resize volumes, create snapshots for backup and recovery, and combine several disks into a single logical volume.
Setting up LVM involves creating volume groups and logical volumes. This
allows dynamic allocation of space and makes disk management easier when
capacity must evolve. Leave some free space in the volume group: it is what
will let you grow /var without reinstalling.
Choose the file system type
The choice of file system determines how data is stored and read on each partition. Each type has its strengths and weaknesses, and the Choose a file system guide compares them in detail:
- EXT4: ideal for performance and compatibility, ext4 is a safe choice for most uses, and the default on Debian and Ubuntu.
- XFS: recommended for large files and I/O-intensive environments, and the default on RHEL.
- BTRFS: offers advanced features such as compression and built-in snapshots, suited to systems that need flexible data management.
Decisions to make during the installation
The installer chains booting from the stick or the ISO, the basic settings, partitioning and the choice of packages. The screens, one by one, are in the tutorials: Install Debian 13, Install Ubuntu Server 26.04 and Install AlmaLinux 10 (in French). This section only keeps the points where the choice is yours.
Boot from the bootable USB stick
Insert the stick into the server's USB port, then restart. For the machine to boot from the stick, open the boot menu during the first few seconds: depending on the manufacturer, it is F12, F11 or Esc. F2 rather opens the firmware settings (BIOS or UEFI), where you change the boot order permanently. The firmware is the program built into the motherboard that runs before any system.
Once the system boots from the stick, the installer's welcome screen appears: Subiquity for Ubuntu, debian-installer for Debian, Anaconda for RHEL and its derivatives.
Configure the startup settings
The installer first asks for the language, the keyboard layout, the region and the time zone. Set them correctly to avoid later localisation problems: a wrongly declared keyboard makes typing the password a gamble.
Partition the hard disk
The installers offer two options. Automatic partitioning (whole disk) sets up
the layout for you, with or without LVM depending on the installer; it suits a
first installation and a practice VM. Manual partitioning is for when you have
precise requirements, such as the production layout described above: you create
/, the swap, /var, /home and the rest yourself.
This choice affects the management of disk space, backups and system performance: choose manual only if you know why.
Select the software packages to install
The installer offers to select software packages: web server (Apache or Nginx), database (such as MySQL or PostgreSQL), SSH server and other components.
Prefer installing a minimal version of the server, which you then configure carefully: every service installed without need listens on the network and will have to be updated. Keep the OpenSSH server, though: it is essential to administer the machine remotely.
Initial configuration of the Linux server
After installation, the initial configuration secures the server and prepares it for day-to-day administration. Five settings come back on every machine, each covered by a lesson of the course, to apply in this order:
- A non-root user with sudo, to administer without working as root: Using sudo.
- Key-based SSH, with no password and no root login: Create and manage SSH keys then Configure the OpenSSH server.
- A firewall that only opens the useful ports: Understand Linux firewalls.
- Time synchronised through NTP (the network protocol that sets clocks): Synchronise the clock with chrony.
- Security updates: Apply security updates.
Install a temporary Linux server
To practise installing a Linux server, do it in a virtual machine: the Install Linux in a VM guide tells you which virtualisation software to choose depending on your system (Hyper-V or VMware Workstation Pro on Windows, KVM on Linux, UTM on Mac) and walks through the installation. The three tutorials cited above then cover each distribution screen by screen.
Once you master this task, you can use a tool such as Vagrant (in French) to virtualise a Linux server in no time. For example, I wrote a post on provisioning VMs on Windows Hyper-V with Vagrant (in French). It dates from 2024 and was written for Windows 10, whose standard support ended on 14 October 2025: the principle remains valid on Windows 11, but the screens may differ.
I advise against doing it with Docker, because it works differently from a real server: a container shares the host's kernel and goes through neither an installer, nor a boot loader, nor real partitioning.
Automate the installation
Installing a server by hand is perfect for learning, but in production you automate: the installation becomes reproducible, click-free and identical on 1 or 100 machines. Two building blocks follow each other, and confusing them is the classic mistake: an automated installation mechanism lays down the system, then cloud-init configures it at first boot.
Which automated installation mechanism for each distribution family
The three families meet the same need with three incompatible file formats, read by three different installers. The file therefore cannot be copied from one family to another, and the first thing that changes is how you provide it: a boot parameter for Debian and RHEL, a prepared image or a web server for Ubuntu. The tabs below give, for each one, the installer, the file name and a starting excerpt, to complete.
The Subiquity installer reads an autoinstall file (in cloud-init
format) for a non-interactive installation. The password is given as a
hash, never in clear text:
#cloud-configautoinstall: version: 1 identity: hostname: srv01 username: ubuntu password: "$6$..." # hash via openssl passwd -6 ssh: install-server: true allow-pw: falsedebian-installer reads a preseed.cfg (provided through the
preseed/url=... boot parameter), which answers the installer's questions in
advance:
d-i debian-installer/locale string en_USd-i partman-auto/method string lvmtasksel tasksel/first multiselect standardCopy the partitioning recipes from the official example: the partman syntax is dense and fragile.
Anaconda reads a ks.cfg (boot option inst.ks=http://.../ks.cfg).
The excerpt below is accepted by ksvalidator -v RHEL10 (pykickstart package),
but it sets neither a root password nor a time zone: Anaconda will ask for
them, and the installation will only be non-interactive once those
directives (rootpw, timezone) are added.
Beware of clearpart --all: this directive erases all the partitions of all
the disks the installer can see, without asking for confirmation. On a test VM,
that is what you want. On a machine that holds other data, limit the erasure to
one disk with clearpart --all --drives=vda (adapt the disk name).
lang en_US.UTF-8clearpart --all --initlabelautopart%packages@^minimal-environment@core%endcloud-init: configuration at first boot
A cloud image is a ready-to-boot system disk that cloud providers offer in place of an ISO. On these images, cloud-init configures the machine at first boot (users, SSH keys, packages, time zone) through a user-data file in #cloud-config format:
#cloud-configusers: - name: ansible sudo: "ALL=(ALL) NOPASSWD:ALL" groups: users, admin ssh_authorized_keys: - ssh-ed25519 AAAAC3NzaC1lZDI1NTE5...package_update: truepackage_upgrade: truepackages: - gittimezone: Europe/ParisThe sudo: "ALL=(ALL) NOPASSWD:ALL" line gives the ansible account root rights
without a password. It is convenient for automation, but whoever obtains the
SSH key of that account becomes root with no further barrier. Reserve this setting
for automation accounts, protect their key, or limit sudo to the commands that
are needed.
The cloud-init schema command is part of the cloud-init package, already
present on cloud images. On another machine, install that package first
(sudo apt install cloud-init on Debian and Ubuntu, sudo dnf install cloud-init on RHEL and AlmaLinux).
Validate the file before using it, without deploying anything. Measured with
cloud-init 26.1 on Ubuntu 24.04, the file above is accepted, while a
misspelt key (sudoo) makes the command exit with code 1 and
Invalid user-data:
cloud-init schema --config-file user-data.yamlValid schema user-data.yamlCheck the installation
Once the server has booted, a few commands confirm it is healthy. Run them in this order, from the overall verdict to the details of the disks and the network:
systemctl is-system-running # "running" expected ("degraded" = a failed unit)hostnamectl # name and system informationlsblk # partitions and mountsdf -h # disk space per file systemip a # interface IP addressestimedatectl # time, time zone, NTP synchronisationsystemctl is-system-running gives the verdict in one word. With degraded, at
least one unit has failed (a unit is a service or a task that systemd
manages). List them with systemctl --failed, then read the journal of the one at
fault with journalctl -u.
Key points
- A server has no graphical interface: choose a server or minimal image, in amd64 or arm64, and check its SHA-256 checksum.
- To learn, choose the installer's whole disk; for a production server, use LVM and separate
/var,/var/log,/home: a single partition that fills up blocks the whole system. - The network card is hardware, the IP address a setting (DHCP or static): the two are not decided in the same place.
- Swap is sized according to RAM (RHEL 10 rule), not systematically at twice the RAM.
- Automate as soon as possible: autoinstall (Ubuntu), preseed (Debian), Kickstart (RHEL/AlmaLinux), cloud-init (cloud images).
- Validate a cloud-init
user-datafile offline withcloud-init schemabefore deploying. - First settings: non-root sudo user, key-based SSH (no root, no password), firewall, NTP, updates.
- Check health with
systemctl is-system-running, thenhostnamectl,lsblk,df -handip a.
Knowledge check
Check that the essentials of this guide are acquired. The questions only cover what has just been explained here.
Knowledge check
Check what you have learned with this interactive quiz
How it works
- The timer starts when you click Start
- Multiple choice, true/false and short answer questions
- You can move between questions
- Detailed results are shown at the end
Starts the quiz and the timer
Review
(0/0)Result saved on this device. It will be sent to your account at the next sync. Sync now
Score by domain
A domain groups several guides and gets several questions, so its score is more reliable than a per-topic score, which often rests on a single question.
Summary
Strengths
No topic passed at 80% on at least two questions yet.
Weak areas
No topic below the pass mark.
Recommended next
Hints before you try again?
Continue the course: Install WSL2 on Windows 11 (or Windows 10) for a local Linux
A new full quiz with random questions
Work again only on the questions you missed
FAQ: frequently asked questions
These questions come up most often before a first server installation, and they are about trade-offs the guide covers in different places: the partition sizes, the choice between LVM and classic partitioning, and what to automate from the very first machine.