banner alpine linux raspberry pi --Natalia Grela/Unsplash/ThomasDyan/RaspberryTips

I Ran Alpine Linux on Raspberry Pi for a Week—Here’s My Verdict

If you click our links and make a purchase, we may earn an affiliate commission. Learn more

While hunting for the leanest Docker containers for my Raspberry Pi, I noticed many images use Alpine Linux as a base. So I started to wonder: what is Alpine Linux? And can it run natively on Raspberry Pi? The answer is a resounding yes, and I’ll show you how.

Alpine Linux is installed on Raspberry Pi by flashing an installation image onto an SD card. Next, run the setup-alpine script to configure and install the system. Afterwards, the rest of the OS can be customized for its intended use case.

Read to learn why Alpine Linux is a great fit for your Raspberry Pi. I’ll also lead you through how to install it. And at the end, I’ll give you my opinions on what Alpine Linux is great for and how you might take advantage of its special disk modes.

If you’re new to Raspberry Pi or Linux, I’ve got something that can help you right away!
Download my free Linux commands cheat sheet – it’s a quick reference guide with all the essential commands you’ll need to get things done on your Raspberry Pi. Click here to get it for free!

Why Alpine Linux is Perfect for Raspberry Pi

alpine linux logo

Alpine Linux is an ultra-low resource operating system. It uses a special combination of toolkits with minimal installation to keep things lean.

What’s Different About Alpine Linux?

What makes Alpine Linux different?
Alpine Linux has a foundation made of lightweight alternatives.
Let’s compare it to other Debian-based distros:

Other Linux Distros
(e.g., Raspberry Pi OS)
Alpine Linux
Init SystemsystemdOpenRC
Base UtilitiesGNU CoreutilsBusyBox
C-Libraryglibcmusl libc

How do these choices lead to a lightweight OS? OpenRC uses less memory and storage while requiring fewer libraries. BusyBox is a single binary containing many system utilities in one. And using musl to compile programs means less code and dependency bloat.

These choices create tradeoffs, though, which I’ll mention as we go along.

Benefits of Alpine Linux on Raspberry Pi

alpine linux being put on raspberry pi

You might be starting to guess why Alpine Linux is a perfect fit for the Raspberry Pi:

  • Speed and efficiency: Alpine Linux boots quickly and runs well on low-powered ARM hardware like the Raspberry Pi. Its package manager, APK, is also surprisingly nimble.
  • Minimal resource usage: A base install takes up only 50 MB of disk space and 50 MB of memory. That’s amazing for mini projects where every bit of performance matters.
  • Security: Alpine Linux has a hardened kernel and a reduced attack surface. Both are great for security when using a Raspberry Pi for network projects.
  • Customizable: It starts with almost nothing installed, so you can customize the OS however you’d like; this is a great fit for how the Raspberry Pi is used for all sorts of missions.
  • Special disk modes: These special modes will let you create servers, embedded devices, and remote sensors that run entirely from RAM. More on that later.

Before we discuss use cases, let me show you how to install it first. The official instructions for getting it onto the Pi were confusing when I tried it, so I wanted to create a guide for all Raspberry Pi fans out there.

Prefer reading without ads and popups?
Members get an ad-free version of every guide, plus exclusive project support.
Join the Community | Sign In

Prerequisites for Alpine Linux on Raspberry Pi

The minimum requirements to install Alpine Linux on Raspberry Pi are easy to meet:

  • Raspberry Pi – There’s an Alpine version available on Raspberry Pi Imager for almost every board, including the Raspberry Pi 5, Pi 4, Pi 3, Pi 2, Pi 1, and Pi Zero variants.
  • Memory – 256 MB. The boards listed above all have enough memory to start, but you’ll need more if you plan on running a graphical desktop environment (2 GB) or for other uses.
  • SD card storage – 100 MB. That’s all you need to flash the image and install the base system. You can also flash it on other storage media like USB, SSD, or NVMe.
  • Internet connection – The method in this guide requires an internet connection
    (Advanced users can find ways around this if needed).
  • Raspberry Pi Imager – The software you’ll use to flash Alpine Linux onto your SD card.

Steps to Install Alpine Linux on Raspberry Pi

All right, so you’ve got the hardware ready, what’s next?
Keep these big picture steps in mind to install Alpine Linux onto Raspberry Pi:

  • Flash the Alpine Linux image onto an SD card.
  • Run the alpine-setup script to configure and install the system.
  • Boot into the new system to complete post-installation.

Let’s go over each one in detail.

1 – Flash Alpine Linux onto an SD Card

To get started, flash Alpine Linux onto your Raspberry Pi’s storage device.

Alpine Linux has an installation image directly available in Raspberry Pi Imager.
The 64-bit version of Alpine Linux supports Raspberry Pi 5, Pi 4, and Pi 3.
There are also 32-bit versions available for other boards.

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

Here’s how to use Imager to flash Alpine Linux:

  • Launch Raspberry Pi Imager from your Linux, Windows, or MacOS device.
  • CHOOSE DEVICE to filter for your Raspberry Pi model.
  • CHOOSE OS > Other general-purpose OS > Alpine Linux:
    alpine linux options for different pi boards
    Select the version that matches your Pi model. I chose the 64-bit option.
  • CHOOSE STORAGE to select the SD card (or other storage) to write to.
    write alpine linux with raspberry pi imager
  • Click NEXT to proceed.
    When asked to confirm, choose Yes. Imager will begin writing the image.
    If your system (like Windows) interrupts to ask about formatting, ignore it.

Flashing should finish almost instantly—the image is less than 100 MB.

Note: As of this writing, Imager doesn’t offer “OS customisation settings” for Alpine Linux. It doesn’t offer to activate SSH or Wi-Fi beforehand. But if you need it, I’ve put instructions for a headless install in the FAQ section at the end.

Now that you’re done, insert the SD card into your Raspberry Pi.
Connect a monitor and keyboard.
Power on, and you’re ready for the next phase.

2 – Run the Alpine Linux Setup Script

Next, you’ll configure and install Alpine Linux on Raspberry Pi with a setup script.
After your Pi powers on, you should see a welcome screen:

alpine linux installation image welcome screen

Log in as ‘root’—the default password is empty, so it should let you in.

Yep, you’re going to start with only a command line; after all, Alpine Linux is minimalist.

Setup-Alpine

On Alpine Linux, many system tasks are done via setup scripts.
To start the system configuration, enter this command:
setup-alpine

You’ll be prompted with questions to configure your base install.
[The default choices are in brackets.]

Here’s an example of how to answer each question for Raspberry Pi:

  • Keymap: Choose from the options that match your keyboard layout.
    (I entered ‘us’ and then ‘us’ again.)
  • Hostname: Give your system a name.
    setup-alpine hostname
  • Interface for internet access.
    • Which one do you want to initialize? Enter eth0 for Ethernet; wlan0 for Wi-Fi.
      I highly recommend using Ethernet for this part, if you have it, to save time.
      If Wi-Fi fails, it doesn’t recover too well. To retry, reboot and run setup-alpine again.
    • IP address for wlan0/eth0: dhcp.
    • After setting up one interface, it’ll ask to initialize other interfaces.
      You only need 1 internet connection, so enter: done.
      setup-alpine internet connection
    • Do you want to do any manual network configuration? no.
    • At this point, the script will try to connect to your router and get an IP address.
      If it fails, figure out why. Reboot and run setup-alpine again until it succeeds.
      It’s much easier to complete the installation with a working internet connection.
  • Root Password: Set an admin password.
  • Timezone: UTC is fine as a default for a server.
    But if you want a desktop system, you can choose options here to set your local time.
  • Proxy: none.
  • Network Time Protocol: chrony.
    setup-alpine proxy and time
  • APK Mirror: f to to find the fastest mirror for package downloads.
    This choice is also good for verifying that the system’s internet is working.
    If this step fails, figure out why, reboot, and run setup-alpine again.
    setup-alpine package mirrors
  • User
    • Setup a user? no.
      It’s easier to do later; I’ll show you how after we’re done.
    • Which SSH server? openssh.
      If you don’t need remote access to your Pi, enter none instead.

Disk & Install – Configuration for a Traditional User System

Since this guide is meant for beginners, we will install Alpine Linux in System Disk Mode.
It will install a familiar user-based system that saves files between reboots.

Note: Alpine Linux can be installed in 3 different modes.
If you’re curious about what the other ones do, see our FAQ on disk modes at the end.

To install Alpine Linux in System Disk Mode, answer the following way:

  • No disks available. Try boot media /media/mmcblk0? yes.
    setup-alpine system disk mode installation 1
  • Which disk would you like to use? mmcblk0.
    (If installing on something other than SD card, type ‘?’ to see device names.)
  • How would you like to use it? sys.
  • Erase the above disk and continue? yes.setup-alpine system disk mode installation 2
  • A progress bar will appear while new partitions are being created.
    When it’s done, you’ll get a success message.
    setup-alpine system disk mode installation 3
  • Restart your system:
    reboot now

You’ve completed the configuration! The next time your Raspberry Pi starts up, you’ll be in your new Alpine Linux system for the first time.

3 – First Boot – Alpine Linux on Raspberry Pi

Boot into your new system and let’s go!

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

Check out how little disk space and memory Alpine Linux uses so far, less than 50 MB of RAM:

In this section, I’ll give you a rundown of typical things to configure on a brand new system. Alpine Linux’s goal is to be minimal and customizable, so it’s completely up to you what you want to install based on what you plan to use it for!

Creating a User Account

To create a user account with admin privileges, run the setup-user script:
setup-user -a <username>

Set the new user’s password:
passwd <username>

alpine linux create user

Now you can log out and login again as your new user, or switch to the new account:
su <username>

On Alpine Linux, you don’t use the sudo command by default.
Instead, use doas to execute commands with elevated privileges.
The doas package should already be installed.

For example, let’s set permissions to make our home folder unreadable by others:
doas chmod o-rx /home/pat

Quick note: If you find it hard to remember all these commands, I’ve put them all on a one-page cheat sheet. You can download it for free here so you have it handy whenever you're working on a project.

Using the Package Manager

Alpine Linux doesn’t use APT as the package manager, like on Raspberry Pi OS.
Instead, Alpine Linux uses a lightning-fast package manager called APK.
Luckily, APK has similar syntax to APT (but you’ll prefix it with doas instead of sudo).

Update the system:
doas apk update
doas apk upgrade

Search for a package:
apk search [pkg_name]

Install a package:
doas apk add [pkg_name]

Remove a package:
doas apk del [pkg_name]

Optional: Connecting to Wi-Fi

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

If you finished the installation using Ethernet, you can now add Wi-Fi if needed.
Just run this setup script:
doas setup-interfaces

And when asked which interface to initialize, enter: wlan0.

alpine linux setup-interfaces for wifi connection

Follow the prompts to connect to your Wi-Fi network.
Afterward, you can view your Pi’s local IP address:
ip a

After you’re all done, you might want to install NetworkManager to make connecting easier in the future.

Other Useful Setup Scripts

So your Alpine system is humming along nicely. But what if you need to change something? In that case, you don’t need to run setup-alpine again. Try these standalone scripts instead:

  • setup-keymap: Select your keyboard layout.
  • setup-hostname: Change your system name.
  • setup-apkrepos: Choose your preferred repo mirror.
  • setup-user: Create a new user.
  • setup-sshd: Install an SSH server.
  • setup-timezone: Change the system’s time zone.
  • setup-ntp: Synchronize the system time.
  • setup-interfaces: Establish Ethernet or Wi-Fi connections.
  • setup-dns: Set custom DNS servers.
  • setup-proxy: Establish a default proxy.
  • setup-desktop: Install a desktop environment.

You can see what other setup scripts are available here.

That’s it, you now have a working Alpine Linux system!
For ideas of what you can do with it, keep scrolling.

Going Further – My Experience With Alpine Linux

In this section, I’ll try to give some ideas of what people often use Alpine Linux for.
I’ll also share my early impressions from trying it out myself.

Host Servers

raspberry pi servers -- Jainath Ponnala / Unsplash

A lean and efficient OS like Alpine Linux is perfect for self-hosting headless servers.
The Alpine Linux Wiki is rich with guides to running self-hosted services that you can follow.

My Verdict: Excellent. I was able to get a lighttpd web server and database quickly, about five minutes each. And both were very snappy and responsive. I liked that Alpine Linux uses older but easier conventions, such as storing plain text logs in /var/log and managing services with OpenRC.

If you plan to use your Pi as a server only—and if it has enough RAM—this might be the perfect use case for running Alpine Linux in Data Disk Mode to max out performance.

Use Alpine Linux as a Daily Driver

Alpine Linux supports many desktop environments. But to keep in line with the theme of being lightweight, I decided to try installing XFCE.

Getting XFCE to load on Raspberry Pi isn’t as easy as one might expect. You must enable the ‘community’ repo, create a custom /boot/usercfg.txt, and install eudev, D-bus, and graphics drivers. After all of that, you can finally run the setup-desktop script. Phew.

alpine linux install xfce desktop environment script

My Verdict: Doable but takes work. Personally, I would give it a try, as the process will teach you a lot about how Linux works under the hood. It reminds me of the philosophies of Arch Linux, Gentoo, or Alma Linux—and their challenges.

But if you want something plug-and-play for your daily driver, Alpine Linux will be frustrating. For instance, graphical programs are built with musl instead of glibc; although packages found in the default repo work just fine, you’ll need to use flatpak to install other popular desktop apps.

Create a Container Playground

Lost in the terminal? Grab My Pi Cheat-Sheet!
Download the free PDF, keep it open, and stop wasting time on Google.
Download now

Some users love to make an Alpine Linux server where everything runs via containers. That’s because many Docker containers are actually native to Alpine Linux, as it’s often used as the base for images.

Using this approach, you can create a tiny system that is portable and reproducible.

My Verdict: Excellent. After installing Docker, I got containers up and running with ease. You can go nuts here. For suggestions on what containers to run, check out my list at the end of our guide to using Docker Compose or check out our list of 11 Docker Projects Every Raspberry Pi Owner Should Try.

Run Embedded Systems

health robot -- Jonny Gios / Unsplash

One of the most unique things about Alpine Linux is its ability to run in Diskless Mode.
In Diskless Mode, the entire OS runs from RAM and restores to a fixed state upon reboot.

My Verdict: Excellent. Alpine Linux is perfect for robots, routers, IoT devices, and kiosks. It’s lightning fast to run from memory only, and a reboot fixes anything users might break. Some possibilities include creating digital signage, a WireGuard VPN, or Unbound DNS server.

That about wraps it up. Before we part ways, here are more project ideas to try with Alpine Linux on Raspberry Pi. After my time with this little-distro-that-could, I think Alpine Linux can give Raspberry Pi OS Lite a run for its money!


🛠 This tutorial doesn't work anymore? Report the issue here, so that I can update it!

Want to connect with other Raspberry Pi fans? Join the RaspberryTips Community. Ask questions, share your projects, and learn from each other. Join now.

FAQ for Alpine Linux on Raspberry Pi

What do the different disk modes do?

System Disk Mode: In this mode, Alpine Linux is installed onto a regular storage device. Similar to most Linux systems, user files can be saved and are kept between reboots.

Diskless Mode: In this mode, Alpine Linux is loaded into memory and runs 100% from RAM. Any changes made to the system, like user files, are lost when rebooted. To make changes permanent, you can issue a command to ‘freeze’ the system in a specific state.

Data Disk Mode: This mode is between the two above. In this mode, Alpine runs almost entirely from RAM, but the /var folder is mounted onto storage. Here you can save logs or other files that you want to keep between reboots.

Can I do a headless install of Alpine Linux on Raspberry Pi?

Yes. To do a headless install of Alpine Linux, you’ll need to add extra file(s) to the SD card.

To make SSH available on first boot:

  • Download headless.apkovl.tar.gz from the macmpi GitHub.
  • Copy this file—don’t extract it—to the root folder of the SD card with Alpine Linux.

Ethernet will work automatically. You’re done.
(I recommend Ethernet, as Wi-Fi worked on boot but had issues.)
If you absolutely need a headless Wi-Fi installation, add the extra steps below.

To make Wi-Fi available on first boot:

  • Create a file named wpa_supplicant.conf and paste in the following details:
country=US

network={
key_mgmt=WPA-PSK
ssid="mySSID"
psk="myPassphrase"
}
  • Replace US with your country code, mySSID with your network name, and myPassphrase with your Wi-Fi password.
  • Copy wpa_supplicant.conf to the root folder of your SD card with Alpine Linux.

Now you’re ready to start the Alpine Linux installation in headless mode:

  • Insert the SD card into your Raspberry Pi and power on.
  • Find its IP address from the router’s admin panel or with the RPTips App on your phone.
  • Use SSH to connect, and continue with the setup-alpine instructions in this guide.

Whenever you’re ready, here are other ways I can help you:

Test Your Raspberry Pi Level (Free): Not sure why everything takes so long on your Raspberry Pi? Take this free 3-minute assessment and see what’s causing the problems.

The RaspberryTips Community: Need help or want to discuss your Raspberry Pi projects with others who actually get it? Join the RaspberryTips Community and get access to private forums, exclusive lessons, and direct help.

Master your Raspberry Pi in 30 days: If you are looking for the best tips to become an expert on Raspberry Pi, this book is for you. Learn useful Linux skills and practice multiple projects with step-by-step guides.

Master Python on Raspberry Pi: Create, understand, and improve any Python script for your Raspberry Pi. Learn the essentials step-by-step without losing time understanding useless concepts.

You can also find all my recommendations for tools and hardware on this page.

Similar Posts