Terminal GuideTerminal Guide

Alpine Linux Guide

Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and BusyBox. It's the go-to choice for Docker containers due to its minimal footprint.

10 min readLast updated: January 19, 2026
Dai Aoki

Dai Aoki

CEO at init, Inc. / CTO at US & JP startups / Creator of WebTerm

Overview

Alpine Linux was created in 2005 from the LEAF Project. Its minimal design makes it extremely popular for containerized applications, where image size and security matter.

Quick Facts

Based OnIndependent (musl/BusyBox)
Package Managerapk (Alpine Package Keeper)
Default DesktopNone (server-focused)
Release CycleEvery 6 months
Support Period2 years per release
Init SystemOpenRC
Info
The base Alpine Docker image is only ~5MB, compared to ~70MB for Debian and ~25MB for Ubuntu minimal.

Who Should Use Alpine?

  • Container developers - Minimal images for Docker/Kubernetes
  • Embedded systems - Small footprint for IoT devices
  • Security-conscious users - Hardened by default
  • Minimalists - Build exactly what you need
  • Network appliances - Routers, firewalls, VPNs

Installation

Alpine uses a script-based installer:

  1. Download the ISO from alpinelinux.org
  2. Boot from the ISO (CD/USB)
  3. Login as root (no password)
  4. Run setup-alpine to start installation
  5. Answer configuration questions
bash
# Start Alpine installation
setup-alpine

# The script will ask about:
# - Keyboard layout
# - Hostname
# - Network configuration
# - Root password
# - Timezone
# - Mirror selection
# - Disk setup (sys, data, or diskless)

# For disk installation, choose 'sys' mode

Package Management

Alpine uses apk, a fast and simple package manager:

bash
# Update package index
apk update

# Upgrade all packages
apk upgrade

# Install a package
apk add package-name

# Remove a package
apk del package-name

# Search for packages
apk search keyword

# Show package info
apk info package-name

# List installed packages
apk list --installed

# Add from testing repository
apk add package-name --repository=http://dl-cdn.alpinelinux.org/alpine/edge/testing
Tip
Enable the community repository for more packages. Edit /etc/apk/repositories and uncomment the community line.

Key Features

musl libc

Alpine uses musl instead of glibc. It's smaller and more secure, but some glibc-specific software may require compatibility layers.

BusyBox

Single binary providing most Unix utilities. Reduces system size while maintaining functionality.

PaX/grsecurity

Hardened kernel with enhanced security features to prevent exploits.

OpenRC

Lightweight init system instead of systemd. Simple and fast boot process.

Alpine in Docker

Alpine is the most popular base image for Docker containers:

bash
# Simple Alpine Dockerfile example
FROM alpine:3.19

# Install packages
RUN apk add --no-cache \
    python3 \
    py3-pip

# Set working directory
WORKDIR /app

# Copy application
COPY . .

# Run application
CMD ["python3", "app.py"]

Alpine Docker Image Sizes

alpine~5MB
alpine + Python~50MB
alpine + Node.js~60MB
Compare: debian-slim~70MB (base only)

FAQ

Why doesn't my glibc application work?

Alpine uses musl, not glibc. Install gcompatfor compatibility, or use a glibc-based image for applications that require it.

Is Alpine suitable for desktops?

Alpine can run desktop environments, but it's not its primary use case. Some applications may have compatibility issues with musl.

How do I install bash on Alpine?

Alpine uses ash (from BusyBox) by default. Install bash withapk add bash if needed.

Summary

Alpine Linux excels in containerized environments where size and security matter. Key takeaways:

  • Extremely lightweight (~5MB base image)
  • musl libc for security and size benefits
  • apk package manager is fast and simple
  • Ideal for Docker and Kubernetes
  • Hardened kernel with PaX/grsecurity

Official Documentation

For authoritative information, refer to the official documentation:

Related Articles