Welcome to my step-by-step Arch Linux installation guide! This HTML/CSS guide will help you install Arch Linux on a x86_64 (BIOS or UEFI) device, one step at a time. You can use this guide to install the distro on a physical device or in a virtual machine (QEMU/KVM, VMware, VirtualBox). Pay attention to the VM-specific instructions if you are installing Arch Linux in a VM.
NOTE: This guide is heavily based on the Arch Linux Installation Tutorial made by ChenNux, which is itself based on the Arch Linux Installation Guide written by Frédéric Béziès. ChenNux's Tutorial is available in French on GitHub at the following address: https://github.com/Chennux/arch-tuto-installation. The first version of my own tutorial, which was published to this website, was mainly a simple translation of ChenNux's Tutorial with some added small elements. This new version is a bit more personalized to my own preferences, but it still takes a large amount of ChenNux's work, so if you understand French I recommend you to go check out her own tutorial by clicking on the GitHub link just above.
Without further a-do, let's dive into the installation process!
To install Arch linux, you need, of course, an Internet connection. If you are connected through Ethernet, the network connection should already be functional once the installation media is booted. If you connect through Wi-Fi, you need to interact with the iwctl tool.
First, launch the appropriate tool:
iwctl
Then, connect to your network using its SSID, for example Fizz975 (to be replaced with your actual SSID):
station wlan0 connect Fizz975
You will be asked for the security key, just enter it and then exit.
exit
Once connected, do a short ping test to a website of your choice to test the connection:
ping -c 4 www.e621.net
If the ping test fails, relaunch the iwctl tool and make sure you entered the correct SSID and password by retrying the connection process.
Once the network in working state, we move on to the preparation of our disk, which includes partitioning, formatting and mounting.
First of all, identify the correct drive using fdisk:
fdisk -l
If you are using a SATA SSD or HDD, the identifier will be of the form /dev/sdX; if you are using a NVMe SSD, the identifier will be of the form /dev/nvmeXn1; and if you are making the installation in a VM, for example in a QEMU/KVM virtual machine, the identifier should be of the form /dev/vdX.
Launch fdisk once again, this time with the drive you are installing Arch Linux on, for example /dev/nvme0n1:
fdisk /dev/nvme0n1
Create the new MBR partition table:
o
And write the changes to the disk.
w
The fdisk tool will exit after writing the changes.
Now, it is time to create the partitions on the disk. Launch cfdisk on the drive:
cfdisk /dev/nvme0n1
For a BIOS (MBR) installation, you only need 2 partitions. The following table tells you which partitions to create.
| Identifier | Mountpoint | Size | Filesystem | Boot | Reference |
|---|---|---|---|---|---|
| /dev/nvme0n1p1 | / and /home | (Rest of the drive) | BTRFS | * | 83 |
| /dev/nvme0n1p2 | Swap | (RAM size + 1 GB) | Swap | 82 |
The next step is formatting the partitions. Start with the swap partition:
mkswap /dev/nvme0n1p2
Then, the root partition.
mkfs.btrfs -f /dev/nvme0n1p1
To mount the filesystems on a BIOS system, start with the swap partition:
swapon /dev/nvme0n1p2
Then, temporarily mount the root partition:
mount /dev/nvme0n1p1 /mnt
Create the two BTRFS subvolumes that you need:
btrfs subvolume create /mnt/@ /mnt/@home
Then, unmount the partition:
umount /mnt
Mount the root subvolume:
mount -o compress=zstd:5,subvol=@ /dev/nvme0n1p1 /mnt
Create the missing mountpoint for the home subvolume:
mkdir /mnt/home
And finally, mount the home subvolume:
mount -o compress=zstd:5,subvol=@home /dev/nvme0n1p1 /mnt/home
Once the partitions mounted, check the mountpoints to make sure everything is mounted properly.
lsblk
Launch fdisk once again, this time with the drive you are installing Arch Linux on, for example /dev/nvme0n1:
fdisk /dev/nvme0n1
Create the new GPT partition table:
g
And write the changes to the disk.
w
The fdisk tool will exit after writing the changes.
Now, it is time to create the partitions on the disk. Launch cgdisk on the drive:
cgdisk /dev/nvme0n1
For an UEFI (GPT) installation, you need 3 partitions. The following table tells you which partitions to create.
| Identifier | Mountpoint | Size | Filesystem | Reference | Label |
|---|---|---|---|---|---|
| /dev/nvme0n1p1 | /boot/efi | 1 GB | FAT16 | EF00 | ESP |
| /dev/nvme0n1p2 | Swap | (RAM size + 1 GB) | Swap | 8200 | SWAP |
| /dev/nvme0n1p3 | / and /home | (Rest of the drive) | BTRFS | 8300 | ARCH |
The next step is formatting the partitions. Start with the EFI System Partition:
mkfs.fat -F16 /dev/nvme0n1p1
Then, the swap partition:
mkswap /dev/nvme0n1p2
And finally, the root partition.
mkfs.btrfs -f /dev/nvme0n1p3
To mount the filesystems on an UEFI system, start with the swap partition:
swapon /dev/nvme0n1p2
Then, temporarily mount the root partition:
mount /dev/nvme0n1p3 /mnt
Create the two BTRFS subvolumes that you need:
btrfs subvolume create /mnt/@ /mnt/@home
Then, unmount the partition:
umount /mnt
Mount the root subvolume:
mount -o compress=zstd:5,subvol=@ /dev/nvme0n1p3 /mnt
Create the missing mountpoints:
mkdir /mnt/{boot,boot/efi,home}
Now, mount the home subvolume:
mount -o compress=zstd:5,subvol=@home /dev/nvme0n1p3 /mnt/home
Let's finish this step by mounting the EFI System Partition:
mount /dev/nvme0n1p1 /mnt/boot/efi
Once the partitions mounted, check the mountpoints to make sure everything is mounted properly.
lsblk
It is now time to actually start installing our new system.
If you want to use the closest, fastest and most fresh mirrors, use Reflector:
reflector -c US,CA -p https -a 12 --sort rate --save /etc/pacman.d/mirrorlist
The command above will select mirrors from the US and Canada, which are secure HTTP mirrors updated in the last 12 hours, sorted by speed.
pacstrap command. The first command:pacstrap /mnt base linux linux-{headers,firmware} base-devel pacman-contrib man-{db,pages} texinfo btrfs-progs fish starship intel-ucode sof-firmware
NOTE: If you have an AMD CPU, replace the intel-ucode package with the amd-ucode package. Also, if you prefer the LTS kernel, replace the two packages linux linux-headers with linux-lts linux-lts-headers.
Now, the second command:
pacstrap /mnt zip unzip 7zip unrar vim mc alsa-utils mtools dosfstools lsb-release xfsprogs ntfs-3g exfatprogs bash-completion usbutils wireplumber pipewire{,-pulse}
Now, let's generate the fstab file, which lists the partitions:
genfstab -U /mnt > /mnt/etc/fstab
And finally, enter the new system:
arch-chroot /mnt
In this step, we are doing some basic system configuration.
First, create the /etc/vconsole.conf file, which needs two lines (the keymap and the console font):
KEYMAP=us
FONT=eurlatgr
Then, create the /etc/locale.conf file, which also needs two lines (the locale and the case sorting option)
LANG=en_US.UTF-8
LC_COLLATE=C
Now, in the /etc/locale.gen file, uncomment the two lines that match your locale.
Then, generate the locales:
locale-gen
And finally, set the locale for the current session:
export LANG=en_US.UTF-8
Set the hostname, for example Furbox:
echo 'Furbox' > /etc/hostname
Now, set your timezone (find it by browsing the /usr/share/zoneinfo folder):
ln -sf /usr/share/zoneinfo/US/Eastern /etc/localtime
Finally, adjust the system clock to local time.
hwclock --systohc --local
Edit the /etc/mkinitcpio.conf file. On the HOOKS line, add resume between the block and filesystems hooks. Then, uncomment the type of compression you want to use for the initramfs. If you don't know what to choose, set COMPRESSION=zstd. And finally, add btrfs to the MODULES() line, and save the file then exit Vim.
It is now time to regenerate the initramfs with the newly set parameters:
mkinitcpio -P
We are now at the step of installing the GRUB bootloader. Follow the appropriate subsection depending on your type of installation.
First, install the required packages:
pacman -Syy grub grub-btrfs
Then, install the bootloader to the MBR:
grub-install --target=i386-pc --bootloader-id=Arch --recheck /dev/nvme0n1
First, install the required packages:
pacman -Syy grub grub-btrfs efivar efibootmgr
Then, mount the EFI Variables:
mount | grep efivars &> /dev/null || mount -t efivarfs efivarfs /sys/firmware/efi/efivars
And finally, install GRUB to the EFI system partition.
grub-install --target=x86_64-efi --efi-directory=/boot/efi --bootloader-id=Arch --recheck
If you are installing Arch linux in a VM, it is recommended to run the following double command to avoid eventual boot issues (you do not need this command on a physical system):
mkdir -p /boot/efi/EFI/boot && cp /boot/efi/EFI/Arch/grubx64.efi /boot/efi/EFI/boot/bootx64.efi
Now, let's configure GRUB. Edit its configuration file, which is /etc/default/grub.
Add, to the GRUB_CMDLINE_LINUX_DEFAULT line, one parameters, which is resume=/dev/nvme0n1p2. Then, remove the quiet parameter, before saving the file and quitting Vim.
Finally, generate the GRUB configuration.
grub-mkconfig -o /boot/grub/grub.cfg
Before rebooting, we have a few small steps left to do.
Set the root password.
passwd
First, install NetworkManager and BlueZ:
pacman -S networkmanager bluez
Then, enable the NetworkManager service:
systemctl enable NetworkManager
And the Bluetooth service.
systemctl enable bluetooth
Let's make Pacman better. With Vim, edit the /etc/pacman.conf file.
Set the following options:
Color
CheckSpace
VerbosePkgLists
ParallelDownloads = 5
ILoveCandy
Then, enable the 32-bit repository by uncommenting it:
#[multilib]
#Include = /etc/pacman.d/mirrorlist
Once you are done, save the file and exit Vim.
It is now time for the first boot. Exit the chroot:
exit
Then, unmount the partitions:
umount -R /mnt
Finally, reboot to the new system.
systemctl reboot
NOTE: You can remove the installation media now, it is not needed anymore.
We are now moving up to the installation and configuration of some multimedia components.
To configure the default sound volume, launch the mixer:
alsamixer
Select your sound card with F6, and set the volume. Then, exit and save the setting:
alsactl store
Now, let's install the main multimedia codecs:
pacman -S gst-plugins-{base,good,bad,ugly} gst-libav
Moving on to the installation of Xorg and its apps:
pacman -S xorg-{server,xinit,apps} xdg-userdirs xscreensaver
Once Xorg installed, we are going to install some fonts:
pacman -S ttf-{meslo-nerd,fira-code,bitstream-vera,liberation,dejavu,carlito,caladea} gnu-free-fonts freetype2 noto-fonts{,-extra,-cjk,-emoji}
Now, we are installing the printing services and a bunch of printer drivers:
pacman -S cups foomatic-db{,-ppds,-gutenprint-ppds,-nonfree,-nonfree-ppds} gutenprint
We are almost done with our installation. Before creating your personal user account, let's install some additional everyday applications:
Here is the command to install useful apps:
pacman -S firefox{,ublock-origin} thunderbird libreoffice-fresh hunspell-en_us gimp gimp-help-en btop hyfetch python-pipx git
First, create the account:
useradd -m -G users,wheel,audio,video -c 'Full name' -s /bin/fish username
Then, set its password:
passwd username
Now, launch visudo with Vim:
EDITOR="vim" visudo
Add your new user account with all priviles under root in the "User privileges" section of the file:
root ALL=(ALL:ALL) ALL
afox ALL=(ALL:ALL) ALL
Save the file and exit Vim. Then, log off the root account:
exit
And login using your own account.
Installing Paru will allow you to install packages from the AUR like you would install an Arch Linux packages using Pacman. First, clone the repository:
git clone https://sur.archlinux.org/paru
Then, navigate to the cloned folder:
cd paru
And finally, build the package.
makepkg -si
Let's now enable some systemd services. Change to the root account:
sudo -i
Then, enable the required services:
systemctl enable avahi-{daemon,dnsconfd}
systemctl enable cups
timedatectl set-ntp true
systemctl enable fstrim.timer
exit
Now, let's enable the sound server:
systemctl --user enable --now wireplumber
systemctl --user enable --now pipewire
systemctl --user enable --now pipewire-pulse
Once all of the required services are installed, we are proceeding with the final step of the installation.
We are now at the last step of the installation, installing and launching the desktop environment. Follow the steps according to the DE you want to install.
First, install the required packages:
sudo pacman -S plasma kde-applications konsole kate dolphin krita ark okular kcalc kvantum
Then, launch the display manager:
sudo systemctl start sddm
If everything goes well, you can enable SDDM on boot:
sudo systemctl enable sddm
And this completes our installation.
First, install the required packages:
sudo pacman -S gnome gnome-extra nautilus evince gedit gnome-terminal file-roller gnome-calculator kvantum
Then, launch the display manager:
sudo systemctl start gdm
If everything goes well, you can enable GDM on boot:
sudo systemctl enable gdm
And this completes our installation.
First, install the required packages:
sudo pacman -S xfce4 thunar evince mousepad xfce4-terminal file-roller galculator kvantum lightdm-gtk-greeter{,-settings}
Then, launch the display manager:
sudo systemctl start lightdm
If everything goes well, you can enable LightDM on boot:
sudo systemctl enable lightdm
And this completes our installation.
First, install the required packages:
sudo pacman -S cinnamon gnome-extra nemo evince gedit gnome-terminal file-roller gnome-calculator kvantum lightdm-gtk-greeter{,-settings}
Then, launch the display manager:
If everything goes well, you can enable LightDM on boot:
sudo systemctl enable lightdm
And this completes our installation.
First, install the required packages:
sudo pacman -S mate caja evince gedit mate-terminal engrampa mate-calc kvantum lightdm-gtk-greeter{,-settings}
Then, launch the display manager:
If everything goes well, you can enable LightDM on boot:
sudo systemctl enable lightdm
And this completes our installation.
First, install the required packages:
paru -S lxqt breeze-icons sddm xfwm4 libstatgrab lm_sensors pulseaudio-alsa featherpad okular nm-tray system-config-printer skanlite
Then, launch the display manager:
sudo systemctl start sddm
If everything goes well, you can enable SDDM on boot:
sudo systemctl enable sddm
And this completes our installation. NOTE: Once LXQt launched, go into its window manager settings and switch the openbox window manager for the XFWM4 window manager. This will allow you to theme uniformly both GTK and Qt applications, given you are using a theme which supports both frameworks.