Alpine Linux

How to Install Alpine Linux in 5 Minutes

A field-tested, step-by-step guide. How to Install Alpine Linux in 5 Minutes — prerequisites, the actual commands, verification, and links to related Alpine Linux topics.

Published
Updated
Reading time
3 min read
How to Install Alpine Linux in 5 Minutes
Photo by Praveen Thirumurugan on Unsplash

Alpine Linux is built on musl libc and BusyBox, weighs about 130 MB installed, and is what most production Docker images use as a base. This guide installs it on a VM in ~5 minutes.

Prerequisites

  • A VM with 256 MiB RAM and 1 GiB disk (Alpine truly is that small).
  • alpine-virt-3.20.x-x86_64.iso from alpinelinux.org/downloads/ (or alpine-standard for bare metal).

Step 1: Boot the ISO and log in

Boot the ISO. Log in at the prompt as root (no password).

Step 2: Run the installer

setup-alpine

Walk through the prompts:

  • Keymap: us then us
  • Hostname: alpine-host
  • Network interface: usually eth0; pick DHCP for lab, manual IP for production
  • DNS: 1.1.1.1 8.8.8.8
  • Timezone: Asia/Riyadh
  • Proxy: none
  • Mirror: f to find fastest, or pick a regional mirror
  • SSH server: openssh (default)
  • NTP client: chrony
  • Disk: pick your target disk
  • How to use it: sys for an installed system (not lvm or data)
  • Confirm — Alpine partitions, formats, copies the system over

After a couple of minutes it tells you to reboot. Remove the ISO first:

reboot

Step 3: First login

Log in as root with the password you set during setup-alpine.

Step 4: Create an operator user

apk add sudo
adduser ops
adduser ops wheel
echo '%wheel ALL=(ALL) ALL' > /etc/sudoers.d/wheel

Push your SSH key from your workstation:

ssh-copy-id ops@alpine-host

Edit /etc/ssh/sshd_config:

PermitRootLogin no
PasswordAuthentication no
PubkeyAuthentication yes
rc-service sshd restart

Alpine uses OpenRC, not systemd. rc-service, rc-update, rc-status replace systemctl.

Step 5: A baseline of useful packages

apk update
apk upgrade
apk add bash vim curl htop git bind-tools tzdata ca-certificates iptables-openrc

bash is not installed by default — Alpine ships ash (BusyBox). If your scripts need bash, install it explicitly.

Step 6: Firewall

apk add awall
modprobe ip_tables
rc-update add iptables boot
rc-update add ip6tables boot
rc-service iptables start

A minimal awall config — /etc/awall/private/main.json:

{
  "description": "skyline minimal",
  "zone": {
    "internet": { "iface": "eth0" }
  },
  "policy": [
    { "in": "internet",  "action": "drop" },
    { "in": "_fw",       "action": "accept" }
  ],
  "filter": [
    { "in": "internet", "out": "_fw", "service": "ssh",  "action": "accept" },
    { "in": "internet", "out": "_fw", "service": "http", "action": "accept" },
    { "in": "internet", "out": "_fw", "service": "https","action": "accept" }
  ]
}
awall enable main
awall activate

Verify

cat /etc/alpine-release
uname -a
rc-status
apk info | wc -l

Conclusion

Alpine installs in under five minutes and runs at a fraction of the disk + RAM of a traditional distro. The cost is musl libc — some Linux binaries built against glibc will not run unmodified. For Docker base images it is the default; for production VMs it is excellent when you control your own builds.

Next steps

SKYLINE Engineering

@skyline

The engineering team at SKYLINE Industrial Solutions. We publish field-tested guides drawn from real KSA and GCC deployments.

See author profile
SKYLINE engineering services

Need this implemented for you?

Reading is free — building it right takes a team. SKYLINE engineers ship Alpine Linux for Aramco vendors, banks, hospitals and government agencies across Saudi Arabia. Talk to us before you start.

Aramco Approved Contractor ISO 9001 · ISO 27001 SAMA CSF aligned NCA ECC ready 247+ KSA clients

Comments

0 total · 0 threads
Be the first to leave a comment.