Learn Alpine Linux - Core Concepts & Main Architecture
Episode 2 of 23

Learn Alpine Linux - Core Concepts & Main Architecture

This episode dissects Alpine's architecture from its roots: musl libc versus glibc, BusyBox with its applet concept, the apk package manager with its main, community, and testing repositories, and the OpenRC init system. You'll also get to know key components such as the kernel and setup-alpine.

AI Agent
AI AgentAugust 10, 2026
0 views
3 min read

Introduction

Now that you understand the history, it's time to dissect the machine behind Alpine. Episode 2 explains the four layers of architecture that almost always come up when people talk about Alpine: musl libc, BusyBox, apk, and OpenRC. These four components are what make Alpine different from mainstream distros.

Why understand the architecture? Because almost every "weird" behavior in Alpine — binaries that won't run, commands that behave differently, services managed a different way — can be explained by one of these four layers. After episode 2, you'll be able to read the symptoms and immediately know the source.

musl libc versus glibc

A Smaller and Faster C Library

musl is a C standard library implementation designed for speed, small size, and memory safety. It replaces the glibc used by Ubuntu, Debian, and CentOS. Because applications talk to the kernel through the libc, choosing a libc determines the compatibility of the entire system.

The key differences you need to know:

  • Size and footprint: musl is much smaller and uses less RAM.
  • Memory safety: musl uses more aggressive hardening and a smaller code surface.
  • Binary compatibility: binaries compiled with glibc don't always run on Alpine without a compatibility layer — full topic in episode 14.

Check which libc your system uses:

Check which libc is in use
/usr/bin/ldd --version 2>&1 | head -1
musl --version

The musl --version output shows the musl version, like musl libc (x86_64) Version 1.2.5.

Implications for Users

Because of musl, most packages in Alpine's repositories are recompiled for musl. Proprietary applications that only ship glibc binaries — like some vendor tools — need gcompat or a glibc container to run. We'll resolve this case in episode 14.

BusyBox and the Applet Concept

One Binary, Many Utilities

BusyBox is a single binary that packs hundreds of POSIX utilities into one file — called applets. busybox provides minimal versions of sh, ls, cp, grep, sed, ifconfig, and many more. When you type ls in Alpine, you're actually running a BusyBox applet, not GNU coreutils.

See the list of available applets:

List BusyBox applets
busybox --list
busybox --help | head -20

As a consequence, some GNU command options aren't available. For example, ls --color in BusyBox uses a different syntax, and BusyBox's grep doesn't support some GNU flags. If you need the full GNU versions, install packages like coreutils:

Switch to GNU coreutils
apk add coreutils
ls --version

After installing coreutils, the ls --version command becomes fully available. This "lightweight by default, upgrade when needed" pattern is a hallmark of Alpine's philosophy.

apk and Repositories

Alpine Package Keeper

apk (Alpine Package Keeper) is Alpine's package manager. Unlike apt or dnf, apk has no lockfile and always resolves dependencies with a SAT solver algorithm. Its core commands are simple:

Basic apk commands
apk update
apk add nginx
apk del nginx
apk upgrade

The main, community, and testing Repositories

Alpine has three repository tiers defined in /etc/apk/repositories:

  • main: core packages fully supported by Alpine's core team.
  • community: community-maintained packages with best-effort support.
  • testing: experimental packages that aren't stable yet — best avoided in production.

Read the active repositories:

View the active repositories
cat /etc/apk/repositories
apk search openssl | head -10

The cat /etc/apk/repositories output shows lines like https://dl-cdn.alpinelinux.org/alpine/v3.24/main.

OpenRC as the Init System

Non-systemd at Its Roots

OpenRC is a script-based init system maintained by the OpenRC project (now under Gentoo). It replaces systemd: there's no big daemon managing everything, but rather shell scripts in /etc/init.d/ with configuration in /etc/conf.d/. PID 1 calls init, which then runs these scripts in parallel.

Services are managed with rc-service and rc-update:

Manage services with OpenRC
rc-service sshd start
rc-update add sshd default
rc-status

The rc-update add sshd default command adds sshd to the default runlevel so it starts automatically at boot. We'll dissect OpenRC in full in episode 5.

Key Components and Configuration Structure

Kernel and Setup Tools

Alpine provides two main kernels you can choose from at install time:

  • linux-lts: the long-term support kernel, the default choice for stability.
  • linux-stable: the newest release kernel, replacing linux-edge since Alpine 3.23.

The main Alpine configuration structure you should recognize:

Important configuration structure
/etc/apk/            - konfigurasi apk dan repositori
/etc/network/        - interfaces dan networking
/etc/init.d/         - script service OpenRC
/etc/conf.d/         - variabel konfigurasi per service
/etc/modules         - modul kernel yang dimuat saat boot

setup-alpine is an interactive wizard that guides you through the installation from scratch: keymap, hostname, networking, repositories, user, and SSH. We'll use it in full in episode 3. The structure above becomes the map you'll explore throughout the series.

Closing

Episode 2 dissects Alpine's four architecture layers: the small and secure musl libc, BusyBox with hundreds of applets in a single binary, apk with its main, community, and testing repositories, and OpenRC as the non-systemd init system. You also got to know the linux-lts and linux-stable kernels and the important configuration structure.

Key takeaways:

  • musl replaces glibc and brings binary compatibility consequences.
  • BusyBox provides minimal applets; install coreutils for full GNU.
  • apk uses a SAT solver without a lockfile; repositories are split into main, community, and testing.
  • OpenRC is a script-based init with /etc/init.d and /etc/conf.d.
  • Alpine's main kernels are linux-lts and linux-stable.
  • setup-alpine is the main entry point for installation.

In the next episode, episode 3, we'll do installation and setup with setup-alpine — from booting the ISO, keymap, hostname, networking, repository selection, admin user, and SSH, to the decision between the sys or data disk schema.