Featured image of post Install Alpine Linux with a desktop environment

Install Alpine Linux with a desktop environment

Alpine Linux is a small, simple and secure distro that uses musl, busybox and openrc. Mostly designed to be used in containers but definitely can be used as a regular Desktop operating system.

don’t mind the thumbnail. just a big james lee fan :3c

Talking about Alpine

Alpine is a very interesting distro. And also different from the rest. No systemd, instead it uses OpenRC, musl C library instead of glibc and busybox instead of GNU. It can be used for various different things, like as a webserver, in embedded systems and IoT devices, containers and even as a minimal and lightweight desktop OS. If you don’t do much on your computer, or you want to make an old and slow computer somewhat usable, it’s not a bad choice since they provide 32-bit x86 ISOs.

Installing Alpine is pretty simple, and a desktop is even easier, but their wiki… isn’t the greatest in terms of layouts, and there’s a lot of information that a regular desktop user wouldn’t really care about since again, Alpine linux is really meant to be used in servers, embedded devices etc.

This post will guide you to installing and configure a basic desktop environment in Alpine Linux.

Some things to note before starting

Alpine uses it’s own package manager called apk. The way you install packaged is a bit unusual, you’re not installing them, but instead “adding” them.

Some basic commands:

doas apk add <package-name> to install package(s),

doas apk del <package-name> to remove package(s),

doas apk update && doas apk upgrade to update the system and

apk search <package-name> to search for package(s).

Oh yeah, since Alpine is aiming to be simple and minimal, no sudo here! It uses doas which is a minimal alternative to sudo. Of course you can create an alias if you can’t get used to typing doas instead of sudo, but you can also install the doas-sudo-shim package to run sudo-like commands using doas.

Alpine uses OpenRC instead of systemd, which as you could’ve guessed is a minimal init system compared to systemd. An excellent choice for a distro like Alpine. OpenRC is also used in Gentoo aswell.

Here’s a list of basic commands that you should know:

doas rc-service <service> start to start a service,

doas rc-service <service> stop to stop a service,

doas rc-update add <service> default to start the service at startup, and

doas rc-update del <service> default to prevent the service from running at startup.

Installing Alpine

⚠️ If you’re using an NVIDIA GPU, you’re basically stuck with using open source drivers which are terrible. If you’re using something like a GT 1030, you’d be fine with desktop graphics and video playback but anything more and you’re gonna suffer. Like suffer a lot.

Head over to the Alpine linux website and download the ‘standard’ ISO. Note the ISO size

Either burn it to a USB flash drive and boot it on real hardware or boot it from a VM.

It should boot in under 10 seconds.

From here, we need to login. Just login as root. There is no password for the root user.

Afterwards, run the setup-alpine script and follow the instructions the installer prompts you. On most prompts you just have to press Enter since the defaults are good enough.

ℹ️ I can’t provide instructions on getting connected to a Wi-Fi network. Just type in the name of the wireless interface when you’re asked for a network interface and connect to a Wi-Fi network.

Oh and make sure when putting in your timezone to put the / as the last character if it shows as such in the list, otherwise you might break something.

When you’re asked about the mirrors, first type in c to enable the community repository, then type f to use the fastest mirror available, or just use the default option given.

After selecting mirrors, enter a username for a user when prompted.

You will also be asked if you want to install a SSH server on the system. I chose not to since i never use SSH on real hardware and i don’t need one in a temporary VM.

Afterwards you will be asked what disk to install Alpine onto. Simply type in the name of it in the list, then type in sys for how you want it to be used.

Finally, answer y to erase the drive and install Alpine.

The installation process should take around 10 seconds, and once it’s done, just reboot the system.

Getting a desktop setup

Once rebooted, login as the root user so you don’t have to use ‘doas’, and type in setup-desktop. You can choose whatever desktop you like. I’m gonna pick GNOME because :3c

After installing a desktop, i highly advise to follow additional steps on the wiki for your desktop in case you want to add features that are missing from the install, like a video driver for your specific GPU (apk search xf86-video) and also input drivers (apk search xf86-input)

Make sure that networkmanager, dbus, elogind and a display manager are enabled in OpenRC and that dhcpcd is disabled on startup since we won’t need it anymore.

You should also check if any packages are missing (like pipewire, pipewire-pulse and wireplumber, a file manager, terminal and web browser) and should install them now.

ℹ️ It is possible that some desktop choices don’t use NetworkManager and instead use dhcpcd for connecting to the internet. In that case, install NetworkManager and a applet if needed and enable it on startup and disable dchpcd.
If you’re connecting via Wi-Fi, follow these instructions to make sure NetworkManager can connect to Wi-Fi.

You should also copy over default pipewire and wireplumber configs:

1
2
3
4
5
6
#!/bin/bash
# Don't include comments

# Assuming you're root
cp -a /usr/share/pipewire /etc
cp -a /usr/share/wireplumber /etc

Finally restart to see if you’ve done everything correctly.

yippiiiieeeeeeeee 🎉

And on the desktop! Nice.

what

what

Anyways, from here you can configure the desktop to your liking and also install Flatpaks in order to use proprietary software like Steam and Discord. They have detailed instructions on getting Flatpaks setup and configured on the wiki.

Also a firewall, NEVER forget to install a firewall.

Yeah, unfortunately no GUFW, so you basically have to set up UFW from the CLI which isn’t a painful process:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
#!/bin/bash
# Don't include comments

# Assuming you're root
apk add ufw
ufw enable
ufw default deny incoming
ufw default allow outgoing
rc-update add ufw default
rc-service ufw start

Wrapping up

That’s basically it. There’s not much that you can do on Alpine besides use it as a minimal desktop distro. There aren’t a lot of packages at your disposal so you pretty much have to rely on Flatpaks, and if you want to use, nix aswell.

If i used Alpine more i’d definitely have more to say about it but since i have an NVIDIA GPU, i really can’t do much.

Definitely recommend it on a low-end computer especially since it has 32-bit ISOs and is very fast and minimal.

Any other info you need to know about the distro can be found on their wiki which in my opinion, it’s a great site for knowing how to do stuff on Alpine, but the installation guide is so bloated with information that sysadmins/sysops only care about. That’s why i wrote this guide in the first place.

please send me an email if you encounter an oddity in the guide or you hit some weird and arbitrary roadblock.

Maintained on EndeavourOS. Greetings from 🇷🇸
Built with Hugo
Theme Stack designed by Jimmy
Contact me via e-mail!

Feed of cool peeps:
OMG HAIIIIIII :33333333