Reading Time: 10 minutes

What is Arch Linux?

Arch Linux is a Linux distribution designed for computers with x86-64 processors. It was created by Judd Vinet in 2002. The main idea behind this distribution is speed, flexibility, and simplicity. Arch Linux focuses on centralized configuration, similar to Gentoo Linux. Let's take a deep dive into these details with this Arch Linux installation guide intended or Linux enthusiasts.

Arch Linux follows the rolling-release model system, meaning that the packages are available for a brief time after they are released. The pacman package manager is the most important feature that distinguishes Arch Linux. It offers management for packages in its repository as well as users’ own builds.

The goal of Arch Linux is to keep configuration simple. While simplicity is the philosophy, the configuration process is not for beginners. Fortunately, you have this Arch Linux installation guide. It also includes some optional configurations from which to start.

You may install Arch Linux on your system by following the detailed step-by-step guidance below. Remember to personalize your Arch Linux environment by choosing the desktop environment, configuring system themes, and installing additional software according to your preferences.

How to Install Arch Linux

In this Arch Linux installation guide, you will see how to install Arch Linux. The installation can present a challenge for beginners and some Linux enthusiasts, but following these detailed steps will make things easier.

Step 1 — Download & Boot Arch Linux

1a. Download the Arch Linux .iso file from archlinux.org.

1b. There are several tools to create a live USB. The following is a list of viable tools, though others exist:

  • Rufus
  • Etcher
  • LinuxLive USB Creator
  • UNetbootin

1c. Insert the USB drive you selected and boot your system from the installed media. Once the system boots, a terminal prompt will appear.

Step 2 — Prepare the Installation

2a. In the terminal prompt that appears, set your keyboard layout. In the example below, US stands for the United States keyboard layout:

localectl list-keymaps | grep US

Output:

US
US-acentos
US-acentos.deadkeys
US-acentos_nodeadkeys
US-alt-intl
US-altgr-intl
US-apl
US-apl.nodeadkeys

2b. Set your keyboard layout:

loadkeys US

Output: (There will be no output if successful.)

2c. If you have a Wi-Fi adapter, enable it with the following command:

iwctl

Output:

[iwd]#

2d. You can find the name of your network adapter using the device list command:

device list

Output:

wlan0

2e. The following command allows you to scan for Wi-Fi networks. Replace name_of_your_wifi_adapter with your device’s name:

station name_of_your_wifi_adapter scan

2f. Use the following command to see the list of available networks. Again, replace name_of_your_wifi_adapter with your device’s name:

station name_of_your_wifi_adapter get-networks 

2g. Connect to your network. Replace name_of_your_wifi_adapter with your device name and name_of_your_network with your network name:

station name_of_your_wifi_adapter connect name_of_your_network

2h. In order to go back to the Arch root .iso, type the exit command:

exit

2i. Now that you have an internet connection, you can synchronize the Network Time Protocol (NTP) with the following command:

timedatectl set-ntp true

2j. Packages must be installed from a list of Arch Linux servers called the official Arch Linux mirror servers. Use the following command to set the fastest mirror list available for you:

reflector -c 'United States' -a 12 - -sort rate - -save etc/pacman.d/mirrorlist

Here are those command options shown above defined:

  • The -c stands for country. If your country has a two-word name, you have to put them through single quotes, as the United States is in our example above.
  • The -a stands for the age of the servers. In our example, 12 denotes servers that have been updated in the last 12 hours.
  • The --sort portion is to sort the servers by speed.
  • The --save will let you save this information under etc/pacman.d/mirrorlist.

Output:

[INFO] Writing mirrorlist to 'etc/pacman.d/mirrorlist'

2k. Synchronize your mirror servers with the following command:

sudo pacman -Syy

Output:

:: Synchronizing package databases...
core                  [###################] 100%
extra                [###################] 100%
community             [###################] 100%
multilib              [###################] 100%

2l. Use the lsblk command to list your disks so you can partition them and install Arch Linux:

lsblk

Output:

NAME   MAJ:MIN RM   SIZE RO TYPE MOUNTPOINT
sda      8:0    0 931.5G  0 disk
├─sda1   8:1    0   512M  0 part /boot/efi
├─sda2   8:2    0  48.8G  0 part /
└─sda3   8:3    0 882.2G  0 part /home

Step 3 — Partition the Disk (UEFI Systems Only)

Note:
You can skip this step if you have a master boot record (MBR) system.

In this step, you will create two partitions that are mandatory, the Extensible Firmware Interface (EFI) partition and root partition. The home partition is optional.

Even though the Unified Extensible Firmware Interface (UEFI) system supports both Master Boot Record (MBR) and GUID Partition Table (GPT) standards, you will partition the disk with the GPT label using gdiskbecause of the MBR partition’s limitations in size and number of the partitions.

3a. To create partitions on a UEFI system, use the gdisk command. Run the following command to start gdisk and select your disk:

gdisk /dev/sdX

3b. Replace /dev/sdX with the appropriate device identifier for your disk (for example, /dev/sda).

Output:

GPT fdisk (gdisk) version 1.0.5
Partition table scan:
MBR: not present
BSD: not present
APM: not present
GPT: not present
Creating new GPT entries in memory.

3c. Create a new partition table by entering the command o and pressing the Enter key.

Output:

Command (? for help): o

This option deletes all partitions and creates a new protective MBR.
Proceed? (Y/N): Y 

3d. Create the EFI (Extensible Firmware Interface) System Partition (ESP) by entering the command n to create a new entry, selecting the default partition number, and specifying the size (for example, +512M for 512 megabytes), such as:

 +512M

Output:

Command (? for help): n
Partition number (1-128, default 1):
First sector (34-20971486, default = 2048) or {+-}size{KMGTP}:
Last sector (2048-20971486, default = 20971486) or {+-}size{KMGTP}: +512M

3e, Set the partition type to EFI System by entering the command t, selecting the partition number (for example, 1), and choosing the ef00 code.

Output:

Command (? for help): t
Partition number (1-128): 1
Hex code or GUID (L to show codes, Enter = 8300): ef00

This will be an EFI partition. The code for the EFI system partition is ef00.

3f. Create the root partition by entering the command n for a new partition, selecting the default partition number (for example, 2), and pressing Enter to use the remaining disk space.

Output:

Command (? for help): n
Partition number (2-128, default 2):
First sector (34-20971486, default = 1050624) or {+-}size{KMGTP}:
Last sector (1050624-20971486, default = 20971486) or {+-}size{KMGTP}:

3g. Write the changes to the disk by entering the command w and confirming.

Output:

Command (? for help): w

Final checks complete. About to write GPT data. THIS WILL OVERWRITE EXISTING
PARTITIONS!!

Do you want to proceed? (Y/N): Y

Step 4 — Partition the Disk (MBR Systems Only)

Note:
You can skip this step if you have a UEFI system.

Master Boot Record (MBR) systems requires a Disk Operating System (DOS) disk label.

In order to create partitions on an MBR system, use the fdisk command.

4a. Run the following command to start fdisk and select your disk:

fdisk /dev/sdX

Output:

Welcome to fdisk (util-linux 2.35.2).
Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device /dev/sda doesn't contain a valid partition table.
Created a new DOS disklabel with disk identifier 0x9ac4eb15.

4b. Replace /dev/sdX with the appropriate device identifier for your disk (for example, /dev/sda).

4c. Create a new partition table by entering the command o and pressing the Enter key.

Output:

Command (m for help): o
Created a new DOS disklabel with disk identifier 0x9ac4eb15.

4d. Create the root partition by entering the command n, selecting the primary partition type, and pressing the Enter key to use the default partition number and size.

Output:

Command (m for help): n
Partition type
   p   primary (0 primary, 0 extended, 4 free)
   e   extended (container for logical partitions)
Select (default p):

4e. Write the changes to the disk by entering the command w and confirming.

Output:

Command (m for help): w
The partition table has been altered.
Calling ioctl() to re-read partition table.
Syncing disks.

Once the operation has been completed successfully, you will format the partitions. See Step 5.

Step 5 — Install the Base Packages (UEFI and MBR Systems)

Installing base packages is crucial in order to have a running system. Some of the base packages that we will install are:

  • Base
  • Linux firmware, which will provide additional firmware for the system
  • Linux kernel
  • Intel-ucod (for Intel processors)
  • Amd-ucod (for AMD processors)
  • Vim or nano (orpackages for the text editor that you prefer)

5a. First, we must format the EFI System Partition (UEFI systems only) and the root partition. The EFI partition must be a File Allocation Table (FAT) system type. — you will specifically create a fat32 file system and the device name. Use the following commands:

mkfs.fat -F32 /dev/sdX1       # Format the EFI System Partition
mkfs.ext4 /dev/sdX2           # Format the root partition

Output (UEFI systems):

mkfs.fat 4.1 

Output (MBR systems):

mke2fs 1.46.3

Replace /dev/sdX1 and /dev/sdX2 with the appropriate device identifiers for your partitions.

5b. Mount the root partition by running the command:

mount /dev/sdX2 /mnt

Output: (There will be no output if successful.)

5c. If you are using UEFI system, create the EFI directory and mount the EFI system partition:

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

Output: (There will be no output if successful.)

5d. Install the base packages in the mount directory by running the following command:

pacstrap /mnt base linux linux-firmware

Output:

==> Installing packages to /mnt

Step 6 — Start the Arch Linux Installation

Thus far, the this Arch Linux installation guide presented the preparation steps in for performing an installation. The next steps will pertain to the actual installation itself. Generate the file system table, which is where the file mount points are stored. Every time the device boots up, it will check this file to see what should be mounted.

6a. Generate an fstab file to define how disk partitions should be mounted:

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

Output: (There will be no output if successful.)

6b. Change the root into the new system:

arch-chroot /mnt

Output: (There will be no output if successful.)

6c. Set the system's time zone by running:

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

Replace Region with your region and City with your city.

You can look up the configuration for your location using the following command. Replace your_city_namewith the city your system is located.

timedatectl list-timezones | grep your_city_name

Output: (There will be no output if successful.)

6d. Synchronize the system and hardware clock. Generate the /etc/adjtime file:

hwclock --systohc

Output: (There will be no output if successful.)

6e. Configure the locale.gen file, which contains the locales for the system. For this tutorial, we are using the vim text editor.

6f. Edit the /etc/locale.gen file and uncomment the desired locale. Scroll down in order to find the locale you want to use and remove the # from the start of the line containing the language you prefer. Save the file and exit vim using the :wq! command:

vim /etc/locale.gen

6g. Generate the locale settings:

locale-gen

Output:

Generating locales...
  en_US.UTF-8... done
  en_US.ISO-8859-1... done

6h. Create the locale.conf file.

vim etc/locale.conf

6i. Enter your preferred locale. For the United States, enter the following:

LANG=en_US.UTF-8

6j. Save the file and exit vim using the :wq! command.

6k. Set the system's hostname by editing the /etc/hostname file.

6l. Thehostnameportion will be your device’s hostname:

vim /etc/hostname

6m. Edit and set the /etc/hosts file:

vim /etc/hosts

6n. Add the following lines:

127.0.0.1	localhost
::1		localhost
127.0.1.1	myhostname.localdomain	myhostname

6o. Replace myhostname with your desired hostname.

6p. Set a password for the root user using the passwd command.

Step 7 — Install Additional Packages

Install additional packages like a desktop environment, display manager, or any other desired software. The default package manager in Arch Linux is pacman. With great reviews in all Arch Linux installation guides you find, pacman runs perfectly with the Arch Build System (ABS). In order to install a package using pacman, you have to use the -S option.

7a. Install packages as needed using pacman:

sudo pacman -S package_name

Output:

resolving dependencies...
looking for conflicting packages...

Packages (1) package_name-1.0.0

Total Download Size: XX MB
Total Installed Size: XX MB

:: Proceed with installation? [Y/n]

7b. Replace package_name with the package you wish to install,

7c. Install additional packages using pacman:

pacman -S networkmanager network-manager-applet grub mtools dosfstools git linux-headers
bluez-utils bluez pulseaudio reflector xdg-utils xdg-user-dirs cups

 The Arch Linux website provides a list of all available packages.

7d. Install the grub bootloader (on UEFI systems only):

grub-install -target=x86_64-efi -efi-directory=/boot/efi -bootloader-id=GRUB

7e. A configuration file for grub needs to be generated.

grub-mkconfig -o /boot/grub/grub.cfg

7f. Install the grub bootloader (on MBR systems only):

grub-install -target=i386-pc /dev/dsk

7g. A configuration file for grub needs to be generated:

grub-mkconfig -o /boot/grub/grub.cfg

7h. Make sure that the network manager is enabled so you can configure the Wi-Fi:

systemctl enable NetworkManager

Step 8 — Create an Arch Linux User & Set a Password

8a. Create a new user account by issuing the following command:

useradd -m -G wheel username

Replace username with your desired username.

Output: (There will be no output if successful.)

8b. Set a password for the user:

passwd username

Replace username with the username you created.

Output:

Enter new UNIX password:
Retype new UNIX password:
passwd: password updated successfully

8c. Grant administrative privileges to the user by editing the /etc/sudoers file:

visudo

Output:

The visudo command will open the file in a text editor. Make the necessary changes and save the file to grant administrative privileges to the user.

Uncomment the line %wheel ALL=(ALL) ALL by removing the # character.

Step 9 — Complete the Arch Linux Installation

Those were all the basic steps of how to install Arch Linux. We hope you found this Arch Linux installation guide helpful.

Now we have to install the bootloader, exit the installation, unmount all partitions, and reboot the machine.

9a. Install the bootloader:

bootctl install

Output (UEFI systems):

Copied systemd-boot binary.
Created ESP at /boot.

Output (MBR systems):

Installing for i386-pc platform.
Installation finished. No error reported.
Generating grub configuration file...
Found background: /usr/share/grub/background.png
Found linux image: /boot/vmlinuz-linux
Found initrd image(s) in /boot: initramfs-linux.img
Found fallback initrd image(s) in /boot: initramfs-linux-fallback.img
Done

Replace /dev/sdX with the appropriate device identifier for your disk.

9b. Exit the chroot environment using the following command:

exit

Output: (There will be no output if successful.)

9c. Unmount all partitions with this command:

umount -R /mnt

9d. Restart your computer via the command shown below:

reboot

Output: (There will be no output if successful.)

Step 10 – Arch Linux Customization

If the grub bootloader was installed correctly, you will be able to select Arch Linux to boot. You can log in using credentials for the user you created. When you have logged in, you can continue the boundless Arch Linux configuration this operating system is famous for.

The following Arch Linux installation guide steps are optional, depending on your preferences, but are helpful in most use cases:

10a. Before you install a desktop environment, you have to install X server, one of the most used display servers.

sudo pacman -S xorg

10b. After the X server installation is complete, choose your preferred desktop environment.

            CINNAMON:

sudo pacman -S cinnamon nemo-fileroller

            GNOME:

sudo pacman -S gnome gnome-extra

            XFCE:

sudo pacman -S xfce4 xfce4-goodies

            MATE:

sudo pacman -S mate mate-extra

10c. Install codecs and plugins.

sudo pacman -S faac faad2 flac jasper lame libdv a52dec libtheora x264 gstreamer0.10-plugins
libmad libvorbis wavpack

10d. Install additional software for day-to-day use. For this tutorial, the command below will install:

  • LibreOffice
  • Gedit (another text editor)
  • Skype
  • Firefox
  • Thunderbird (email client)
  • Pidgin (instant messaging client)
  • VLC (media player)
sudo pacman -S libreoffice gedit skype firefox thunderbird pidgin vlc

10e. Install archive managers:

sudo pacman -S tar unrar p7zip p7zip-plugins rsync

Final Thoughts

Now you are somewhat familiar with Arch Linux and how to install it. Installing Arch Linux may require more technical knowledge compared to other Linux distributions, but it offers a rewarding experience for users who value customization and control.

In fact, as this Arch Linux installation guide illustrates, customization is limitless, which is the real power of this operating system. You can customize almost everything in Arch Linux, such as the desktop environment, themes, and the mouse pointer.

With Arch Linux, you have the power to create a tailored Linux system that perfectly suits your needs, providing a lightweight, flexible, and up-to-date operating system that empowers you to shape your digital workspace. Enhance the freedom and endless possibilities that Arch Linux brings to your computing experience by learning everything about Arch on Arch Linux Wiki.

Liquid Web’s unmanaged dedicated server hosting allows you to install your own operating system and manage it how you wish to best suit your requirements. Reach out to our sales department and bring your dedicated server online today. Contact a salesperson to configure your dedicated server today.

Original Publication Date

This article was originally published in September 2021. It has since been updated for accuracy and comprehensiveness.


Latest Articles

In-place CentOS 7 upgrades

Read Article

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article