Arch Linux is one of the most popular minimalist Linux distributions in use today. If you want a versatile, bleeding-edge Linux distribution with a light footprint, Arch Linux has you covered from head to toe. Arch, however, does have a steep learning curve, and while the documentation for Arch Linux is comprehensive, many new users can find it overwhelming and complicated.
In this tutorial, we will be installing a basic Arch Linux system using the full disk to a computer or virtual machine(VM).
Installing Arch Linux
You will need:
- A computer or VM with at least 1GB of RAM, and 20GB of storage
- Software capable of burning a DVD
- A blank DVD onto which we will burn the ISO
- An Internet connection
1. Download the Arch Linux ISO
Before we can install Arch Linux, we must download the ISO image from the Arch Linux website. To do this, navigate to https://archlinux.org/download and scroll down until you see a list of mirrors, as shown below.
Choose the mirror closest to you and download the Arch Linux ISO file, which is shown below.
NOTE: The page you see may be slightly different than the screenshot, depending on which mirror you choose.
Once you have downloaded the Arch Linux ISO, it is recommended that you verify it’s SHA1 checksum. If the checksum you get is different from the one on the ISO file you have may have been tampered with, and should not be used.
2. Burning the Arch Linux ISO to a DVD
NOTE: If you plan on installing Arch Linux on a VM, you may skip this step and boot directly into the ISO image.
Now that we have downloaded the Arch Linux ISO, we will burn it to the DVD. There is a variety of software, many free, that allow you to do this, such as Brasero, AnyBurn, or the non-free PowerISO.
3. Boot up Arch Linux
Now we will boot into the installation DVD (or the ISO directly if you are using a VM). Once it loads, you should be greeted with a screen like the one below.
From here, press enter to boot Arch Linux.
4. Set the Keyboard Layout
NOTE: If you do not want to change the default US keyboard layout, you may skip this step.
Once the live environment has booted up, we can change the keyboard from the default US layout, if desired. To list all available layouts, use:
# ls /usr/share/kbd/keymaps/**/*.map.gz
Set the keyboard layout using the loadkeys command:
# loadkeys KEYMAP
Where KEYMAP is the keymap, you wish to use.
5. Check your Internet Connection
To install Arch Linux, we will need a functioning Internet connection. If you are using a wired connection, you should already be connected to the Internet. You can check your Internet connection by using the ping command:
# ping -c 3 google.com
If you wish to use a wireless Internet connection to install Arch Linux, consult the wireless network configuration documentation on the Arch Linux wiki at https://wiki.archlinux.org/index.php/Wireless_network_configuration.
6. Enable NTP
Once we have verified that we have a working Internet connection, we must enable Network Time Protocol (NTP) to allow the system to update the time via the network. To do this, run:
# timedatectl set-ntp true
7. Partition the Hard Drive
Next, we must partition the hard drive. While there are many ways that this can be done, for this tutorial we will be creating two partitions, one for Arch Linux and one to act as swap space. To begin, use fdisk to list all available drives:
# fdisk -l
NOTE: The output you get from fdisk may be different from that in the screenshot.
Make a note of the name of the disk you wish to partition. Now, we will use cfdisk, a partition manager, to partition the drives:
NOTE: In cfdisk, use the arrow keys to navigate and the enter key to select.
# cfdisk /dev/sdX
Where X refers to the letter of the drive, you wish to partition.
You should be greeted by a screen asking you to select the label type. In most cases, this will be “dos.”
Highlight the label type and press enter. A screen similar to the one below should be displayed.
Now we will create the partitions. To do this, select “New”. You will be prompted to enter the partition size. Be sure to leave enough room to create another partition for your swap space, which will be twice the amount of RAM.
Next, you will be asked if the partition should be primary or extended. Select “primary”.
Now make the partition bootable by selecting “Bootable”. Your screen should look similar to the one below.
Now, using the same process as before, utilizing the remainder of the space on the drive, create another primary partition. Do not make this partition bootable.
The partition type needs to be changed from “83 Linux” to “82 Linux swap / Solaris”. To do this, select “Type” on the swap partition and select “82 Linux swap / Solaris”, as shown below.
Now, write the changes to the drive. To do so, select “Write” and type “yes”, as shown below.
You may now exit `cfdisk` by selecting “Quit”.
8. Create Filesystem
Now that the drive has been partitioned, we can create the filesystem. There are several options for this, but for this tutorial, we will use the ext4 filesystem. To create the filesystem, use:
# mkfs.ext4 /dev/sdX1
9. Create Swap Space
Next, we will create a swap space. Swap space in Linux is hard drive space that acts as extra RAM. To do this, run:
# mkswap /dev/sdX2
10. Mount the Filesystem and Swap Space
Now that both the filesystem and swap space have been created, they must be mounted. To do this, we will use the following commands:
# mount /dev/sdX1 /mnt
# swapon /dev/sdX2
These commands will mount the filesystem and activate the swap space, respectively.
11. Install the Base System
Next, we will use the pacstrap utility to download and install all the necessary components of Arch Linux. To use pacstrap, run:
# pacstrap /mnt base base-devel
NOTE: This step may take some time.
12. Generate the fstab File
Now we must generate the fstab file. To do so, run:
# genfstab -U /mnt >> /mnt/etc/fstab
13. Chroot into Arch Linux
After pacstrap is done running, we will chroot into the newly installed Arch Linux system by using arch-chroot:
# arch-chroot /mnt
14. Set the Time Zone
If arch-chroot was successful, you should now be in the freshly installed Arch Linux system. From here, we must configure it. To start with the configuration, we will specify the timezone. This can be accomplished with the ln command:
# ln -sf /usr/share/zoneinfo/REGION/CITY /etc/localtime
Where REGION and CITY represent your time zone and maybe tab-completed.
Update the hardware clock with:
# hwclock --systohc
15. Generate Locale File
Now we will generate the locale file. To do this, uncomment “en_US.UTF-8 UTF-8” and any other locales you wish to use in /etc/locale.gen and run:
16. Create Locale Configuration File
Next, we will create the locale configuration file:
# echo "LANG=en_US.UTF-8" > /etc/locale.conf
17. Create a Hostname File and Enable DHCP
At this point, we must create the hostname file. To do so, run:
# echo "HOSTNAME" > /etc/hostname
Where HOSTNAME is the hostname, you wish to use for the system.
Now, enable DHCP:
# systemctl enable dhcpcd
18. Set the Root Password
Now we must set the password for the root account using passwd:
19. Install a Boot Loader
Finally, we will install the boot loader. For this tutorial, we will be using the GRUB bootloader. To do this, we will be using Pacman, the package manager for Arch Linux:
# pacman -S grub os-prober
Now we must install GRUB onto the system:
# grub-install /dev/sdX
And configure it:
# grub-mkconfig -o /boot/grub/grub.cfg
20. Exit and Reboot
Now, we will exit the arch-chroot environment:
And reboot the system:
21. Login to Arch Linux
Once the system has been rebooted, GRUB will load.
From there, you can press enter to boot into Arch Linux and log in to your new Arch Linux system as root.
Now you have a fresh, working installation of Arch Linux. Arch does not contain many software packages out of the box, nor does it include a GUI. However, you can configure and customize Arch Linux to meet your needs, whatever they may be.
Wow..Nice and clean steps! Thank you!
Except the article never mentions that you need to install the kernel, the command should look more like ‘pacstrap /mnt base base-devel linux linux-firmware’
Ahh, that explains it.
I stopped and pondered at this step for a few minutes, considering that the arch setup guide does mention this, but figured it would be best to just follow the guide to the dot to avoid breaking something.
Now it boots into GRUB and it complains I don’t have a kernel. :-(
I guess I should just be able to chroot into /mnt again and install the kernel?
Thanks man! Not shure why nobody else is complaining about that.
For me the following steps fixed the problem:
– boot from the iso again
– mount everything again
– do the arch-chroot again
– install linux and linux-firmware from pacman
– generate a new grub config
– exit and reboot
Aaaand dhcpcd is missing. Make shure to install that one too.
best tutorial on installing arch linux i’ve ever had the chance to use
Really nice tutorial !!
after a hard time i managed to set it up bro your steps saved me! finally i can start using this powerful and customizeable os
I lost boot windows 7 when I followed the instructions above, please help me
last updated in 2019 but still suggests to partition as a dos disk? no man, you should partition gpt and boot with uefi only. don’t use any bootloader, just load the kernel with your uefi software. times have changed, keep up with it.
What steps to take for this, because the boot flag isn’t showing up anymore
This article is full of old information. Anyone coming here with issue’s installing Arch because you followed the steps in this article need to go read through the OFFICIAL Arch installation guide. A few examples are below.
The pacstrap command should look more like this >> ‘pacstrap /mnt base base-devel linux linux-firmware’
When setting up grub following this article you will not be able to boot into the system successfully with a newer ISO file.
You should also install the microcode for your CPU if you have an AMD or Intel processor >> pacman -S intel-ucode or pacman -S amd-ucode
Then after installing that run the grub-mkconfig command.
Also the command listed for setting up the grub config file is wrong. os-probe won’t work unless the other existing OS is mounted to the file system. I HIGHLY encourage anyone wanting to install Arch linux to ignore this article and go read through and follow the Official Arch Installation Guide. I’m not providing a link to it because if you can’t run a google search and find the official guide then you shouldn’t be using Arch, try Ubuntu. The author of this article either needs to update the article or put a HUGE warning at the very top letting everyone know that this article is extremely outdated.
I have Windows 10 in dual Boot. Disk type converted to Guid already. Should I choose dos?
Hi there, thanks for this article, it’s great. Everything went perfectly well, except at the end with the Grub Bootloader.
It installed OK, no problems reported, but when I generated the Grub config file, it didn’t report finding the linux image or the initrd image. It just said “Generating Grub config file . . .” and then “Done”. That’s it.
Then when I rebooted, Grub started up but went into the Grub prompt, not the boot menu.
I went through this whole process twice and same result each time, everything exactly as the instructions and just a problem with Grub. Can anyone help me find what I did wrong? Thanks!!
That’s OK, I have figured it out.
There have been changes recently to how Arch is installed, whereby the pacstrap command no longer installs some things including the kernel using the base group. So it’s necessary to also include linux and linux-firmware in the command.
Thank you, Frank!
I was just having the same issue when I came across your comment. Thank you for being a saving force in the world by giving your solution!
But how do I get out of grub and get back to where I can install linux and linux-firmware?
You will need to reboot your PC and boot back into the Arch live environment. Once you are back in you will want to mount the filesystem again (use the commands in the article to mount it). Then you will need to chroot back into that file system, using the ‘arch-chroot’ command above. Once that has been done you will need to run ‘pacstrap /mnt linux linux-firmware base base-devel’ (Technically, base and base-devel are not needed if you did this the first time, but it never hurts to let the system check for newer version of the software). Once all that is done run ‘grub-mkconfig -o /boot/grub/grub.cfg’
You should be good to reboot after all that has been done. Good luck to ya!
Still doesn’t work. pacstrap: command not found
I think I’m just gonna dump it and use the install guide when/if I get time again. Thanks for trying, I guess.
I got it – you meant step 11.
Yeah, I found that I couldn’t edit the local file because vim wasn’t installed.
How come you ask to enable dhcp if at any moment is saying to install it? pacman -S dhcpcd
I got it David thanks I didn’t see it before.
I really appreciate this tutorial; it made arch much less intimidating. The one thing that screwed me was that line ‘pacstrap /mnt base base-devel’ should have also included the Linux kernel. I booted into grub rescue and realized /boot was empty! Not a big deal as I booted back with my live iso, mounted, and installed the kernel but you definitely need to fix that.
what is the iso for? is there a way to install it without internet? why is the iso file size so big? just to start installation? i don’t get it. it is not easy to have internet in this part of the world, we have prepaid internet, and slow in fact, someone help me with this please.
Didn’t work for me, had similar issues to others where on reboot I had the grub bootloader menu and nothing else. Seems David is right, the information is old and should not be used.
I was able to successfully install Arch on a virtual box VM by going to the official arch linux website and following their instructions. Though they require more work to read and execute, they are correct at least and result in a usable system. Please don’t use the method above unless swearing your tits off at computers is something you love.
Jimbo: I wish I would have read your comment.
if I already have windows in my c drive, will this affect windows? will windows be overwritten ? should I make a partition in the c drive?
Just use Zen GUI installer and done!