How to Install Arch Linux in UEFI Mode

This guide will walk you through the process of installing Arch Linux in UEFI mode, a secure and efficient way to boot your system.

Installing Arch Linux is a rewarding process for those who want to learn the inner workings of a Linux system. Unlike many user-friendly distributions, Arch provides a minimal base that allows users to build a custom system tailored to their needs. This guide walks you through a UEFI-based installation of Arch Linux from start to finish.

Prerequisites

Before beginning, ensure you have:

  • A computer with UEFI firmware (not legacy BIOS).
  • A bootable Arch Linux ISO (download from https://archlinux.org).
  • A USB drive (at least 2GB) for creating the installation media.
  • A stable internet connection.
  • Basic familiarity with Linux shell commands.

⚠️ Warning: This guide will involve partitioning your disk, which will erase all existing data on the target drive.


Step 1: Boot into Arch Linux Installation Environment

  1. Create Bootable USB: Use a tool like Rufus (Windows), balenaEtcher, or dd (Linux/macOS):

    sudo dd if=archlinux-x86_64.iso of=/dev/sdX bs=4M status=progress && sync
    
  2. Boot into UEFI Mode:

    • Reboot your system.
    • Enter your firmware/BIOS settings.
    • Enable UEFI mode and disable Legacy Boot (CSM).
    • Boot from the USB in UEFI mode (it should show as UEFI: <USB name>).
  3. When you reach the prompt, you’re in the Arch live environment.


Step 2: Set Keyboard Layout (Optional)

By default, the keyboard is set to US layout. You can list and set layouts as follows:

ls /usr/share/kbd/keymaps/**/*.map.gz
loadkeys de-latin1 # Example: German layout

Step 3: Verify UEFI Boot Mode

To ensure you’ve booted in UEFI mode:

ls /sys/firmware/efi/efivars

If the directory exists and is populated, you’re in UEFI mode.


Step 4: Connect to the Internet

For wired connections, DHCP usually connects automatically.

To check:

ping archlinux.org

For Wi-Fi:

  1. Use iwctl:

    iwctl
    device list
    station wlan0 scan
    station wlan0 get-networks
    station wlan0 connect <SSID>
    exit
    
  2. Verify:

    ping archlinux.org
    

Step 5: Update the System Clock

Arch requires accurate time for some operations:

timedatectl set-ntp true

Verify with:

timedatectl status

Step 6: Partition the Disk

Use fdisk, parted, or cfdisk:

cfdisk /dev/sdX

For UEFI, use GPT partitioning. Here’s a basic layout:

Mount PointPartition TypeSize
/bootEFI System512MB
/Linux filesystemRemaining

Create:

  • A EFI System Partition (ESP) with type EFI System (usually type 1 in cfdisk) and at least 512MB.
  • A root partition with the rest of the space.

Step 7: Format the Partitions

Assuming:

  • /dev/sdX1 = EFI
  • /dev/sdX2 = root

Format them:

mkfs.fat -F32 /dev/sdX1      # EFI
mkfs.ext4 /dev/sdX2          # root

Step 8: Mount the Partitions

mount /dev/sdX2 /mnt
mkdir /mnt/boot
mount /dev/sdX1 /mnt/boot

Step 9: Install Essential Packages

Use the pacstrap script to install the base system:

pacstrap -K /mnt base linux linux-firmware nano vim networkmanager

You can replace nano or vim with your preferred text editor.


Step 10: Generate the Filesystem Table

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

Check it:

cat /mnt/etc/fstab

Step 11: Chroot into the New System

arch-chroot /mnt

You’re now inside your installed system.


Step 12: Set Time Zone and Locale

Time Zone

ln -sf /usr/share/zoneinfo/Region/City /etc/localtime
hwclock --systohc

Example:

ln -sf /usr/share/zoneinfo/Europe/Berlin /etc/localtime

Locale

  1. Edit /etc/locale.gen:

    nano /etc/locale.gen
    

    Uncomment your locale (e.g., en_US.UTF-8 UTF-8).

  2. Generate locale:

    locale-gen
    
  3. Set system-wide locale:

    echo "LANG=en_US.UTF-8" > /etc/locale.conf
    

Step 13: Set Hostname and Hosts File

echo "myarch" > /etc/hostname

Edit /etc/hosts:

127.0.0.1   localhost
::1         localhost
127.0.1.1   myarch.localdomain myarch

Step 14: Set Root Password

passwd

Step 15: Install and Configure Bootloader (systemd-boot)

Since we’re using UEFI, systemd-boot is an easy and robust choice.

  1. Install the bootloader:
bootctl install
  1. Create boot entry:
mkdir -p /boot/loader/entries

Create /boot/loader/entries/arch.conf:

title   Arch Linux
linux   /vmlinuz-linux
initrd  /initramfs-linux.img
options root=PARTUUID=<your-root-partuuid> rw

To get your root partition’s PARTUUID:

blkid /dev/sdX2
  1. Edit loader config /boot/loader/loader.conf:
default arch
timeout 3
editor 0

Step 16: Enable NetworkManager

systemctl enable NetworkManager

Step 17: Exit and Reboot

  1. Exit chroot:
exit
  1. Unmount partitions:
umount -R /mnt
  1. Reboot:
reboot

Don’t forget to remove the USB stick.


Post-Installation Tips

Once you boot into your new Arch Linux installation, here are a few things to consider:

  • Create a non-root user and give it sudo access.

  • Install a desktop environment (gnome, kde, xfce, etc.).

  • Set up firewall with ufw.

  • Keep your system updated using:

    sudo pacman -Syu
    

Conclusion

Installing Arch Linux in UEFI mode provides you with a clean, flexible, and modern system base. While the process can be intimidating at first, it offers unmatched control over every aspect of your OS setup. This guide covered everything from booting the installer to configuring a UEFI-compatible bootloader. With your Arch system ready, you now have a powerful platform to build and learn from.