Installing a Linux server means making four decisions in a row: the distribution, the installation media, the disk layout and the way to repeat the operation. This guide takes them in order, for a beginner installing a first server on a physical machine or in a virtual machine: download the right ISO image, write a bootable USB stick, choose a partitioning scheme with LVM, then automate the installation with autoinstall, preseed, Kickstart or cloud-init. It ends with the commands that prove the server is healthy.
Why Linux? Because Linux has become the dominant operating system for servers, for its stability, security and versatility. Whether you are a seasoned administrator or a beginner, installation remains the moment when choices that are hard to undo get made.
What you will learn
- Prepare the installation: distribution, hardware, ISO image checked with sha256, bootable USB stick
- Partition a disk following the RHEL 10 recommendations for
/boot,/and swap - Install a server, then carry out its initial configuration
- Automate the installation with Kickstart, preseed or cloud-init
- Check that the installed server is compliant before using it
Why does a correct installation matter?
A correctly performed Linux server installation is much more than a mere technical formality. It is the foundation your whole infrastructure rests on. A correct installation guarantees system stability, the security of data and services, and optimal performance. On the other hand, a careless or incorrect installation can lead to problems, security vulnerabilities and costly service outages: a disk split too tightly, for example, can no longer be fixed without downtime.
Preparing the Linux installation
The first step of a Linux server installation is preparation. This phase largely decides the success of the whole process. It covers choosing the distribution that suits your use case, checking the hardware and downloading the right ISO image.
Choosing the Linux distribution
The Linux world is rich in distributions, each with its own features, strengths and weaknesses. Before you start, it is important to pick the distribution that best meets your needs. 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.
Each distribution has its own philosophy and its own management tools. Take into account your needs, your knowledge and the compatibility with the tools you plan to use.
Hardware requirements
Before starting the installation, make sure your hardware is compatible and meets the minimum requirements of the chosen distribution. The key components to consider are:
- Processor (CPU): speed and number of cores matter depending on the expected workload.
- RAM: the amount of RAM affects performance and your server's capacity to run applications.
- Storage space: make sure you have enough disk space for the operating system, the data and the applications.
- Network card: it must be compatible and configured for a static or dynamic IP address.
Compare your hardware's specifications with the chosen distribution's recommendations to avoid problems during installation. For a training homelab, the Homelab hardware page (in French) details proven configurations.
Downloading the ISO image
Once the distribution is chosen and the hardware checked, 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.
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.
Creating a bootable USB stick
With the ISO image downloaded, the next step is to create a bootable USB stick. This stick lets you boot the server on the installer and start the installation process. On a virtual server, this step disappears: the hypervisor mounts the ISO directly as a virtual drive.
Using a bootable USB creation tool
To create a bootable USB stick, you need a utility that transfers the ISO image to the stick while making it bootable. Several free tools do the job, and the choice mostly depends on your operating system:
-
Balena Etcher: available for Windows, macOS and Linux, Etcher is a friendly tool that simplifies the creation of bootable USB sticks. It is also known for its reliability.
-
Rufus: mainly aimed at Windows, Rufus is a powerful tool with many customisation options for creating bootable USB sticks.
-
UNetbootin: available for Windows, macOS and Linux, UNetbootin is an easy-to-use utility that creates bootable USB 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.
Loading the ISO image onto the USB stick
Once the tool is chosen, the general steps are the same everywhere. The fourth one needs all your attention, because a device mistake wipes a whole disk:
- Insert the USB stick into an available USB port of your computer.
- Start the creation tool you chose.
- Select the ISO image you downloaded earlier.
- Choose the USB stick to use. Make sure you select the right stick, because all the data on it will be erased during the process.
- Start creating the bootable stick by following the tool's instructions. It copies the ISO image onto the USB stick and makes it bootable.
- Once the process is over, you have a bootable USB stick ready to install your Linux server.
Disk partitioning
Before starting the installation, you must decide on the disks' partitioning: installation time is when this choice costs the least. Revisiting it later requires backing up the data, recreating the partitions then restoring, unless you chose LVM.
Managing partitions and disks
Managing partitions and disks means splitting the disk and organising the storage space to optimise the server's performance and security. The Partition a disk guide details the tools; this section focuses on the choices to make at installation time.
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
Partitioning is the process of dividing a disk into separate sections, each able to carry a different file system. It allows better data organisation, a separation between system and user environments, and increased security. If a file system gets corrupted, or a service fills up the disk, the damage stays limited to a single partition.
An example of partitioning
Here is an example of partitioning 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.
-
Temp partition (
/tmp):- Size: 10 GB.
- Purpose: for temporary files.
-
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.
Adapt this layout to your server's 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.
Choosing the file system type
The choice of file system is just as important, because it decides 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.
Installing the Linux server
With your bootable USB stick ready, it is time to install your Linux server. This phase chains booting from the USB stick, the basic settings, disk partitioning and the selection of the packages to install.
Booting from the bootable USB stick
Insert your bootable USB stick into the server's USB port, then restart the system. You may need to open the boot menu (usually by pressing a specific key such as F2, F12 or ESC at startup) to select the USB stick as the boot device.
Once the system boots from the USB stick, the welcome screen of the distribution's installer appears: Subiquity for Ubuntu, debian-installer for Debian, Anaconda for RHEL and its derivatives.
Configuring the startup settings
Before starting the installation, you will have to set some basic parameters, such as the language, the keyboard layout, the region and the time zone. They depend on your location and preferences. Set them correctly to avoid later localisation problems: a wrongly declared keyboard makes typing the password a gamble.
Partitioning the hard disk
Partitioning the disk is a critical step when installing a Linux server. You will have to decide how to organise your system's partitions. There are two common options, and the choice depends on your experience:
-
Automatic partitioning: installers offer an option that sets up partitioning for you, often with LVM. This option generally suits beginners, but it may not meet specific needs.
-
Manual partitioning: if you have particular requirements, go for manual partitioning. You can create separate partitions for the root system (/), the swap, the /home directory, etc.
Make sure you understand the implications of the partitioning you choose, because it affects the management of disk space, backups and system performance.
Selecting the software packages to install
During installation, you will be able to select the software packages to install on your server. Common choices include the web server (such as Apache or Nginx), the database (such as MySQL (in French) or PostgreSQL), the SSH server and other components your environment needs.
Personally, I prefer to install a minimal version of the server and then configure it 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.
Once these settings are configured, start the actual installation and follow the installer's instructions until the reboot.
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: Synchronise the clock with chrony.
- Security updates: Apply security updates.
Installing a temporary Linux server
To practise installing a Linux server, I recommend doing it in a virtual machine, with a local virtualisation solution such as VirtualBox, VMware Workstation or KVM: the Install Linux in a VM guide walks you through it step by step.
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 tutorial to provision VMs on Windows Hyper-V with Vagrant (in French).
I advise against doing it with Docker (in French), 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.
Automating the installation
Installing a server by hand is perfect for learning, but in production you automate: 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 3 families meet the same need with 3 incompatible file formats, read by 3 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.
lang en_US.UTF-8clearpart --all --initlabelautopart%packages@^minimal-environment@core%endcloud-init: configuration at first boot
On cloud 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/ParisValidate it 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.yamlChecking 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:
hostnamectl # name and system informationsystemctl is-system-running # "running" expected ("degraded" = a failed unit)lsblk # partitions and mountsdf -h # disk space per file systemip a # interface IP addressestimedatectl # time, time zone, NTP synchronisationsystemctl is-system-running is the most useful reflex: degraded signals
that at least one unit has failed, to investigate with
systemctl --failed, then journalctl -u on the unit at fault.
Key points
- A server has no graphical interface: choose a server or minimal image, in amd64 or arm64, and check its SHA-256 checksum.
- Partition with LVM and separate
/var,/var/log,/home: a single partition that fills up blocks the whole system. - 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,hostnamectl,lsblk,df -h,ip 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)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 10 and 11 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: partition sizes, the choice between LVM and classic partitioning, and what to automate from the very first machine.