Many Linux users are stopped from using Arch Linux because they cannot install it. This Arch Linux installation guide will solve this problem. It shows the whole Arch Linux installation process step by step.
UEFI or legacy mode?
There are two possible options of Arch Linux installation: the legacy mode and the UEFI mode. I personally think that the Arch Linux installation in the legacy mode is more conservative, simpler, and more reliable. However, the UEFI mode is more up-to-date and some modern hardware supports only the UEFI installation.
This Arch Linux installation guide will use the UEFI mode, but I will point out the steps and commands that are different for the legacy mode. So, regardless of what mode you choose, this guide will help you to install Arch Linux with the minimal graphical environment.
The UEFI means Unified Extensible Firmware Interface and here are some of its benefits:
- UEFI replaces the Basic Input/Output System (BIOS) interface.
- UEFI is compatible with GPT tables.
- It supports larger hard drives.
- It is more configurable and, as a result, it boots faster.
In its turn, the GUID Partition Table (GPT) is more advanced than MBR partitions that is used in the legacy installation. It works with volumes larger than 2TB and supports up to 128 partitions.
So, let’s get started with detailed Arch Linux UEFI installation guide.
Before you start
Download Arch Linux ISO
First, download the Arch Linux installation ISO from the Arch Linux website.
You can download the torrent file or use the direct link. Just find your country and click on the link. Among the variety of files, choose the one which ends with .ISO. Click on it and save it.
When the ISO is downloaded, you need to write it to your USB flash drive. Open the Linux terminal and use the following command:
dd bs=4M if=/path/to/archlinux.iso of=/dev/sdx status=progress && sync
/path/to/archlinux.iso is the path to your downloaded ISO file;
/dev/sdx is your flash drive. You can find out this name with the command
sudo fdisk -l and the size of your USB flash drive.
Practice your Arch Linux installation in VirtualBox
However, you may try the Arch Linux on a virtual machine first. It will help you to practice and avoid fails on the hardware. To run the Arch Linux in VirtualBox, do the following steps.
- Create a new machine and name it Arch Linux.
- Give it 2GB of RAM. If you lack the RAM on your PC, keep it at 1GGB.
- Create a new hard disk. Select VDI (VirtualBox Disk Image) and dynamically allocated size.
- Give the VDI 20GB and click Create.
- Click on the Settings icon. In the System tab, enable the UEFI mode.
- Click on the Start icon or just double-click on the Arch Linux.
- Specify the path to the downloaded Arch Linux ISO.
The boot process of live Arch Linux in the UEFI mode can be very slow. This is normal. Just wait some time. When the system is loaded, and you can start the Arch Linux installation.
Arch Linux installation
Check network connection
First of all, check the internet connection. I recommend you to use a wired connection. To check if your internet works, you need to ping to any server, for example, the Arch Linux website:
ping -c 3 archlinux.org
If you are not sure what interfaces are available, use
If you use a wired connection, it is usually picked up automatically. Wi-Fi requires some additional settings. For Wi-Fi run:
You will see a window looking like this where you can choose the available networks:
Type the password and connect to your Wi-Fi network. However, I still recommend using the wired internet connection.
Next step in our Arch Linux installation guide, is to list the available partitions of our hard drives:
Most probably, you will have only two hard drives: the USB drive with the Arch Linux installation ISO and your computer HDD. When you have several hard drives, look at their size and define which one you want to use for the Arch Linux installation.
If you already have a partition table, skip this step. In the case your hard drive is brand-new as in the case of a virtual machine or you want to re-partition your hard drive, run this command to create a new partition table:
Note! Back up all your data, because creating a new partition table will erase everything from a drive.
In the label type window, select GPT.
Legacy mode! If you do the legacy installation, choose dos partition type and do not create the UEFI partition.
Clicking the New button and create 3 partitions:
- /dev/sda1 # choose 512Mb of space (UEFI)
- /dev/sda2 # choose at least 10 GB of space (root)
- /dev/sda3 # choose all the left space (home)
Write the table to your hard drive and quit.
Now, list the partitions again:
/dev/sda disk should have three partitions. We need to format them.
The first partition is a UEFI one. It needs to be formatted in a FAT file system:
mkfs.fat -F32 /dev/sda1
Legacy mode! If you do the legacy installation, skip the step of UEFI formatting.
The other two partitions can be formatted in any Linux file system. I recommend using EXT4:
mkfs.ext4 /dev/sda2 mkfs.ext4 /dev/sda3
Next, mount the root and home partitions:
mount /dev/sda2 /mnt mkdir /mnt/home mount /dev/sda3 /mnt/home
The root mounting point is the folder where the system will be installed. Check mounting points whether they were created successfully:
Install the system
Now, we start the installation process.
pacstrap -i /mnt base base-devel
When the system requests to choose the components to install, select all and yes. Wait some time until it completes.
Generate fstab file
Next step in this Arch Linux installation guide is to generate the fstab file:
genfstab -U -p /mnt >> /mnt/etc/fstab
To learn what
-p mean, type
genfstab -help to see the description of these options.
Chroot to the installed system
Next, chroot (change root) to your account that is mounted to /mnt using the BASH environment:
arch-chroot /mnt /bin/bash
This way you change your live environment to the root environment of the installed Arch system. This way, you will be able to access the system as a root user. A bit later, you will have to add the regular user.
To set the localization, you will have to work in Nano editor. Type
and press Enter.
Find the language you are going to use. In my case, I am going to install American English. Activate the search option by pressing the shortcut Ctrl + W (the shortcuts are listed at the bottom of the screen) and type
#en_US. Press enter.
You should jump to the line
Uncomment it by removing the # sign. Press Ctrl + O to save and Ctrl + X to exit the editor.
Next, you have to generate the locale. Run:
Set the time zone
To set the time zone, type:
ln -sf /usr/share/zoneinfo/
and press the Tab key to see all the available options. In my case, I need to use Europe. Again, you can press the Tab key, and you will see all the available cities. I will use Stockholm. Save this link to
/etc/localtime. The final command will look as follows:
ln -sf /usr/share/zoneinfo/Europe/Stockholm /etc/localtime
Instead of Europe and Stockholm, you can select your region and time zone.
Set local time
To set the time on your PC, run this command:
hwclock --systohc --utc
Hostname is the computer’s name. Let’s name it archPC. Use the following command:
echo archPC > /etc/hostname
You also need to add this name to the hosts file. Type:
and press Enter.
In the Nano editor, add this line at the end of the file:
127.0.1.1 localhost.localdomain archPC
If you use a static IP address, replace 127.0.1.1 with your static IP address given by the Internet provider. Press Ctrl + O to save, Ctrl + X to exit the editor.
First, install the network manager:
pacman -S networkmanager
Then enable it:
systemctl enable NetworkManager
Now, the system will be able to run a network manager at the system boot and connect to the Internet automatically. Remember, these settings work only for the wired internet connection.
Set root password
Next, set the root password. Type:
and type your password twice. Be attentive, as you will see nothing while typing.
Next, install the GRUB bootloader which is the vital component. Without it, your system will never boot. To install all the necessary packages, type the following command:
pacman -S grub efibootmgr
Installation of GRUB and EFI packagesWhen GRUB and EFI packges are installed, install the bootlader and generate its configuration files by running these commands one by one:
mkdir /boot/efi mount /dev/sda1 /boot/efi lsblk # to check if everything is mounted correctly grub-install --target=x86_64-efi --bootloader-id=GRUB --efi-directory=/boot/efi --recheck grub-mkconfig -o /boot/grub/grub.cfg
Legacy mode! If you do the legacy installation, install the GRUB in this way:
pacman -S grub grub-install /dev/sda grub-mkconfig -o /boot/grub/grub.cfg
Basically, the minimal installation of Arch Linux is complete.
Edit EFI bootloader
Legacy mode! If you do the legacy installation, skip this part.
However, we must make additional configurations with the bootloader. Create a BOOT directory:
sudo mkdir /boot/efi/EFI/BOOT
After that, copy GRUB bootloader to this directory and give it a different name:
sudo cp /boot/efi/EFI/GRUB/grubx64.efi /boot/efi/EFI/BOOT/BOOTX64.EFI
To be even safer, we can also create a startup script for EFI:
sudo nano /boot/efi/startup.nsh
In Nano editor, add these lines:
bcfg boot add 1 fs0:\EFI\GRUB\grubx64.efi "My GRUB bootloader" exit
To complete editing, press Ctrl + O to save the changes and Ctrl + X to exit the editor. In the end, run
exit to exit the chroot account.
Next, unmount all mounted partitions and reboot the system:
umount -R /mnt reboot
If you did everything correctly, after the reboot, you will see the GRUB welcome screen with Arch Linux installed.
To continue, log in as a root user with a previously setup password.
After the login, create a user account. It’s not a good idea to constantly work from the root account. Type:
useradd -m -g users -G wheel -s /bin/bash username
Write your own name instead of
Also, create a password for the new user:
username, use the name you created in the previous step. Type the password twice.
Next, enable sudo privileges for a newly created user:
Using the arrow keys, scroll down the screen and find the line:
# %wheel ALL=(ALL) ALL
Uncomment it, by removing the # sign.
Press Ctrl + O to save and Ctrl + X to exit the editor.
Now, exit the system by running the command:
and log in as a new user with the username and password you created.
Install Audio, X window system, Xfce desktop, login manager
To make the new system usable, install audio, X Window System, Xfce desktop, and login manager. Type the following command:
pacman -S pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server xfce4 lightdm lightdm-gtk-greeter
If you install the system on VirtualBox, in the end, add
When you press Enter, the system will offer to choose the components to install. Just press Enter twice to apply the default settings. After that, the system will request to choose the driver for the video card:
If you have a discrete video graphic card, select the second option. When you use integrated Intel video card, select the first option. The utility will install many packages. Wait some time until it completes.
By the way, if you prefer the Plasma 5 desktop as I do, I showed how to install and configure Plasma 5 in Arch Linux here.
Create xinit file
Xinit file allows to start an Xorg display server automatically. You need to create the xinitrc file with the command to launch Xfce desktop:
echo “exec startxfce4” > ~/.xinitrc
If you install any other desktop besides Xfce, you will need to use another command and probably another login manager. Below, you will find the xinitrc command and the command to install the desktop:
"exec gnome-session" sudo pacman -S gnome
"exec cinnamon-session" sudo pacman -S cinnamon
"exec mate-session" sudo pacman -S mate
Unity installation is tricky – see the Arch Linux Wiki.
"export XDG_CURRENT_DESKTOP=Budgie:GNOME" "exec budgie-desktop" sudo pacman -S budgie-desktop
"exec openbox-session" sudo pacman -S openbox
"exec i3" sudo pacman -S i
"exec awesome" sudo pacman -S awesome
"exec startdde" sudo pacman -S deepin
"exec startlxde" sudo pacman -S lxde
After that, enable the login manager:
systemctl enable lightdm
I would like to point out that I have not tested all these desktops. Some users reported that Plasma 5, for example, doesn’t start with lightDM. So, you need to use SDDM with Plasma 5. For the full list of Login Managers look at Arch Linux Wiki.
To test whether your graphical environment works, run:
The system must launch the graphical interface.
This is a very minimal installation. There are almost no packages installed. From this point, you can install what you want and configure your Arch Linux as you want.
To further check that everything works fine, shut down the system and start it again. Hopefully, it will boot again and you will be able to log in.
Arch Linux installation is done!
Step by step Arch Linux installation guide is over. As you can see, the Arch Linux installation process is little complicated but manageable. This system is still not complete and you will need to install many more packages and configure it. Nevertheless, the most difficult part is done and you have a good starting point.
Do you want to share your experience or have any questions about how to install Arch Linux? Leave your comment below.