z0x

College Student

Arch Linux install guide

Guide to installing Arch Linux with full disk encryption for UEFI systems

2026-02-01 UTC · Updated on 2026-02-04 UTC

Introduction

The goal of this guide is to set up a minimal installation of Arch Linux with full disk encryption on an UEFI system. This guide is meant to be read alongside the Arch wiki. It does not cover implementing Secure Boot

Info

  • I’ll skip the Arch ISO installation media preparation.
  • I won’t prepare the system for secure boot because the procedure of custom key enrollment in the` BIOS
  • I’ll use a wired connection, so no wireless configuration steps will be shown. If you want to connect to wifi, you can either use iwctl (CLI) or install and launch impala (TUI).

Preliminary steps

Check that we are in UEFI mode

If this command prints 64 or 32 then you are in UEFI

Terminal window
cat /sys/firmware/efi/fw_platform_size

Update the system clock

Terminal window
# Check if ntp is active and if the time is right
timedatectl
# In case it's not active you can do
timedatectl set-ntp true

Partition the disk

Throughout this guide nvme0n1 will be used as the target install drive. The drive will be separated into two partitions:

NumberTypeSize
1EFI512 Mb
2Linux FilesystemAll of the remaining space
Warning

The following steps will wipe completely your nvme0n1 drive

  1. Run gdisk
Terminal window
gdisk /dev/nvme0n1
  1. Press x to enter expert mode. Then press z to zap our drive. Then hit y when prompted about wiping out GPT and blanking out MBR.

  2. Run gdisk

Terminal window
gdisk /dev/nvme0n1
  1. Delete any existing partitions. Repeat until none are left.
Command (m for help): d
  1. Create a boot partition
Command (m for help): n
Partition number (1-128, default 1):
First sector (...):
Last sector (...): +512M
Hex code or GUID (...): ef00
  1. Create a root partition
Command (m for help): n
Partition number (2-128, default 1):
First sector (...):
Last sector (...):
Hex code or GUID (...): 8300
  1. Write the changes
Command (m for help): w
Do you want to proceed? (Y/N): y
  1. Verify partitioning
Terminal window
lsblk
Note

It should look something like this

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465,8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part
└─nvme0n1p2 259:2 0 465,3G 0 part

nvme0n1 is the main disk nvme0n1p1 is the boot partition nvme0n1p2 is the root partition

Encrypt root partition

  1. Encrypt your root partition
Tip

Make sure to enter a secure passphrase and to write it down

Terminal window
cryptsetup luksFormat /dev/nvme0n1p2
Are you sure (Type `yes` in capital letters): YES
  1. Open the encrypted partition
Terminal window
cryptsetup open /dev/nvme0n1p2 root

Create filesystems

  1. Create the boot file system
Terminal window
mkfs.fat -F32 /dev/nvme0n1p1
  1. Create the root file system
Terminal window
mkfs.ext4 /dev/mapper/root

Mount file systems

  1. Mount the root file system
Terminal window
mount /dev/mapper/root /mnt
  1. Mount the boot file system
Terminal window
mount -m /dev/nvme0n1p1 /mnt/boot -o dmask=0077,fmask=0077
  1. Verify mounting
Terminal window
lsblk
Note

It should look something like this

lsblk
NAME MAJ:MIN RM SIZE RO TYPE MOUNTPOINTS
nvme0n1 259:0 0 465,8G 0 disk
├─nvme0n1p1 259:1 0 512M 0 part /mnt/boot
└─nvme0n1p2 259:2 0 465,3G 0 part
└─root 254:0 0 465,2G 0 crypt /mnt

Install essentials

Install the base system, kernel, init system and other essential packages.

Terminal window
pacstrap /mnt base base-devel linux linux-firmware efibootmgr doas neovim
Note

Install AMD or Intel microcode, depending on your system’s CPU

Microcode

AMD CPU

Terminal window
pacstrap /mnt amd-ucode

Intel CPU

Terminal window
pacstrap /mnt intel-ucode

Generate file system table

Terminal window
genfstab -U /mnt >> /mnt/etc/fstab

Now edit /mnt/etc/fstab and change fmask=0022,dmask=0022 to fmask=0077,dmask=0077.

Switch to new Installation

Terminal window
arch-chroot /mnt

Network stack

Terminal window
pacman -S networkmanager iwd
systemctl enable NetworkManager
/etc/NetworkManager/conf.d/wifi_backend.conf
[device]
wifi.backend=iwd

Localization

Set the locale

Tip

Feel free to change en_US.UTF-8 to your preferred locale such as en_GB.UTF-8.`

  1. Uncomment en_US.UTF-8
/etc/locale.gen
#en_US.UTF-8 UTF-8
en_US.UTF-8 UTF-8
  1. Generate locales
Terminal window
echo 'LANG=en_US.UTF-8' > /etc/locale.conf
locale-gen

Set the timezone

Example

ln -sf /usr/share/zoneinfo/Asia/Dubai /etc/localtime

Terminal window
ln -sf /usr/share/zoneinfo/YourRegion/YourCity /etc/localtime

Set hardware clock from system clock

Terminal window
hwclock --systohc

Hostname

Set your preferred hostname, I will be using MYHOSTNAME throughout this guide.

Terminal window
echo 'MYHOSTNAME' > /etc/hostname
/etc/hosts
# Static table lookup for hostnames.
# See hosts(5) for details.
127.0.0.1 localhost
::1 localhost
127.0.1.1 MYHOSTNAME.localdomain MYHOSTNAME

Initramfs

In the HOOKS array, add encrypt between block and filesystems

/etc/mkinitcpio.conf
HOOKS=(... block encrypt filesystems ...)

Generate initramfs images

Terminal window
mkinitcpio -P

Add a user

  1. Set the root password.
Terminal window
passwd
  1. Create a user and set his password.
Terminal window
useradd -m MYUSERNAME
passwd MYUSERNAME

Configure doas

  1. Create the config file and set the appropriate permissions
Terminal window
touch /etc/doas.conf
chown -c root:root /etc/doas.conf
chmod -c 0400 /etc/doas.conf
  1. Add the following
/etc/doas.conf
permit MYUSERNAME as root
permit nopass MYUSERNAME as root cmd pacman

Boot loader

Note

Use EFISTUB if you dont need to boot into multiple OS’s as it will boot you directly into Arch (very fast) and use systemd-boot if you need to boot into multiple OS’s.

Get the UUID of your root partition

Terminal window
blkid -s UUID -o value /dev/nvme0n1p2
Tip

Replace xxxx with the UUID that you just obtained.

Replace amd-ucode.img with intel-ucode.img if you have an Intel CPU.

EFISTUB

Terminal window
efibootmgr -c -d /dev/nvme0n1 -p 1 -l /vmlinuz-linux -L "Arch Linux" -u "cryptdevice=UUID=xxxx:root root=/dev/mapper/root rw initrd=\amd-ucode.img initrd=\initramfs-linux.img loglevel=3 quiet"

Systemd-boot

Initramfs

Replace the HOOKS array with the following one

/etc/mkinitcpio.conf
HOOKS=(base systemd autodetect microcode modconf kms keyboard sd-vconsole sd-encrypt block filesystems fsck)

Regenerate initramfs images

Terminal window
mkinitcpio -P

Installation

Terminal window
bootctl install
/boot/loader/entries/arch.conf
title Arch Linux
linux /vmlinuz-linux
initrd /amd-ucode.img
initrd /initramfs-linux.img
options rd.luks.name=xxxx=root root=/dev/mapper/root rw loglevel=3 quiet
/boot/loader/loader.conf
#timeout 3
timeout 3
#console-mode keep

Reboot

  1. You can now reboot and enter into your new installation
Note

Unplug your flash drive after the screen turns black

Terminal window
exit
umount -R /mnt
reboot now

Post install

You will now be greeted with a similar screen as when you first booted from the flash drive. Login using the credentials that you set, if you followed the example your username would be MYUSERNAME.

Swap

Terminal window
doas fallocate -l 4G /swapfile
doas chmod 600 /swapfile
doas mkswap /swapfile
doas swapon /swapfile
doas cp /etc/fstab /etc/fstab.bak
echo '/swapfile none swap sw 0 0' | doas tee -a /etc/fstab

Video drivers

AMD

doas pacman -S mesa linux-firmware-amdgpu vulkan-radeon

Intel

doas pacman -S mesa linux-firmware-intel vulkan-intel

Nvidia

https://wiki.archlinux.org/title/NVIDIA

https://wiki.hypr.land/Nvidia

Sort for fastest mirrors

Terminal window
doas pacman -Syu reflector
doas reflector --verbose -p https -l 30 -f 5 --sort rate --save /etc/pacman.d/mirrorlist

AUR

Add Chaotic-AUR

Terminal window
doas pacman-key --recv-key 3056513887B78AEB --keyserver keyserver.ubuntu.com
doas pacman-key --lsign-key 3056513887B78AEB
doas pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-keyring.pkg.tar.zst'
doas pacman -U 'https://cdn-mirror.chaotic.cx/chaotic-aur/chaotic-mirrorlist.pkg.tar.zst'
/etc/pacman.conf
[chaotic-aur]
Include = /etc/pacman.d/chaotic-mirrorlist

Install paru

Terminal window
doas pacman -Syu
doas pacman -S paru

Replace sudo with doas

Terminal window
doas pacman -Rdd sudo
doas ln -s /usr/bin/doas /usr/bin/sudo

Laptop power profiles

Install and enable the powerprofiles daemon

Terminal window
pacman -S power-profiles-daemon
systemctl enable power-profiles-daemon
systemctl start power-profiles-daemon start

MAC randomization

Info

MAC randomization can be used for increased privacy by not disclosing your real MAC address to the WiFi network.

/etc/NetworkManager/conf.d/00-macrandomize.conf
[device-mac-randomization]
wifi.scan-rand-mac-address=yes
[connection-mac-randomization]
ethernet.cloned-mac-address=random
wifi.cloned-mac-address=random