Mastering Arch Installation: A Step-by-Step Guide to Building Your Own Customized Linux Environment
Forget the easy desktop installers—this guide walks you through the detailed manual process of Arch installation, showing you how embracing complexity leads to a leaner, faster, and more secure Linux setup that reflects your true needs.
Why Install Arch Linux from Scratch?
Installing Arch Linux manually might feel like a daunting task compared to clicking through Ubuntu or Fedora’s graphical installers. But the beauty of Arch lies exactly in this challenge. By installing Arch yourself, you learn how every piece of your system works, make deliberate choices about what’s included, and end up with a minimalist system tailored perfectly to your workflow.
Whether you want to build a lightweight workstation, a reliable server, or a secure workstation, this hands-on approach empowers you with technical mastery and total control.
Prerequisites
Before we dive in, here’s what you’ll need:
- A computer or virtual machine to install Arch on.
- A reliable internet connection.
- A USB drive (at least 2GB) to create the bootable Arch Linux installation media.
- Basic familiarity with command-line interfaces.
Step 1: Prepare the Bootable USB Drive
-
Download the latest Arch Linux ISO from archlinux.org.
-
Use a tool like
dd
(Linux/macOS) or Rufus (Windows) to write the ISO to your USB stick. For example, on Linux:sudo dd bs=4M if=archlinux-YYYY.MM.DD-x86_64.iso of=/dev/sdX status=progress oflag=sync
Replace
/dev/sdX
with your USB device.
Step 2: Boot and Set Up Network
- Boot from the USB, select the Arch Linux installation option.
- Once at the prompt, verify internet connectivity.
If you are on Ethernet:
ping -c 3 archlinux.org
If on Wi-Fi, use:
iwctl
# Inside iwctl prompt:
device list
station wlan0 connect your_SSID
exit
ping -c 3 archlinux.org
Step 3: Update System Clock
Synchronize your system clock:
timedatectl set-ntp true
Step 4: Partition the Disk
Use fdisk
or cfdisk
. Here’s an example using fdisk
on /dev/sda
:
fdisk /dev/sda
Create these partitions:
- EFI system partition (~300 MB, type EFI if using UEFI)
- Root partition (remaining space)
- Optional: swap partition
Example commands inside fdisk
:
g
to create a new GPT partition tablen
to create new partitionst
to set the EFI type (for first partition, code1
)w
to write changes
Step 5: Format Partitions
For EFI partition (assuming /dev/sda1
):
mkfs.fat -F32 /dev/sda1
For root partition (assuming /dev/sda2
):
mkfs.ext4 /dev/sda2
If you created swap (e.g., /dev/sda3
):
mkswap /dev/sda3
swapon /dev/sda3
Step 6: Mount the Filesystems
mount /dev/sda2 /mnt
mkdir /mnt/boot
mount /dev/sda1 /mnt/boot
Step 7: Install the Base System
Use the pacstrap
script to install the Linux kernel, base system, and filesystem utilities:
pacstrap /mnt base linux linux-firmware vim nano
Step 8: Generate fstab File
Create an fstab file to define how disk partitions should be mounted:
genfstab -U /mnt >> /mnt/etc/fstab
Step 9: Change Root into the New System
arch-chroot /mnt
Step 10: Set Timezone
For example, if you are in New York:
ln -sf /usr/share/zoneinfo/America/New_York /etc/localtime
hwclock --systohc
Step 11: Localization
Edit /etc/locale.gen
with your favorite editor and uncomment:
en_US.UTF-8 UTF-8
Generate locales:
locale-gen
Set locale variables in /etc/locale.conf
:
echo "LANG=en_US.UTF-8" > /etc/locale.conf
Step 12: Set Hostname
echo "myarch" > /etc/hostname
Add matching entries in /etc/hosts
:
127.0.0.1 localhost
::1 localhost
127.0.1.1 myarch.localdomain myarch
Step 13: Configure Network
Install network utilities, for example, networkmanager
:
pacman -S networkmanager
systemctl enable NetworkManager
Step 14: Set Root Password
passwd
Enter the new password when prompted.
Step 15: Install and Configure Bootloader
For UEFI systems, install grub
and efibootmgr
:
pacman -S grub efibootmgr
grub-install --target=x86_64-efi --efi-directory=/boot --bootloader-id=GRUB
grub-mkconfig -o /boot/grub/grub.cfg
Step 16: Exit Chroot, Unmount, and Reboot
exit
umount -R /mnt
reboot
Remove the USB stick after BIOS splash screen.
After Reboot: Post-Installation Steps
-
Create a new user with sudo privileges.
useradd -mG wheel username passwd username pacman -S sudo EDITOR=vim visudo
Uncomment the line:
%wheel ALL=(ALL) ALL
-
Install your choice of desktop environment or window manager.
-
Customize your system fully knowing you built each piece yourself.
Final Thoughts
Building Arch Linux from scratch challenges you to understand the internals of your operating system. This mastery allows you to maintain a system that's not just functional, but finely tuned to your own needs. While the installation process requires patience and attention to detail, the end result is a rewarding learning experience and a customized, lean, and secure Linux environment.
If you run into trouble, the Arch Wiki is an invaluable and comprehensive resource that will guide you further.
Happy hacking!