Describing an operating system installation process might seem trivial since the internet is flooded with similar guides. However, proper disk partitioning and initial settings save hours of troubleshooting later.

Let us look at a practical example of installing Debian. For demonstration purposes, we will use a virtual machine (1 vCPU, 2 GB RAM) with UEFI enabled. The process will be as close as possible to deploying on a real physical server.


Preparation and Download#

Download the latest ISO image from the official website: debian.org/download .

If a stable network connection is available during installation, feel free to choose netinst (a minimal image that pulls required packages from the internet). If you plan an offline installation, download the full DVD image.

Connect the bootable USB drive and boot up the system.


Starting the Installation#

Upon the first boot, the GRUB menu appears. Select Graphical Install.

first-menu

Next is language selection. I recommend keeping English for both the installer and the future system. This significantly simplifies searching through logs and troubleshooting potential issues.

language-selections

Specify your location country.

select-location

Select the system locale (interface language, encoding, etc.). The optimal choice is United States (en_US.UTF-8).

configure-locales

Configure the keyboard layout.

configure-keyboard


Network and Accounts#

At this stage, the installer attempts to configure the network. If DHCP is running on your network, the process will complete automatically. Otherwise, you will need to configure the network manually (IP address, netmask, gateway, DNS).

Specify the hostname (hostname):

choose-hostname

Specify the domain name (domain name):

choose-domain

Setting the root password: if you leave this field blank, direct login as superuser will be disabled, and the first created user will automatically be granted sudo privileges. This is the recommended approach for security reasons.

Note: Setting a root password is only warranted in specific cases, for example, when regular user accounts are stored in external authentication systems (LDAP, Active Directory, etc.).

root-password

Enter the full name of the new user:

user-name

Set the login (username):

user-login

Set a strong password:

user-password


Disk Partitioning#

We move on to the most critical step: creating disk partitions. If the disk already contains an old layout or other data, it must be removed. We are considering a scenario with a completely clean drive.

Choose the manual mode Manual:

partition-disks

Select the target disk from the list:

partition-disks-choose-disk

Confirm the creation of a new empty partition table:

partition-disks-create-empty-table

Select the unallocated space on the disk to proceed:

partition-disks-use-free-space


Creating Partitions#

Creating a new EFI partition:#

partition-disks-create-new-part1

Specify the future volume size:

partition-disks-create-new-part2

Place the partition at the beginning of the disk:

partition-disks-create-new-part3

The system automatically defaults the new partition settings to /. Change the “Use as” option:

partition-disks-create-new-part5

Select EFI System Partition:

partition-disks-create-new-part6

Finish setting up the partition via Done setting up the partition:

partition-disks-create-new-part7


Creating the root (/) filesystem:#

Select the unallocated space on the disk again:

partition-disks-create-new-part20

Create a volume:

partition-disks-create-new-part21

Set the size:

partition-disks-create-new-part22

This time the system proposed exactly what is needed: the Ext4 filesystem and the / mount point.

partition-disks-create-new-part23


Creating a new LVM partition:#

In the previous steps, we created two volumes: for EFI and /. These volumes must reside in regular disk partitions.

Note: The system kernel must reside on the main disk partition. That is, instead of /, you could create a separate /boot volume and place / inside LVM.

Continue and select the remaining unallocated space:

partition-disks-create-new-part30

Allocate the entire remaining space for the LVM physical volume by specifying max:

partition-disks-create-new-part31

Choose the use as physical volume for LVM, save, and continue:

partition-disks-create-new-part32


Configuring the LVM Volume Group:#

Select Configure the Logical Volume Manager:

partition-disks-create-new-part40

The system will prompt you to write current changes to disk. Confirm: Yes -> Continue.

partition-disks-create-new-part41

Create a volume group (volume group):

partition-disks-create-new-part42

Specify a name for the group. The name should be short and descriptive:

partition-disks-create-new-part43

Select the physical partition (PV: physical volume) created in the previous step:

partition-disks-create-new-part44


Creating Logical Volumes within the Volume Group#

Create a logical volume (logical volume) for swap:

partition-disks-create-new-part50

Select the newly created volume group:

partition-disks-create-new-part51

Set the volume name:

partition-disks-create-new-part52

Set the volume size:

partition-disks-create-new-part53

Create a logical volume for /usr:

partition-disks-create-new-part60

Specify the name:

partition-disks-create-new-part61

Creating other volumes follows a similar pattern. Volumes for /home (“home”, 1GB), /tmp (“tmp”, 1GB), /var (“var”, 2GB), and /var/log (“var-log”, 1GB) are provisioned using this same scheme.


Configuring the filesystem and mount point for /home#

Select the space on the logical volume named home:

partition-disks-create-new-part-lvm1

Specify the filesystem type and mount point:

partition-disks-create-new-part-lvm11


Configuring the volume for swap#

Select the corresponding space:

partition-disks-create-new-part-lvm2

Select Use as: swap area:

partition-disks-create-new-part-lvm21


Configuring the filesystem and mount point for /tmp#

Select the space:

partition-disks-create-new-part-lvm3

Select secure mount options:

partition-disks-create-new-part-lvm31

Save the settings:

partition-disks-create-new-part-lvm32


Configuring the filesystem and mount point for /usr#

Select the space:

partition-disks-create-new-part-lvm40

Save:

partition-disks-create-new-part-lvm41


Configuring the filesystem and mount point for /var#

partition-disks-create-new-part-lvm50 partition-disks-create-new-part-lvm51 partition-disks-create-new-part-lvm52


Configuring the filesystem and mount point for /var/log#

partition-disks-create-new-part-lvm60 partition-disks-create-new-part-lvm61 partition-disks-create-new-part-lvm62 partition-disks-create-new-part-lvm63 partition-disks-create-new-part-lvm64


Completing Partition Creation#

At this point, we have our final list of upcoming partitions.

partition-disks-ALL-parts-done

If you read our article on partition structure, you noticed that we deliberately do not create separate partitions for /opt and audit server logs. This system does not plan to install third-party software in /opt or use auditd, so allocating separate resources for them makes no sense.

Confirm and write changes to disk:

partition-disks-ALL-parts-done-write-changes


Installing the System#

Afterwards, the base system installation process begins:

Inst-base

When asked about scanning additional media (if installation is performed over the network or only a single DVD disc is used), choose “No”.

Inst-base-don-scan-extmedia

Choose a repository mirror for downloading packages:

Inst-base-plus-mirror Inst-base-plus-mirror2

Proxy server configuration. If a proxy is not used, simply leave the field blank and click “Continue”.

Inst-base-plus-proxy

Wait for unpacking and installation of core components:

Inst-base-plus-installation

Participation in the package usage survey (popularity-contest). Choose at your discretion, as this is anonymous statistics for Debian developers.

Inst-base-plus-installation-vote

Software selection. To get a minimal and clean server system, leave checkmarks only next to SSH server and standard system utilities.

Inst-base-plus-installation-choice

Completing installation and configuring the GRUB bootloader:

Inst-base-plus-installation-grub

Installation successfully completed! Remove the bootable medium and reboot the system.

Inst-base-plus-installation-compleate


First System Boot#

First boot and the GRUB menu screen:

first-boot-grub

Console login prompt window:

first-boot-login

Our system is ready to work. Check the current disk space layout:

first-boot-df

Switch to root (or use sudo) and check the free space in the Volume Group left for potential partition expansion in the future:

first-boot-vgs


Conclusion#

Proper initial disk layout using LVM provides future flexibility. If any partition (such as /var or /home) fills up, it can be expanded on the fly within seconds. Installing a basic Debian system takes minimal time while providing a stable and fully controlled foundation for any tasks.