How to Install Arch Linux

Arch Vimcode

Arch Linux, often a barometer of a user’s skill, is one of the most difficult distros to install while still maintaining a level of practicality. With its extremely well-documented Wiki, excellent package manager, and the frontiersman “build it yourself” allure it brings with it, Arch Linux may very well be worth it for you. If you want to attempt to install Arch Linux, this guide can help you to get started!

What Is Arch Linux?

If you ever wanted to custom-build a distro with components you choose and make it as lightweight as possible without losing the features you love, this distro is the one for you.

It comes with a base installation that comes with the bare basics for it to run. You can install your favorite desktop environment and the applications you need.

Arch Linux is also a rolling release distribution, which means you just need to install it once, and it will always update itself to the latest version.

The only real downside to Arch is how unstable it can be due to the “bleeding edge” nature of its packages. Essentially, when a developer releases a new version of their app, Arch will have it within a few hours. In the case of AUR packages, you might even get an alpha release that is still being tested.

Before We Begin

Before you can install Arch Linux, you need to first download the ISO file and burn it to a USB drive or DVD.

  1. Go to the download page on Arch Linux’s official website and grab the latest image. The fastest way to download it is through the Torrent download option, but you can also scroll down a bit further and click a link from a mirror close to where you live under “HTTP Direct Downloads.”
  2. Use a tool like balenaEtcher to write to a bootable USB thumb drive from the image you downloaded.

Before booting with the drive, make sure you have configured your motherboard to boot from USB. This can be configured from the BIOS screen.

Installing Arch Linux

Insert the USB drive into your PC and boot it up. You will be greeted with a command prompt.

Arch Prompt

1. Configure the Disk

  1. Type the following into your prompt:
fdisk -l

This will show you a list of your drives, partitions inside of them, and the names given to them by Linux. If you have multiple drives, have a look at the size to learn which one you want to install Arch on.

Arch Fdisk

In the case of this image, the installation drive is labeled “/dev/vda,” and it has no partitions yet. The “vda” label only happens when you’re installing in a virtualized environment. When you install any distro of Linux on your hardware, your first drive will be labeled “/dev/sda” – with very few exceptions. To avoid confusion, we’ll use the latter as a convention from now on.

  1. Type the following command to create partitions:
fdisk /dev/sda

Note: if your installation drive isn’t labeled “/dev/sda,” remember to write in the proper name of the drive, or you may risk erasing something you want to keep.

  1. Once you’re in the fdisk utility, type n to create a new partition.
Arch Newpartition
  1. Type p to create a primary partition. It will ask you for a partition number. Don’t worry about that and just press Enter.
  2. We’re making an EFI partition to store your boot record first. To do that, leave the “First sector” part alone and press Enter, then when the disk utility asks you for the last sector, type “+512M” (without the quotes).

This creates a partition that is 512 MB in size and begins on the first available sector.

Arch Efipartition
  1. Type t to change the partition type, then type EF to ensure that your partition is properly recognized as the one that the bootloader will reside in.
  1. Type n again to create a new partition. This time, we are creating a swap partition.

Set it up to be about half the size of the amount of RAM you have installed in your system and set its type code to “82.”

  1. Type n again to create a new partition. This time, we are creating a system partition.

To fill out the rest of your drive with the system partition (i.e., what you want to install Arch Linux on), don’t specify a size for it or use a type code. Fdisk will just allocate the rest of your space for your operating system.

  1. Type w when you’re finished to tell fdisk to write all your changes.

Your disk list (write fdisk -l again to see it) should now look something like this:

Arch Partitionmap

If it doesn’t look like this, just delete the partitions you’ve created by opening your device with fdisk again (fdisk /dev/sda) and using d to delete your partitions one by one. Once you’re done, start this section again and carefully read and follow the instructions.

2. Format the Partitions

Assuming that you made all three partitions suggested here, and your disk is labeled “/dev/sda,” you need to format each to its proper file system.

  1. Your boot partition needs to be formatted to FAT-32:
mkfs.fat -F 32 /dev/sda1
  1. Make sure that the swap partition is properly formatted:
mkswap /dev/sda2
  1. Give your system partition an ext4 file system:
mkfs.ext4 /dev/sda3

Tip: on a regular Linux distribution that is not Arch, you can easily format a partition with GParted that is included in the Installer.

3. Mount the Partitions

Before you can do anything with your partitions, you have to mount them so that Linux can make sense of how to navigate them.

The commands, in the order I am outlining here, will mount your system drive, mount your boot drive into a subfolder you create in your system drive, then activate the swap partition:

mount /dev/sda3 /mnt
mkdir -p /mnt/boot/efi
mount /dev/sda1 /mnt/boot/efi
swapon /dev/sda2

4. Test the Network

Before we get any further into the installation, Arch Linux needs to download the “bootstrapping” applications from the official repositories to make sure all of the packages are up to date. For this, we need to check whether Arch can connect to the Internet:

ping -c 3 archlinux.org
Arch Ping

If you’re not getting a response to your ping, you either have to check your Ethernet cable or aren’t using a wired connection in the first place.

5: (Situational) Connect to Wi-Fi

  1. To connect to a Wi-Fi network, type iwctl. This opens the iNet Wireless Daemon, an extremely simple service that allows you to configure your wireless adapter.
  2. Grab the list of networks with:
station wlan0 get-networks
  1. Once you’ve found the network you want to connect to, complete the connection with:
station wlan0 connect '[network]'

Replace [network] with the network name you’re attempting to connect to. If the network name has a space in it, use single quotes around it or this may not work properly.

  1. When you’re done, type exit

6. Bootstrap Linux and Chroot

Chroot is a command that tells Linux to change the root directory and redirect its running processes. It will detach you from the installation media and start using your newly mounted partitions as a reference point to modify things.

  1. Type the following command to bootstrap Arch:
pacstrap /mnt base-devel linux-firmware linux-lts linux-lts-headers nano sudo

If you know the names of any other applications you’d like to have in your distro to assist you in installing it, append them to the command. We are using nano to edit text and sudo to configure an administrative structure into your Arch installation so that it functions just like any other distro you’re accustomed to.

Note that linux-lts and linux-lts-headers refers to the long-term service (LTS) kernel, which is more stable but not updated as often. If you want a more cutting-edge kernel, install linux and linux-headers. If you’re a gamer, you may want linux-zen and linux-zen-headers, as this modified kernel comes with support for F-sync, which some games take advantage of to provide a more fluid performance. You can also install all three variants if you can’t make up your mind on what you want.

Arch Pacstrap
  1. Generate the file system table:
genfstab -L /mnt >> /mnt/etc/fstab
  1. Chroot into your system:
arch-chroot /mnt

7. Configure Your System

At this point, your system has a kernel, some default system applications, and default configurations for them. To ensure that we get things running properly, we’ll have to change some of these configurations and add a few other applications.

  1. Access your locale generation file:
nano /etc/locale.gen
  1. Remove the comment markers (“#”) in front of the locale you want to use.

If you want American English, for example, you need to remove the hash in front of “en_US.UTF-8”.

  1. Generate the locale and set the language environmental variable:
locale-gen
echo LANG=en_US.UTF-8 > /etc/locale.conf
export LANG=en_US.UTF-8
  1. Create a name for your computer. Replace [hostname] with what you want to call your system:
echo [hostname] > /etc/hostname
  1. Open the hosts file:
nano /etc/hosts

and add the following content:

127.0.0.1		localhost
::1			localhost
127.0.1.1		[hostname]
Arch Hosts
  1. Set the root password for your system:
passwd
  1. Add a user for yourself with the “wheel” group so that you can use sudo:
useradd -G wheel -m [username]
  1. Set the user’s password:
passwd [username]
  1. Open your sudo configuration with nano:
EDITOR=nano visudo

Remove the hash (“#”) symbol from the area that contains the content:

%wheel ALL=(ALL:ALL) ALL
Arch Wheel
  1. Grab the GRUB bootloader and EFI Boot Manager packages:
pacman -S grub efibootmgr
  1. Install and configure GRUB:
grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi
grub-mkconfig -o /boot/grub/grub.cfg
  1. In some very rare instances, the init system that loads Arch doesn’t fully work. To prevent you from getting an “/sbin/init does not exist” error on your system when you try to boot it, we are just reinstalling sysvcompat if it’s already installed.
pacman -S systemd-sysvcompat
  1. Add and enable a networking service:
pacman -S networkmanager
systemctl enable NetworkManager.service

This makes it possible for you to access the Internet after you finish the installation.

  1. Set your timezone. You will need to know the Region-City combination your time zone specifically belongs to:
ln -sf /usr/share/zoneinfo/Region/City /etc/localtime

If you live in Bucharest, for example, the command would be:

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

If you’re unsure of your time zone, use:

ls /usr/share/zoneinfo

to list time zone regions, rhen use the ls command again within the full path of the region folder (e.g., /usr/share/zoneinfo/America) to see a list of available cities.

Arch Zoneinfo

You have finished installing the base of Arch Linux! Boot into your newly-installed system:

exit
reboot

Getting Started With Arch

When you enter your system for the first time, you’ll be greeted by a terminal login prompt. This may look underwhelming, but we’re about to make this into a full-fledged desktop environment. You may want to learn more about Pacman before you continue.

We are starting by setting NTP up so that the clock has a way to synchronize over the network:

sudo timedatectl set-ntp true

1. Spice Up Pacman

Arch Pacmanlook

Since we’re about to download a lot of stuff, let’s streamline the process by configuring your package manager to allow for concurrent downloads.

  1. Edit your pacman configuration:
sudo nano /etc/pacman.conf
  1. Remove the hash symbol in front of “ParallelDownloads.”

By default, this configuration lets you have five concurrent downloads at the same time. This is usually enough, unless you’re downloading thousands of packages through a multi-gigabit connection.

2. Get a Desktop Running

  1. Install a graphical server. We are using X11 to make things simple, as Wayland still has some compatibility issues with systems running Nvidia cards.
sudo pacman -S xorg
  1. Install a desktop environment. There are plenty of desktop environments available, and you can install your preferred one here. Some of the common ones are GNOME (gnome), KDE Plasma (plasma-meta and kde-applications-meta), and Cinnamon (install cinnamon, xed, xviewer, xreader, and pix). If you use Intel graphics hardware, remove xf64-video-intel to avoid random freezing events), XFCE (xfce4), etc.
  1. Install the display manager.

Note: Arch Linux’s packages for the KDE desktop environment already come with its own “sddm” display manager, so you don’t have to install it.

sudo pacman -S gdm
Arch Loginscreen

Of course, it goes without saying that If there’s another display manager you personally favor, feel free to install that instead.

Enable gdm:

systemctl enable gdm

Once you reboot your system, you should be greeted by a full-fledged graphical login screen that will take you to your desktop!

Good to know: if this tutorial looks complicated to you, then you should check out these Arch-based Linux distributions that are easy to install and use.

Frequently Asked Questions

Can I use window managers instead of desktop environments?

Yes, it is up to you to decide if you want a desktop environment or window manager. That is the beauty of Arch Linux. The Arch Wiki lists a variety of window managers, including famous ones, like i3, bspwm, dwm, awesome, spectrum, Qtile, and xmonad.

I rebooted after installing Arch, but my Wi-Fi stopped working! What can I do?

Wi-Fi doesn’t necessarily “stick” across reboots unless something is controlling the network manager service for you. Since you rebooted to a TTY prompt instead of a full desktop environment, you’re going to have to take manual control of your networking service. You may have also noticed that iwctl is not available, but that’s fine, as you’ll now be using nmcli instead to connect to a Wi-Fi network. Use nmcli device wifi connect password '[your password]' name '[network name]', and in one single line, you’ll get yourself back online!

Pacman doesn't have the app I want. Are there other repositories?

The first and most common repository for finding stuff you may not find in the official Arch Linux repository is the AUR. Once you get your hands on a helper application, you’ll be able to browse the AUR with just as much ease as the official repository!

Subscribe to our newsletter!

Our latest tutorials delivered straight to your inbox

Miguel Leiva-Gomez
Miguel Leiva-Gomez - Staff Writer

Miguel has been a business growth and technology expert for more than a decade and has written software for even longer. From his little castle in Romania, he presents cold and analytical perspectives to things that affect the tech world.