How to Automate a Minimal Arch Linux Installation with archinstall Script
arch linux archinstall automation cli tools howto linux installation minimal linux system setup
The true beauty of Arch Linux lies in its "Keep It Simple, Stupid" (KISS) principle, giving you a blank canvas to build your perfect digital environment. While manual installation is a great learning experience, sometimes you just need a fast-track to a reliable and optimized base system without sacrificing the control that Arch is famous for.
Hi all, welcome to MusaBase! In this guide, I will walk you through setting up a Minimal Arch Linux system using the official archinstall script. This method is perfect for those who want a fast, reliable, and optimized base for their daily driver.
While Arch Linux is a top choice for customization, you might also be interested in other modern Linux paradigms. If you prefer an immutable and rock-solid workstation, check out my guide on installing Fedora Silverblue. Or, if you want to explore the world of declarative configurations, you can follow my NixOS installation walkthrough.
In this specific Arch tutorial, we will focus on a Custom Disk Partitioning setup and ensure your system is ready for use by configuring NetworkManager directly during the installation process. Let's dive into this UEFI-optimized setup.
Prerequisites
Before proceeding, ensure that you have already downloaded the Arch Linux ISO and created a bootable USB drive. This guide is specifically designed for systems with UEFI firmware.
- RAM: Minimum 512 MB (2 GB or more is highly recommended for a smooth experience).
- Storage: At least 2 GB for a minimal base, though 20 GB is recommended for a full setup with apps.
- Processor: An x86-64 compatible CPU.
- USB Drive: A flash drive with the official Arch Linux installation media.
Note: Ensure you have a stable internet connection (Ethernet or Wi-Fi) as the archinstall script will need to download packages from the official repositories.
Step 1: Boot into Live ISO
- Reboot your PC.
- Press F9, F10, F11, F12, Esc, or Del (depending on your motherboard) to enter BIOS/UEFI settings.
- Locate and disable Secure Boot.
- Save changes and exit.
- When prompted, press the key to select a boot device (e.g., F9) depending on your motherboard.
- Choose your USB drive as the boot device.
- You should see the Arch Linux boot menu, similar to this one:
- Press Enter on Arch Linux install medium (x86_64, UEFI) .
- After a few seconds, you will be in the Arch Linux live installation environment.
Step 2: Manual Hard Disk Partitioning and Formatting for Arch Linux
In this step, we will manually partition and format the hard drive. This can also be done using the automatic method inside the archinstall script, but for better control and flexibility, I recommend doing this step manually.
2.1: Partitioning with cfdisk
Next, we need to partition the hard disk to create a boot and root partition. You can use fdisk, gparted or cfdisk. In this guide, I'll use cfdisk because it's convenient and provides an easy-to-use text-based "graphical interface".
- If you have more than one drive connected, list all storage devices with:
lsblk
- Now run the following command to open the cfdisk interface.
- Select gpt as the partition table and press Enter.
cfdisk /dev/sdb
2.1.1: Create the Boot Partition
- In the cfdisk interface, select Free Space and press Enter.
- Allocate around 512 MB to 1 GB depending on your needs (e.g., 1G or 512M) with capital G for Gigabytes and M for Megabytes.
- Next, on the bottom options menu select [ Type ] and press Enter to open Partition Type/Filesystem menu.
- Choose EFI System and press Enter.
- Setting the partition type to EFI System is essential because without it, the firmware won't be able to locate and execute the bootloader.
2.1.2: Create the Root Partition
- Next, select Free Space again, then choose [ New ] from the bottom menu and press Enter.
- Allocate the desired size for your root partition.
- If you plan to create a separate /home partition, allocate accordingly. In this example, I'm going to allocate 15GB to the root partition, leaving space for a separate swap partition later.
2.1.3: Create a Swap Partition (Optional)
This step is optional. If you want to create a Swap Partition for your system, follow this step or skip to the next one.
- Select Free Space then choose [ New ] and press Enter.
- Allocate around 4GB (or as needed) and press Enter.
- Next, with the Swap Partition highlighted, select [ Type ] and choose Linux swap partition type from the menu and press Enter.
2.1.4: Write the Partition Changes
This step is crucial, without writing the changes, your new partitions won't be created.
- Navigate to [ Write ] in the bottom options menu and press Enter.
- Type yes when prompted and press Enter.
- Finally, select [ Quit ] to exit cfdisk.
2.2: Format the Partitions
Now that all required partitions have been created, let's format them before installing Arch Linux. First, run lsblk command to list all attached storage devices and their partitions. It's an easy way to identify partitions and avoid formatting the wrong one:
2.2.1: Format the Boot Partition
- Run the following command:
mkfs.vfat -F32 /dev/sdb1
2.2.2: Format the Root Partition
- Run the following command:
mkfs.ext4 /dev/sdb2
Step 3: Updating and Synchronizing the Live Environment (Optional)
Before running the archinstall script, I recommend covering a few preliminary steps to ensure it doesn't fail. You can skip ahead to the installation section if you wish, but if you encounter any errors, return to this step and try again.
3.1: Keys Activation
- Run these two commands consecutively:
pacman-key --init
pacman-key --populate archlinux
3.2: Synchronize and Update the Local Package Database
- Run the following command:
pacman -Sy
3.3: Update the Keyring
- Run the following command:
pacman -S archlinux-keyring
3.4: Install or Update the archinstall Script
- Run the following command:
pacman -S archinstall
Step 4: Base System Configuration
Now, before initializing the installation of Arch Linux with the archinstall script, we need to mount our partitioned hard drives to the filesystem and configure base system settings inside the archinstall interface, such as hostname, create user, set user and root password, select bootloader, etc.
4.1: Run the archinstall Script
- Finally, run the following command to start the installer:
archinstall
4.2: Mounting Partitions
- Navigate to Disk Configuration and press Enter.
- Select Partition and press Enter.
- Select Manual Partitioning and press Enter.
- Choose the disk you partitioned for Arch Linux and press Enter; for me it's /dev/sdb.
4.2.1: Mount the Boot Partition
- Select the boot partition created in Step 1 (EFI System) and press Enter.
- Select Assign mountpoint and press Enter.
- When prompted, enter the mountpoint and press Enter:
/boot
4.2.2: Mount the Root Partition
- Select the root partition created in Step 1 (formatted as ext4) and press Enter.
- Select Assign mountpoint and press Enter.
- When prompted, enter the mountpoint and press Enter:
/
4.2.3: Confirm the Partition Layout and Exit
- If you created additional partitions (e.g., /home), mount them now in the same way.
- After mounting every partition, select Confirm and exit and press Enter.
- Select Back and press Enter to return to the archinstall main menu.
4.3: Disable Swap in archinstall
- Even if you didn't create a swap partition in Step 1, you still need to disable this option. Leaving it enabled can cause installation errors.
- From the archinstall main menu, select Swap and press Enter.
- On the prompted options, select no and press Enter.
4.4: Select a Bootloader
- Select Bootloader and press Enter.
- Choose GRUB and press Enter.
4.5: Set the Hostname
- Select Hostname and press Enter.
- Replace the default hostname (archlinux) with your desired hostname (e.g., MusaBase) and press Enter.
4.6: Set the Root Password
- Select Root password and press Enter.
- Enter a strong password for the root account, then re-enter it to confirm.
4.7: Create a User Account
4.7.1: Add a User
- Select Authentication and press Enter.
- Select User account and press Enter.
- Choose Add a user and press Enter.
- When prompted, type your username (e.g., john) and press Enter.
4.7.2: Set User's Password
- Enter a password for the new user and re-enter it to confirm.
- When asked "if you want to make this user a superuser (sudo)?", I am choosing yes.
- Choose yes or no according to your needs and press Enter.
4.7.3: Confirm and Exit User Settings
- Optionally create additional users. When finished, select Confirm and exit and press Enter.
4.8: Choose a Profile
- Select Profile and press Enter, then choose Type.
- Choose Minimal and press Enter.
4.9: Configure Audio
- Select Audio and press Enter.
- Choose an audio server. I'm going with pulseaudio, but you can pick the other option if you prefer.
4.10: Configure the Network
- Select Network configuration and press Enter.
- Choose NetworkManager. If you select another tool, ensure it's configured for internet access in the installed system.
Step 5: Install Arch Linux
I've left all other settings at their defaults such as the kernel and encryption options because I don't need them now. I'm not installing extra packages now; I'll add them after installation. Let's move on to the installation process:
- Select Install and press Enter.
- When prompted to confirm your configuration, choose yes and press Enter. The installation will then begin.
Reboot
- Once the installation finishes, you will be prompted to reboot.
- Reboot now to begin the next phase:
Step 6: Boot into the Freshly Installed Arch Linux System
After rebooting, you will see the GRUB menu with a few options:
Login with User Account
- Select Arch Linux and press Enter.
- After a few seconds, you will see the tty1 command-line login prompt.
- At the login prompt, enter the username and password you created during installation.
And there it is—you are logged into your minimal Arch Linux system. The beauty of Arch Linux is that you can choose each and every component for your system, such as Desktop Environment, Window Manager, Task Screen, and customize every tiny detail according to your needs.
Frequently Asked Questions: Automated Arch Linux Installation with archinstall
What is archinstall and why should I use it?
archinstall is the official menu‑guided installer for Arch Linux. It automates the installation process while still giving you control over key decisions like disk partitioning, bootloader selection, and package installation. It is perfect for users who want a fast, reliable, and optimized base system without spending hours on the manual installation steps. It follows the same principles as the manual method but saves time and reduces the chance of human error.
What are the prerequisites for using archinstall?
You need:
- An x86‑64 compatible processor.
- At least 512 MB RAM (2 GB or more recommended).
- At least 2 GB of free disk space (20 GB+ recommended for a full setup).
- A UEFI‑capable system (this guide is UEFI‑specific).
- A stable internet connection (Ethernet or Wi‑Fi).
- An Arch Linux bootable USB drive (created from the official ISO).
How do I boot into the Arch Linux live environment?
First, disable Secure Boot in your BIOS/UEFI settings. Then reboot and press the appropriate key (e.g., F9, F10, F11, F12, Del, or Esc) to enter the boot menu. Select your USB drive as the boot device. You will see the Arch Linux boot menu; choose Arch Linux install medium (x86_64, UEFI) and press Enter. After a few seconds, you will be at the command‑line live environment.
How do I manually partition my disk with cfdisk?
First, identify your target disk with lsblk. Then run:
cfdisk /dev/sdX
Replace sdX with your disk (e.g., sdb). Select gpt as the partition table. Then create:
- Boot partition: select free space, create a partition of 1 GB (or 512 MB), change its type to EFI System.
- Root partition: use remaining free space, create a partition of desired size (e.g., 15 GB).
- Swap partition (optional): if you want swap, create another partition (e.g., 4 GB) and change its type to Linux swap.
After creating all partitions, select Write, type yes, and then Quit.
How do I format the partitions after partitioning?
After partitioning, format each partition with the appropriate filesystem:
mkfs.vfat -F32 /dev/sdX1 # Boot partition (EFI System) mkfs.ext4 /dev/sdX2 # Root partition mkswap /dev/sdX3 # Swap partition (if created)
Replace sdX1, sdX2, sdX3 with your actual partition names (check with lsblk).
How do I update the live environment before running archinstall?
It is recommended (but optional) to update the live environment to avoid potential errors:
pacman-key --init pacman-key --populate archlinux pacman -Sy pacman -S archlinux-keyring pacman -S archinstall
This ensures you have the latest package databases and the most recent version of the archinstall script.
How do I run archinstall and mount my partitions?
Start the installer with:
archinstall
Navigate to Disk Configuration → Partition → Manual Partitioning. Select your disk (e.g., /dev/sdb). Then:
- Select the boot partition, choose Assign mountpoint, and enter /boot.
- Select the root partition, choose Assign mountpoint, and enter /.
After mounting, select Confirm and exit, then Back to return to the main menu.
Why do I need to disable swap in archinstall?
Even if you created a swap partition manually, you must disable the swap option inside archinstall to prevent installation errors. From the main menu, select Swap and choose no. The swap partition you created will be activated automatically during installation; you do not need to enable it separately.
How do I configure the bootloader in archinstall?
From the main menu, select Bootloader, then choose GRUB (for UEFI systems). This will install GRUB and configure it to boot your Arch Linux system.
How do I set the hostname, root password, and create a user?
In the archinstall main menu:
- Hostname: select it, replace the default with your desired hostname (e.g., MusaBase).
- Root password: select it, enter a strong password and confirm.
- Authentication → User account → Add a user: enter the username, set a password, and when asked if the user should be a superuser (sudo), choose yes. Finally, select Confirm and exit.
What profile should I choose in archinstall?
For a minimal base system, select Profile → Type → Minimal. This installs only the essential packages, leaving you with a clean foundation to build upon.
How do I configure audio and network in archinstall?
From the main menu:
- Audio: select it and choose your preferred audio server (e.g., pulseaudio).
- Network configuration: select it and choose NetworkManager. This will ensure your installed system has a working network manager.
How do I start the installation after configuring everything?
Once you have reviewed all your settings, navigate to Install in the main menu and press Enter. You will be asked to confirm the configuration; select yes. The installation will begin and may take a few minutes depending on your internet speed and hardware. After completion, you will be prompted to reboot.
What should I do after the first reboot?
After rebooting, you will see the GRUB menu. Select Arch Linux and press Enter. At the login prompt, enter the username and password you created. You will then be logged into your minimal Arch Linux system. From here, you can install additional packages, a desktop environment, or any other software you need.
What are the most common mistakes when using archinstall?
- Not disabling Secure Boot, causing boot failure.
- Forgetting to write partition changes in cfdisk (the partitions are not created).
- Not mounting the partitions correctly in archinstall (e.g., wrong mount points).
- Leaving the Swap option enabled when you already have a swap partition.
- Not setting a root password or not creating a user, leading to login issues.
- Choosing the wrong profile or network configuration, resulting in a system without essential tools or network access.
π Congratulations! Your Minimal Arch Linux system is now up and running!
You now have a clean and lightweight foundation. To keep your system healthy and secure, make sure to run sudo pacman -Syu regularly. From here, you can transform this minimal base into your dream workstation.
If you hit any snags, drop a comment below. I'm here to help!
101 out, I’ll see you in the next one! π






