Raspberry Pi has been undoubtedly the way to go for inexpensive single-board computing. You can create Raspberry Pi projects for powering everything from robots to smart home devices.
When the Raspberry Pi 4 launched in 2019, the performance amazed the Raspberry Pi enthusiasts. A more powerful CPU, USB 3.0 support, native Gigabit Ethernet, plus the ability to output 4K video at 60 Hz on dual monitors are the major improvements. The intent was to pitch Raspberry Pi as an entry-level desktop computer.
More recently, the Raspberry Pi 4 offers an 8 GB RAM model, which is better not only as a desktop but also for hosting databases and servers.
There are many operating systems that can be installed on a Raspberry Pi. Apart from the official Raspberry Pi OS (previously known as Raspbian), we have covered installation of Ubuntu MATE on Raspberry Pi. And in this tutorial I will cover a step by step Arch Linux installation.
Installing Arch Linux on a Raspberry Pi 4

Note
Arch Linux doesn’t support ARM architecture (used by devices like Raspberry Pi) officially. But there is a separate project called Arch Linux ARM that ports Arch Linux to ARM devices. It is available in both 32-bit & 64-bit format.
I am going to use it for getting Arch on Raspberry Pi.
You’ll need the following things for this tutorial:
- A microSD card of 8 GB at least.
- A Linux system with card reader slot for preparing the microSD card for Arch installation.
- Active internet connection.
- A Raspberry Pi device with essential accessories, of course.
Since the installation procedure is purely terminal-based, you should have intermediate knowledge of the Linux command line and you should be comfortable in using terminal.
Step 1: Insert the microSD card in your card reader
When you insert you microSD card in your card reader, open the terminal, get root /sudo access and list the block devices to identify the card. The installation process needs to be done using root priviledges.
fdisk -l
My block device is the mmcblk0, your device may be different.

Step 2: Format and create the partitions
Partition the SD card using fdisk command. Keep in mind to replace the device name with your sd card’s name.
fdisk /dev/mmcblk0
At the fdisk prompt, the existing partitions have to be deleted and a new one should be created.
- Type o. This will purge any partitions on the drive.
- Type p to list partitions. To check if any partition is still present.
- To create the boot partition: Type n, then p for primary, 1 for the first partition on the drive, press ENTER to accept the default first sector, then type +100M for the last sector.
- Type t, then c to set the first partition to type W95 FAT32 (LBA).
- To create the root partition: Type n, then p for primary, 2 for the second partition on the drive, and then press ENTER twice to accept the default first and last sector.
- Write the partition table and exit by typing w.

Create and mount the FAT & ext4 filesystems
At this point, I will create the filesystem for the boot and root partition using mkfs command and then mount it. If in doubt about the partition names, list again the partitions as you did in the first step.
mkfs.vfat /dev/mmcblk0p1
mkdir boot
mount /dev/sdX1 boot
mkfs.ext4 /dev/mmcblk0p2
mkdir root
mount /dev/sdX2 root

Download and extract Arch Linux for Raspberry Pi 4
Make sure that you have root access (otherwise the process may fail), and run the following commands (with sudo, if you are not root).
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-aarch64-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-aarch64-latest.tar.gz -C root
sync

Now move the boot files to the boot partition you had created:
mv root/boot/* boot
sed -i 's/mmcblk0/mmcblk1/g' root/etc/fstab
umount boot root
You might see “Failed to preserve ownership” errors. That’s normal because the boot partition isn’t owned by anyone.
If you need a 32-bit format for any reason, you can follow the commands below. The explanation stays the same as of the 64-bit format.
Arch Linux ARM 32-bit
wget http://os.archlinuxarm.org/os/ArchLinuxARM-rpi-4-latest.tar.gz
bsdtar -xpf ArchLinuxARM-rpi-4-latest.tar.gz -C root
sync
mv root/boot/* boot
umount boot root
Step 3: Insert the microSD card into the Raspberry Pi and, connect the power supply and to the Internet.
At this step Arch Linux is installed on the SD card, and the rest of the configurations will be done from the Raspberry pi.
You can either follow the rest of the tutorial, either directly on the Raspberry Pi by connecting a monitor and a keyboard set, or you can connect remotely to the Raspberry Pi via SSH (if you don’t have a spare monitor, you need to connect via Ethernet to your local network).
I will connect to my Raspberry Pi via SSH for this tutorial. To get the IP address of the Raspberry Pi, check the devices connected to your network and see which one is the Raspberry Pi.
Connect via WiFi
If an Ethernet connection is not an option, you can access your WiFi network after you login as root using the following command. Please note that you need a keyboard set and a monitor to initially connect on your WiFi.
Note: I am aware that wifi-menu is being discontinued in the original Arch Linux. For the moment, it works in Arch Linux ARM.
wifi-menu
Once you find the IP address of your Raspberry pi, type the following command at your computer’s terminal using your IP address:
ssh [email protected]_pi_ip_address
Please note the default user name is alarm and the default user password is alarm. The default root password is root.

To complete the installation process, you need to initialize the pacman keyring and populate the Arch Linux ARM package signing keys:
pacman-key --init
pacman-key --populate archlinuxarm
At this point the installation process has been completed and you can upgrade the system packages as root using the same pacman commands as you do with an x86 architecture machine.
pacman -Syu
If you want to reboot your Raspberry pi after a system upgrade, simply type reboot in the terminal and connect again via SSH.
Bonus tips after installing Arch Linux on Raspberry Pi
To make the use of Arch Linux on a Raspberry Pi 4 more convenient I will show you a few tweaks/additions that you can do.
- Connect directly as root via SSH
- Change the default username and password
- Add a user to the sudoers
- Change the default root password
- Change your hostname
- Install an AUR Helper
Connect directly as root via SSH
In order to change the default username you have to logoff and login as root only.
By default it is not permitted to directly login as root via SSH, but you can change that.
As a root user, edit the sshd_config file found in /etc/ssh/sshd_config:
nano /etc/ssh/sshd_config
Uncomment the PermitRootLogin and next to it type yes, or add the following line to the file. You can add it anywhere but it’s good practice to find the authentication block and add it there.

Save and exit the file, and restart the SSH server.
systemctl restart sshd
Now type exit twice, to exit root and exit the SSH remote connection.
To connect to your raspberry pi as root, use the root name instead the default username and your ip address.
ssh [email protected]_pi_ip_address
Remember that the default root password is root.

Change the default username and password and the default root password
To change the default username and password type the following commands at your terminal
usermod -l new_username old_username
passwd username
usermod -d /home/new_username -m new_username
To change the default root password type the following command at your terminal
passwd

Give sudo privileges for your user
To be able to give sudo privileges to a user, you need to install the sudo package as a prerequisite.
pacman -S sudo
The configuration file for sudo is /etc/sudoers. It should always be edited with the visudo command.
EDITOR=nano visudo
Once you open the configuration file, add your username in a similar way as I do, preferably under the root user. Then save the file and exit.

Change the default hostname
To change system hostname on Systemd based distributions, you need to use hostnamectl command as shown:
hostnamectl set-hostname New_Hostname
Now type exit, to terminate the SSH session and login again with your new username, and your new user password.
ssh [email protected]_pi_ip_address
Install an AUR Helper
Many users prefer Arch Linux or an Arch Linux based distribution for the large Arch User Repository. You can use the AUR packages on an ARM instruction set machine but, not all of them are compatible with this architecture.
To begin with, make sure that you have the git package and base-devel group installed.
sudo pacman -S git base-devel
You can now install whichever package from the AUR you like or via an AUR Helper in a similar manner which is a package in AUR too. My personal choice is yay, but you can install whichever you prefer.
git clone https://aur.archlinux.org/yay.git
cd yay
makepkg -si
Conclusion
As an Arch Linux user and RISC fan, the combination of Arch on a Raspberry Pi looks a possible scenario of my future desktop computer. An alternative solution, but with a preinstalled desktop environment could be the Manjaro ARM distribution.
For the time, I use my Raspberry Pi for non-desktop tasks and I’m well settled to Ubuntu Server which I find a really good choice for the Raspberry Pi. The almost negligible power consumption of the Raspberry Pi makes it an ideal server machine.
Are you interested about Raspberry Pi projects? Make sure you subscribe to our newsletter and leave your thoughts in the comments section.
bsdtar isn’t working for me. It shows as command not found, so I tried apt-get install bsdtar, but I get this:
E: Package ‘bsdtar’ has no installation candidate
How can I fix this, or the equivalent command using tar or some other extracting program?
Read the full error message. It will tell you what package contains bsdtar. In this case it will probably be ibarchive-tools
Got it, thank you.
apt-get install libarchive-tools, now bsdtar works.
Just checking, is this article being updated along with any changes to the installation?
I’m as nooby on Ubuntu 20.03 confused with:
sed -i ‘s/mmcblk0/mmcblk1/g’ root/etc/fstab
cause there are no ‘mmcblk1’ in Ubuntu 20.04, there is no mmcblk at all; with me: ‘sdc’ with sdc1 and sdc2.
So, what does ‘mmcblk1’ mean with Ubuntu? It sounds as there should be a ‘sdd’, like ‘mmcblk1’?
Hi Hans, the name of the block devices such as sda, sbd, mmcblk etc. are distro independent. It doesn’t matter if you use Ubuntu or a different distribution.
The name depends on how the block device is registered in the Linux kernel.
Hard disks are listed with names beginning with sd.
Multi Media Cards (MMC) like SD or microSD, are listed with names beginning with mmcblk.
I used a microSD card for the demonstration, but your device name can be different.
I just ran through all the steps and it seems that this sed call is not needed. The RPi booted in emergency mode after and I have to revert /etc/fstab to mmcblk0 to make it works. Very useful tutorial btw
Good article, should change sdX to the previously named sd card partitions though for consistency
Spot on! Thank you for the feedback.
Installed it on a raspberry pi zero w and working fine :-)
Thank you very much for the clear instructions!