A step by step Arch Linux installation guide
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?
- Before you start
- Arch Linux installation
- Check network connection
- Install the system
- Generate fstab file
- Chroot to the installed system
- Set locale
- Set the time zone
- Set local time
- Set hostname
- Enable network
- Set root password
- Install GRUB
- Swap File
- Add user
- Install X window system and audio
- Install desktop environment
- Start GUI
UEFI or legacy mode?
There are two possible options of Arch Linux installation:
- legacy mode
- UEFI mode
I personally think that the Arch Linux installation in the legacy mode is more conservative, simpler, and 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 a 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.
Also, I will use a GUID Partition Table (GPT). It is more advanced than a master boot record (MBR) partitions. It works with volumes larger than 2TB and supports up to 128 partitions. However, if you decide to do the legacy installation, use the MBR table.
So, let’s get started with the 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 ISO
archlinux-xxxx.xx.xx-x86_64.iso and signature
When the ISO is downloaded, you need to check its signature to make sure it has not been compromised:
gpg --keyserver-options auto-key-retrieve --verify /path/to/archlinux.iso.sig
If you see “Good signature from …“, this means everything is alright:
Next, 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.
Alternatively, you can use a graphical program to write ISO to a USB.
Practice your Arch Linux installation in VirtualBox
You may try the Arch Linux on a virtual machine first. It will help you to experience the installation and avoid errors in the future real installations. 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. If you just see the back screen, 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 recommend using a wired internet connection when possible.
The next step in our Arch Linux installation guide is to partition the hard drive.
List the available partitions and disks:
Most probably, you will have only two hard drives:
- the USB drive with the Arch Linux ISO
- your computer HDD/SSD.
If you have several hard drives, use
fdisk to 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. If 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 the
dos partition type and do not create the UEFI partition.
Use the arrow keys and Enter to create 3 partitions with
- /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.
If you are not familiar with
cfdisk, watch the video tutorial above.
Now, list the partitions again:
/dev/sda disk should have three partitions. We need to format them.
The first partition is the UEFI partition. It needs to be formatted with a FAT file system:
mkfs.fat -F32 /dev/sda1
Legacy mode! If you do the legacy installation, skip the step of UEFI formatting because you should not have the UEFI partition.
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 partition:
mount /dev/sda2 /mnt
Create a folder to mount the home partition and mount it:
mkdir /mnt/home mount /dev/sda3 /mnt/home
Check mounting points whether they were created successfully:
Note, the root mounting point is the folder where the system will be installed.
Install the system
Now, we start the installation process by installing the minimal Arch Linux system:
pacstrap -i /mnt base linux linux-firmware sudo nano
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 system that is mounted to /mnt using the BASH environment:
arch-chroot /mnt /bin/bash
You change your live ISO environment to the root environment of the installed Arch system. This way, you access the system as a root user. A bit later, you will also 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 Enter to save and Ctrl+X Enter to exit the editor.
Next, you have to generate the locale. Run:
And create the
locale.conf with corresponding language settings:
echo "LANG=en_US.UTF-8" > /etc/locale.conf
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 for the system, run this command:
hwclock --systohc --utc
And check the time:
If the time is incorrect, go back and make sure you have set the timezone correctly.
A hostname is the computer’s name. Let’s name it
Use the following command:
echo archPC > /etc/hostname
You also need to add this name to the
/etc/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 Enter and Ctrl+X Enter to save and 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.
There are several bootloaders you can install on Arch Linux. I recommend the GRUB bootloader. It is the most popular, highly configurable and easy to use bootloader.
Install the GRUB bootloader and EFI boot manager packages:
pacman -S grub efibootmgr
Next, using these packages, install the bootlader on your system 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 --removable 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.
Next, exit from the system root account, unmount all mounted partitions and reboot the system by running these commands:
exit 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 set password.
You probably have noticed that I have not created a Swap partition. This is because I recommend to use a Swap file. Let’s create a swap file for this Arch Linux installation too.
Create a Swap file of
3G or whatever your RAM size is:
fallocate -l 3G /swapfile
Change its access rules, format and enable it:
chmod 600 /swapfile mkswap /swapfile swapon /swapfile
Also, add this Swap file to the
echo '/swapfile none swap sw 0 0' >> /etc/fstab
And check if the Swap file is working:
It is not a good idea to constantly work from the root account. So, after the login, create a user account:
useradd -m -g users -G wheel -s /bin/bash username
Write your 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 Enter to save and Ctrl+X Enter to exit the editor.
Now, exit the system by running the command:
And log in with the regular user credentials which you have just created.
Install X window system and audio
To make the new system usable, install X Window System and audio. I will install XFCE as a desktop environment example.
pacman -S pulseaudio pulseaudio-alsa xorg xorg-xinit xorg-server
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 the integrated Intel video card, select the first option. The utility will install many packages. Wait some time until it completes.
If you install the system on VirtualBox, also install guest addition:
pacman -S virtualbox-guest-utils
Install desktop environment
I install XFCE desktop as an example of the graphical interface:
pacman -S xfce4 lightdm lightdm-gtk-greeter echo "exec startxfce4" > ~/.xinitrc systemctl enable lightdm
Xinit file allows to start an Xorg display server automatically.
You can also install other desktops:
I showed how to install and configure Plasma 5 in Arch Linux previously.
echo "exec gnome-session" > ~/.xinitrc sudo pacman -S gnome
echo "exec cinnamon-session" > ~/.xinitrc sudo pacman -S cinnamon mdm systemctl enable mdm
echo "exec mate-session" > ~/.xinitrc sudo pacman -S mate lightdm lightdm-gtk-greeter systemctl enable lightdm
Unity installation is tricky - see the Arch Linux Wiki.
echo "export XDG_CURRENT_DESKTOP=Budgie:GNOME" > ~/.xinitrc echo "exec budgie-desktop" >> ~/.xinitrc sudo pacman -S budgie-desktop lightdm lightdm-gtk-greeter systemctl enable lightdm
echo "exec openbox-session" > ~/.xinitrc sudo pacman -S openbox lightdm lightdm-gtk-greeter systemctl enable lightdm
echo "exec i3" > ~/.xinitrc pacman -S i3 rxvt-unicode dmenu
echo "exec awesome" > ~/.xinitrc sudo pacman -S awesome
echo "exec startdde" > ~/.xinitrc sudo pacman -S deepin
Also, edit the file
/etc/lightdm/lightdm.conf to have this line:
echo "exec startlxde" > ~/.xinitrc sudo pacman -S lxdm-gtk3 lxdm
I would like to point out that I have not tested all these desktops. In particular, some Login Managers may not work with a given desktop. For the full list of Login Managers look at Arch Linux Wiki and try the one you like.
To test whether your graphical environment works, run:
The system must launch the graphical interface.
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!
This is a very minimal installation. From this point, you can install what you want and configure your Arch Linux as you want.
So, this step by step Arch Linux installation guide is over. As you can see, the Arch Linux installation process is a 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.