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
- Edit EFI bootloader
- Add user
- Install Audio, X window system, Xfce desktop, login manager
- Create xinit file
- Start GUI
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:
1 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:
1 ping -c 3 archlinux.org
If you are not sure what interfaces are available, use
1 ip link
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:
1 fdisk -l
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:
1 cfdisk /dev/sda
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:
1 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:
1 2 mkfs.ext4 /dev/sda2 mkfs.ext4 /dev/sda3
Next, mount the root and home partitions:
1 2 3 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.
1 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:
1 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:
1 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
1 nano /etc/locale.gen
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:
1 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:
1 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:
1 hwclock --systohc --utc
Hostname is the computer’s name. Let’s name it archPC. Use the following command:
1 echo archPC > /etc/hostname
You also need to add this name to the hosts file. Type:
1 nano /etc/hosts
and press Enter.
In the Nano editor, add this line at the end of the file:
1 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:
1 pacman -S networkmanager
Then enable it:
1 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:
1 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:
1 2 3 4 5 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:
1 2 3 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:
1 sudo mkdir /boot/efi/EFI/BOOT
After that, copy GRUB bootloader to this directory and give it a different name:
1 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:
1 sudo nano /boot/efi/startup.nsh
In Nano editor, add these lines:
1 bcfg boot add 1 fs0:\EFI\GRUB\grubx64.efi "My GRUB bootloader"
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:
1 2 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:
1 useradd -m -g users -G wheel -s /bin/bash username
Write your own name instead of
Also, create a password for the new user:
1 passwd username
username, use the name you created in the previous step. Type the password twice.
Next, enable sudo privileges for a newly created user:
1 EDITOR=nano visudo
Using the arrow keys, scroll down the screen and find the line:
1 # %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:
1 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:
1 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:
1 2 "exec gnome-session" sudo pacman -S gnome
1 2 "exec cinnamon-session" sudo pacman -S cinnamon
1 2 "exec mate-session" sudo pacman -S mate
Unity installation is tricky - see the Arch Linux Wiki.
1 "exec unity"
1 2 3 "export XDG_CURRENT_DESKTOP=Budgie:GNOME" "exec budgie-desktop" sudo pacman -S budgie-desktop
1 2 "exec openbox-session" sudo pacman -S openbox
1 2 "exec i3" sudo pacman -S i
1 2 "exec awesome" sudo pacman -S awesome
1 2 "exec startdde" sudo pacman -S deepin
1 2 "exec startlxde" sudo pacman -S lxde
After that, enable the login manager:
1 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!
So, this 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.