How to Automate a Minimal Arch Linux Installation with archinstall Script
arch linux archinstall automation cli tools howto linux installation minimal linux system setupThe 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 & 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 & 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 & 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 & Exit
- 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.
π 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! π







