1. Home
  2. Linux
  3. How to install alpine linux

How to install Alpine Linux

Alpine Linux is a lightweight, security-based Linux operating system. It doesn’t use the GNU C Library and instead uses Musl Libc. As a result, it is lightning-fast and perfect for headless servers, embedded systems, and desktop/laptop workstations that require a low footprint. Here’s how to install Alpine Linux on your system.

How to download Alpine Linux

You’ll need to download Alpine Linux from the official website as an ISO file so that it can be flashed to a USB drive for installation purposes. To get your hands on Alpine, go to the official website.

Once you’ve made it to the official Alpine Linux website, click on the menu in the upper-right-hand corner, and select “Downloads.” Choosing “Downloads” will take you to the official Alpine Linux downloads page.

On the downloads page, locate “Extended,” and download the version that matches your desktop or laptop best. The ISO image is tiny — under a gigabyte. So the download process should be relatively quick.

How to create a bootable Alpine Linux installer

Like any other Linux OS, Alpine Linux needs to be installed via an ISO on a USB flash drive. To create a USB flash drive, start by downloading the latest version of Etcher. This program will help you easily create a bootable USB. Best of all, Etcher works on Mac OS, Windows, and Linux.

After you’ve downloaded the Etcher application, install it and launch it on your computer. Once it is launched, follow the step-by-step instructions below to learn how to create your bootable Alpine Linux USB installer.

  1. Find the “Select image” button in the Etcher application, and click on it with the mouse. After you select this button, a pop-up window will appear. Browse for your Alpine Linux ISO file, and select it. When you select it, Etcher will know to use it for your USB.
  2. Find the “Select drive” button, and choose your USB flash drive. Once chosen, Etcher will mount it as the device to flash the Alpine Linux ISO onto.
  3. Find the “Flash!” button, and click on it with the mouse to begin the flashing process. This process will take a couple of minutes, as data transfer over USB takes time. When the process is complete, close the Etcher app.

Once you’ve finished creating your Alpine Linux USB installer, reboot your computer and load it into the BIOS. Inside the BIOS, configure it to boot from USB. Once configured to boot from USB, you’ll be able to load up the Alpine Linux installer.

How to install Alpine Linux

To install Alpine Linux, you’ll need to first log into the cli console, as Alpine boots as a terminal, with no desktop or anything like that. To log in, enter the username “root”. A password is not required.

root

Now that you’ve logged in, it is time to begin the installation process. Run the setup-alpine command. This command will start up the Alpine Linux installer. Once you’ve run this command, you’ll be asked to choose a keyboard layout region. Look at the available layouts, and enter one.

After selecting your layout region, you’ll be shown various popular layouts related to this region. Choose the one that suits you best. Press Enter after writing in your selection.

You’ll now need to configure your Alpine Linux OS’s hostname. To do this, simply write your hostname into the installation prompt. However, keep in mind that you’ll need to keep it all lowercase letters.

With your hostname taken care of, it is time to configure the network in Alpine. Allow the installer to detect your ethernet adapter (for WiFi check the manual.) Once it’s detected your networking device, press Enter to confirm you wish to initialize it.

After pressing Enter, you will be asked to configure an IP address for the device on Alpine. Enter “dhcp.” However, if you are an expert, feel free to enter a custom IP. When you’ve entered “dhcp,” Alpine will ask if you wish to do any manual networking configuration. As you are using “dhcp,” select “n.”

You must now enter a root password. Enter something memorable, but secure. Once the password is entered, you’ll need to choose a timezone. Type ? to view the zones. Or, leave it as default with UTC.

With the timezone configured, set up any proxy configurations (if needed.) Then, choose your Alpine Linux mirror. Enter the number that corresponds to the Alpine Linux mirror you wish to use. Alternatively, press f to automatically detect the best mirror.

When you’ve set up your mirrors, Alpine will ask you to set up a user account. Enter your preferred username. Or, if you do not want a user, write “no.” After setting up your user, choose a type of SSH client. We reccomend “openssh.”

With SSH taken care of, Alpine will ask what disk you would like to install the OS on. It’ll show you all available disks that can be used. Enter the disk you wish to use or type ? for help.

Once you’ve chosen your disk, type in “sys” to tell Alpine Linux you wish to use it for the system. If you are an expert, consider tinkering with the other available options, such as “data,” “crypt,” etc. When you’ve made your selection, Alpine Linux will install itself. When the installer is complete, reboot.

How to setup a desktop on Alpine Linux

Alpine Linux is installed in terminal-only mode, which is fine if you plan to use it as a server. However, if you want to use Alpine on the desktop, you will need a desktop environment. To start, log into the “root” account with the password you set during the installation process.

root

Once you’ve logged in, use the Alpine Linux package manager to set up Xorg. This is needed to view graphics on your system.

Note: if you use Intel or AMD, Alpine will load your graphics drivers automatically through the Linux kernel after setting up a desktop environment.

apk update

setup-xorg-base

After setting up the Xorg windowing system and basic graphics drivers, you’ll want to install a desktop environment. Follow the commands below to set up a desktop.

XFCE

apk add xfce4 xfce4-terminal lightdm lightdm-gtk-greeter

rc-update add lightdm default

service lightdm start

LXQt

apk add lxqt lxqt-qtplugin lxqt-themes sddm sddm-kcm

rc-update add sddm default

service sddm start

MATE

apk add mate mate-desktop mate-desktop-lang mate-icon-theme mate-terminal lightdm lightdm-gtk-greeter

rc-update add lightdm default

service lightdm start

Cinnamon

apk add cinnamon cinnamon-lang lightdm lightdm-gtk-greeter

rc-update add lightdm default

service lightdm start

Gnome Shell

apk add gnome-desktop gnome-terminal gdm

# Add LightDM to default runlevel
rc-update add gdm default

# Start LightDM service
service gdm start

KDE Plasma

apk add plasma-desktop plasma-wayland-session kde-applications sddm sddm-kcm

rc-update add sddm default

service sddm start

Once you’ve got a desktop environment installed, you’re ready to start using your Alpine Linux PC.