Arch Linux installation guide¶
This guide presents a practical approach to installing Arch Linux. It walks through disk layout, optional full-disk encryption, ext4 or Btrfs filesystems, and setup of the systemd-boot bootloader. It also includes steps for installing proprietary NVIDIA drivers.
While I typically configure my desktop environment and dotfiles separately, this guide provides a brief set of commands for installing the GNOME desktop environment for convenience.
This document is not intended to replace the official Arch Wiki Installation Guide, which remains the most comprehensive and authoritative reference. Instead, it offers a personal and opinionated workflow, a set of practical notes meant to complement the Arch Wiki. Use both together to make informed decisions and adapt the process to your system.
Danger
This guide includes steps that will erase all data on your disk. Adjust the disk preparation, partitioning, and formatting steps if this is not your intention.
This guide is provided under the terms of the Apache License, Version 2.0.
Recommended setup method¶
If you have access to a second computer, the most convenient way to install Arch is to boot the target machine from a flash drive and connect to it via SSH from the other computer. This approach allows you to keep this documentation open and copy commands easily between systems. Instructions for enabling SSH on the live environment are included below.
You can also complete the installation directly on the target machine if you prefer working locally.
Safe use of shell variables¶
This guide uses parameter expansion syntax, such as ${target:?}, to prevent unintended command operation if a variable is unset or empty. This safety check is particularly useful when copying commands over SSH or when several shell tabs are open, as it reduces the chance of running a command with incomplete parameters.
For manual input, you may simplify variable references to $target. However, ensure that every variable is correctly assigned and contains the expected value before running any command.
Download the Arch ISO and write it to a USB drive¶
This section assumes you are using a Linux computer to create the bootable installation medium. If you are on Windows, macOS, or Android, refer to the USB flash installation medium article. The Arch ISO file and additional download options are available on the Arch Linux Downloads page.
Download the ISO¶
Use curl to fetch the latest installation image from a reliable mirror. Arch Linux releases a new ISO every month.
Verify the SHA256 checksum¶
Verify the SHA256 hash to ensure the downloaded file matches the official signature and has not been tampered with.
Warning
Although this one-liner is convenient, it may break if the download page changes its formatting. If you encounter issues, use the manual method.
This method relies on the archlinux.org website to securely provide the correct checksum.
curl -s https://archlinux.org/download/ |
grep -m1 "SHA256" |
grep -oE "[a-f0-9]{64}" |
sed "s/$/ archlinux-x86_64.iso/" |
sha256sum -c -
If the output is archlinux-x86_64.iso: OK, the file is valid.
Visit the Arch Linux download page and copy the SHA256 hash for the ISO.
Replace SIGNATURE with the copied hash, then verify the file:
If the output is archlinux-x86_64.iso: OK, the file is valid.
Write the ISO to a USB drive¶
Identify the target USB device using fdisk -l, then set the device path variable to prepare the bootable medium.
Danger
The device you select will be completely erased in the following steps. Choose carefully to avoid data loss.
Set the device path variable, replacing sdX with your USB drive's actual device name (e.g., sdb or mmcblk0):
Use dd to write the ISO to the USB device. This operation is permanent and destructive.
Verify the USB copy (optional)
To ensure the data was written correctly, compare the written data byte-by-byte with the original ISO file. Remove and reinsert the USB drive first to clear any potential cache.
Boot from USB flash drive¶
Access your system's firmware (BIOS/UEFI) settings to select the USB drive as the boot device.
The USB drive can be safely removed once the live environment loads to a shell prompt.
Warning
Disable Secure Boot in your firmware settings. The official Arch Linux installation images do not support Secure Boot. Secure Boot configuration for the installed system is an advanced topic; consult the Arch Wiki on Secure Boot if required.
Improve console readability¶
Info
For more details, see Installation guide: Set the console keyboard layout and font and Linux console#Fonts.
Change the console font for better legibility, which is especially useful on high-resolution displays.
Network checks and optional SSH connection¶
A stable network connection is mandatory for the installation. Test connectivity to ensure the live environment can reach the internet.
Wired connections typically work automatically.
Tip
For wireless setup or troubleshooting, consult the Installation guide#Connect to the internet and network configuration.
Connect to the live environment by SSH (optional)
Info
Refer to Install Arch Linux via SSH for more information.
Using SSH from another machine can simplify the process by allowing for easy command copy-pasting and simultaneous research.
Set a temporary root password¶
Set a temporary root password for the live environment. This password allows SSH login and will not persist after the installation.
Establish an SSH session¶
If your client machine supports mDNS (Multicast DNS), connect using the default hostname archiso.local.
Perform basic system checks¶
Confirm UEFI boot mode¶
Confirm the system booted in UEFI mode, which is required for systemd-boot.
If the file exists and contains 64, the system is in 64-bit UEFI mode. If the file is absent, reboot the system and switch to UEFI mode in the firmware settings.
Check system time¶
Info
For more details, see the Arch Wiki on updating the system clock.
Verify the current time and that NTP synchronization is active (handled automatically by systemd-timesyncd in the live environment).
The time zone set here only affects the live environment and will be configured for the installed system later.
Assign variables for disk identification and prepare for partitioning¶
Identify the target disk by listing available block devices and assign the device path and partition names to shell variables.
Danger
The device you select will be completely erased in the following steps. Choose carefully to avoid data loss. Back up all necessary data.
Use the appropriate tab for your disk type.
Replace /dev/nvme0n1 with the NVMe device you want to use, and assign the partition names to variables.
Note: The root_actual variable will be updated later if LUKS encryption is applied.
Check disk settings¶
Ensure 4K block size on NVMe drives¶
Info
See Advanced Format#NVMe solid state drives for more details.
Aligning your NVMe drive to a 4K (4096 bytes) logical sector size, if supported, improves performance and durability.
First, check the current logical sector size:
Next, verify the supported LBA formats to determine the optimal FORMAT_ID.
Danger
This operation is destructive and will erase all data on the drive. It has also been observed that some NVMe drives become unresponsive after formatting and require a system reboot before they operate again (although the new format will be applied afterward). It is also reasonable to assume that some drives may become unusable due to firmware bugs, as very few users ever change the factory default format. You likely do not want to be the first to discover such an issue, so proceed with caution and carefully consider whether reformatting is worth the risk. It is perfectly fine to stay with the manufacturer’s default format, even if it offers slightly lower performance, in exchange for peace of mind.
If a 4K format is supported but not active, reformat the drive to the optimal LBA Format ID.
Verify TRIM support¶
Info
See Solid state drive#TRIM for more details.
Verify TRIM support, which allows the OS to communicate unused data blocks to a Solid State Drive (SSD) to maintain performance and lifespan. Non-zero values for DISC-GRAN and DISC-MAX confirm that TRIM support is present.
Create partitions¶
Tip
For more information on disk partitioning, see the Installation guide: Partition the disks and Parted.
Launch parted for interactive partitioning:
Create a GPT partition table
Create a GPT (GUID Partition Table), the modern standard required for UEFI.
Set the unit to MiB for optimal alignment
Set the unit to mebibytes (MiB) to ensure partitions are aligned to mebibyte boundaries for optimal performance.
Create the EFI system partition (ESP)
Info
See the EFI system partition page for more information.
Create a 1 GiB (1024 MiB) FAT32 partition starting at 4 MiB.
Set the ESP flag
Mark the first partition as the EFI System Partition, which is necessary for UEFI bootloaders.
Create the root partition
Create the root partition using all remaining disk space, starting immediately after the ESP.
Check partition alignment
Verify optimal alignment for partitions 1 and 2, which is essential for SSD performance.
Review and exit
Review the partition table and exit parted.
Set up LUKS encryption (optional)¶
If you choose to encrypt the root partition ($root_physical) with LUKS2, the decrypted device will become $root_actual. If you skip encryption, $root_actual will simply remain the same as $root_physical.
Steps to encrypt the root partition
Format the root partition with LUKS2¶
Format the root partition ($root_physical) using LUKS2. The --sector-size 4096 option aligns encryption with 4K physical sectors, which improves performance on modern drives.
When prompted, choose a strong passphrase and store it safely. Losing the passphrase means losing access to all encrypted data.
cryptsetup luksFormat --batch-mode --verify-passphrase --type luks2 --sector-size 4096 "${root_physical:?}"
Open the LUKS container and set persistent options¶
Info
For details on discard support and performance tuning, see
Discard and TRIM support and
Disabling the workqueue for SSD performance.
Open the encrypted partition and map it as /dev/mapper/luks-root. The performance and discard options enabled here will apply automatically for future unlocks.
cryptsetup --perf-no_read_workqueue --perf-no_write_workqueue --allow-discards --persistent open "${root_physical:?}" luks-root
Set the root_actual variable¶
Update the variable so that subsequent filesystem operations target the decrypted container.
Tip
For more information, see the Arch Wiki page on dm-crypt.
Format and mount file systems¶
Info
See Installation guide: Format the partitions, Installation guide: Mount the file systems, and File systems for more details.
Format the partitions with the chosen filesystems and mount them to the installation directory (/mnt).
Root partition¶
Choose either traditional ext4 filesystem or the Btrfs with subvolumes.
Info
See the ext4 Arch Wiki page for more information.
Ext4 is a traditional, robust, and mature filesystem.
Format and mount:
The commit=30 option sets the maximum time (in seconds) that data is held in memory before being written to disk, balancing data loss risk and I/O performance.
Info
See Btrfs and Btrfs#Getting started for more information on Btrfs and subvolume setup.
Format the partition for Btrfs. Btrfs subvolumes enable flexible organization and snapshotting.
Format the partition:
Create and mount subvolumes:
Temporarily mount the top-level volume, create the standard subvolumes (@ for root, @home, @swap), then unmount.
mount "${root_actual:?}" /mnt
btrfs subvolume create /mnt/@
btrfs subvolume create /mnt/@home
btrfs subvolume create /mnt/@swap
umount /mnt
Mount the subvolumes to their final locations. The noatime option improves performance by disabling file access time updates, and flushoncommit prioritizes data integrity.
EFI system partition¶
Format the ESP as FAT32, which is required for UEFI booting.
Format the EFI partition as FAT32:
Mount the EFI partition to /mnt/boot:
Mount the ESP with secure permissions (umask=0077) to protect the boot files.
Double-check mounts¶
Verify that all partitions, including subvolumes, are correctly mounted under /mnt.
Install essential packages¶
Tip
See the Installation guide: Install essential packages for a complete list of recommended packages.
Install the base system and all necessary packages using pacstrap. This includes the kernel, firmware, boot manager tools, network manager, and the chosen desktop environment (GNOME) and drivers (NVIDIA).
pacstrap -K /mnt \
base linux linux-firmware efibootmgr \
intel-ucode \
amd-ucode \
nvidia-open \
btrfs-progs compsize \
networkmanager \
sudo man-db man-pages micro nano \
gnome gnome-terminal \
firefox noto-fonts noto-fonts-cjk noto-fonts-emoji
The -K flag ensures a proper pacman keyring setup in the new system. Adjust the package list as needed (e.g., remove btrfs-progs, gnome, or nvidia-open if not required).
Patch the system in /mnt before chroot¶
Fstab (file system table)¶
Info
For details on configuring this file, see the Installation guide: Fstab.
Generate the fstab file, which the system uses at boot to determine which filesystems to mount. The -U option ensures partitions are identified by their UUIDs for reliable mounting.
Check and edit fstab
Review the generated file and update it as needed, such as removing Btrfs subvolid= entries and relying on subvol= path-based mounting for better snapshot flexibility.
Configure systemd-boot¶
Info
For more information on the boot manager, see systemd-boot.
Install the systemd-boot boot manager to the EFI System Partition (ESP) and create the basic configuration files.
Configure loader.conf
Info
Consult the systemd-boot loader configuration for advanced options.
Set arch.conf as the default boot entry in the global bootloader configuration file.
Create boot entry arch.conf
Define the boot process for the Arch Linux kernel.
1. Get UUID
First, retrieve the UUID of the physical root partition.
2. Define kernel arguments
Define the kernel arguments, including the decryption device (cryptdevice) if LUKS is used, or simply the root filesystem UUID otherwise.
2.1. Append Btrfs subvolume flag (if Btrfs is used)
If you used the Btrfs subvolume setup, append the flag specifying the root subvolume.
3. Create the configuration file
Info
Read more about Microcode and systemd-boot to ensure proper loading.
The microcode files (intel-ucode.img and amd-ucode.img) must be listed before the main initramfs-linux.img so they are loaded first. Ensure these microcode files are copied to /mnt/boot by pacstrap (they are dependencies of the intel-ucode and amd-ucode packages).
tee /mnt/boot/loader/entries/arch.conf <<EOF
title Arch Linux
linux /vmlinuz-linux
initrd /intel-ucode.img
initrd /amd-ucode.img
initrd /initramfs-linux.img
options ${kernel_args:?} rw
EOF
Chroot into the new system and configure¶
Info
See the Installation guide: Chroot page for more information on this process.
Change the root directory into the newly installed system to perform final, system-specific configurations.
Time configuration¶
Info
For more details, see Installation guide: Time and System time.
Set the system time zone and enable automatic synchronization.
List available time zones with:
Set the system time zone by linking to the desired zone info file:
Synchronize the hardware clock from the system time to generate /etc/adjtime, and enable NTP for ongoing time updates.
Network configuration¶
Tip
For more on network setup, consult the Installation guide: Network configuration, NetworkManager, and Network configuration#Set the hostname.
Set a unique hostname for your system.
Enable NetworkManager to manage network connections.
Enable GNOME display manager (GDM) (if installed)¶
Info
See GDM#Enable GDM for more details.
If you installed the GNOME desktop environment, enable its display manager to start the graphical environment on boot.
Set root password and create a user¶
Info
See Installation guide: Root password for more context.
Set a secure password for the root account. Even if you normally use sudo for administrative tasks, the root password is still required for system recovery through the systemd emergency target.
Info
For more information on user management, see Users and groups.
Create a regular user (example: foo) and add them to the wheel group so they can use sudo.
Enable sudo access for the wheel group.
Swap space setup¶
Info
See Swap for a detailed guide on swap space configuration.
Even with large amounts of RAM, swap is important because it provides a backing store for inactive program memory, allowing the kernel to better manage physical RAM and file caching.
Select the appropriate method based on your filesystem to create and enable an 8 GiB (example size) swap file:
Create an 8 GiB swap file on an Ext4 root filesystem and add it to fstab.
Info
A Btrfs swap file requires specific creation steps to avoid copy-on-write issues. See Btrfs: Swap file for more details.
Use the Btrfs-specific command to create the 8 GiB swap file and add it to fstab. /swap is a directory where the dedicated @swap subvolume was mounted earlier.
Configure Mkinitcpio¶
Info
For more information, see the Installation guide: Initramfs and Mkinitcpio.
The initial ramdisk environment (initramfs) requires specific configuration to ensure successful system booting, especially when using LUKS encryption or specialized hardware like NVIDIA graphics cards.
Open the primary configuration file to apply the necessary changes:
Configure LUKS encryption
Info
See Encrypting an entire system: Configuring mkinitcpio for more details.
If you use LUKS, integrate the encrypt hook into the HOOKS array. This hook enables the decryption prompt early in the boot sequence.
Locate the HOOKS= line and manually insert encrypt after the block hook and before the filesystems hook.
Configure the NVIDIA driver
Info
See NVIDIA: Early loading for more details.
To ensure the proprietary NVIDIA driver initializes correctly during early boot, update both the HOOKS and MODULES arrays.
1. Remove the kms hook from HOOKS
Removing kms from the HOOKS array prevents the initramfs from including the nouveau module. This ensures the kernel cannot load the open-source driver during early boot, avoiding conflicts with the proprietary NVIDIA driver.
If kms appears in your HOOKS array, remove it.
2. Add the required NVIDIA modules to MODULES
These modules allow the driver to load at the earliest boot stage.
Select the appropriate configuration below based on your system:
Regenerate initramfs¶
Apply the configuration changes and regenerate all initramfs images.
Boot loader finalization¶
Info
See systemd-boot: Updating the UEFI boot manager for more details.
Re-run the boot installation command inside the chroot to ensure the bootloader files on the ESP match the system's installed version.
Enable the automatic update service for systemd-boot to ensure the bootloader files are updated whenever the systemd package is upgraded.
Exit chroot and reboot¶
Remove the installation USB drive, exit the chroot environment, and reboot the system into your new Arch Linux installation.
Post-installation¶
Congratulations! Your Arch Linux system should now boot.
For further steps refer to General recommendations and List of applications.
Install yay AUR helper (optional)¶
Info
See AUR helpers and yay for more information.
Install yay, a popular tool for installing and managing packages from the Arch User Repository (AUR). Run these commands as your regular user, not as root.
sudo pacman -S --needed git base-devel
yay_temp="$(mktemp --directory)"
git clone https://aur.archlinux.org/yay-bin.git "${yay_temp:?}"
(cd "${yay_temp:?}" && makepkg -si)
rm -rf "${yay_temp:?}"
After installing, follow the initial setup steps in the project’s documentation under First Use: Development packages upgrade.