Moving My LXC Containers from Debian to Alpine: Navidrome as an Example
How I rebuilt a Navidrome container on Alpine Linux in Proxmox, cutting the base image from 526 MB to 11.5 MB and the disk from 4 GB to 1 GB, plus the gotchas I hit on the way.
My home server runs every service in its own unprivileged LXC container on Proxmox. For a long time, every one of those containers started from the same template: Debian. It is the default, it is familiar, and almost every install guide assumes it.
But my server is a mini PC with 16 GB of RAM and a 1 TB disk, shared by more than fifteen containers. When I looked at what each container actually contained, most of it was an operating system the app never used. So I started moving small services to Alpine Linux. This article walks through one of them, Navidrome, my self-hosted music server.
Why Alpine
Alpine is a tiny Linux distribution built on musl libc and BusyBox, with OpenRC as its init system instead of systemd. For a container that runs one service, that is exactly what I want: the app, its few dependencies, and almost nothing else.
The difference starts at the template:
| Proxmox template | Download | Unpacked | |---|---|---| | Debian 13 standard | 130 MB | 526 MB | | Alpine 3.24 default | 3.4 MB | 11.5 MB |
The Alpine base is about 45 times smaller before anything is installed.
Why Navidrome was a good first candidate
Not every app is a good fit for Alpine. The main thing to check is musl vs glibc: software compiled against Debian's glibc may not run on Alpine at all.
Navidrome is an easy case:
- It ships as a single Go binary with no glibc dependency.
- Its only real dependency is ffmpeg (for transcoding), which Alpine packages.
- Its state is just a SQLite database and a small config file, so migrating means copying a few files.
Apps that are harder to move, like Jellyfin (.NET plus a custom ffmpeg build) or anything shipped as Debian packages, stay on Debian for now.
The migration
1. Create the Alpine container
I created the new container next to the old one, so I could switch back at any moment:
pveam update
pveam download local alpine-3.24-default_20261105_amd64.tar.xz
pct create 225 local:vztmpl/alpine-3.24-default_20261105_amd64.tar.xz \
--hostname navidrome --unprivileged 1 --ostype alpine \
--cores 2 --memory 225 --swap 256 \
--rootfs local-lvm:1 \
--net0 name=eth0,bridge=vmbr0,ip=<static-ip>/24,gw=<gateway> \
--onboot 1 --tags alpine
pct start 225
The old Debian container had a 4 GB disk. This one gets 1 GB, and 225 MB of RAM.
2. Install Navidrome
Inside the container, only ffmpeg comes from the package manager. Navidrome itself is the official release binary:
apk add --no-cache ffmpeg
adduser -D -H -s /sbin/nologin navidrome
mkdir -p /var/lib/navidrome /opt/navidrome/music /etc/navidrome
# download the linux_amd64 release from GitHub, then:
install -m 755 navidrome /usr/bin/navidrome
chown -R navidrome:navidrome /var/lib/navidrome /opt/navidrome
3. Write an OpenRC service
Alpine has no systemd, so the unit file becomes an OpenRC script. It is shorter than you might expect:
#!/sbin/openrc-run
name="navidrome"
description="Navidrome music server"
command="/usr/bin/navidrome"
command_args="service execute -c /etc/navidrome/navidrome.toml"
command_user="navidrome:navidrome"
directory="/var/lib/navidrome"
command_background=true
pidfile="/run/navidrome.pid"
output_log="/var/log/navidrome.log"
error_log="/var/log/navidrome.log"
start_pre() { checkpath -f -o navidrome:navidrome /var/log/navidrome.log; }
depend() { need net; }
chmod +x /etc/init.d/navidrome
rc-update add navidrome default
4. Move the data across
From the Proxmox host, pct pull and pct push copy files out of one container and into another, without SSH or network shares. I stopped Navidrome in the old container first so the SQLite database was in a consistent state, then copied the database and the config:
pct pull 125 /var/lib/navidrome/navidrome.db /tmp/navidrome.db
pct push 225 /tmp/navidrome.db /var/lib/navidrome/navidrome.db \
--user 101 --group 102 # the navidrome user's uid/gid inside the container
Then I started the service, logged in, and checked that my users, playlists and settings were all there.
5. Remove the old container
Only after the new container had run without problems did I destroy the Debian one with pct destroy.
The results
Measured on the running containers:
| | Debian container | Alpine container | |---|---|---| | Base template (unpacked) | 526 MB | 11.5 MB | | Root disk | 4 GB | 1 GB (217 MB used) | | RAM limit | | 225 MB | | Memory actually used | | ~52 MB | | Processes running | | 11 |
Navidrome itself uses about 38 MB. Most of the rest of the container's footprint is now the app, not the operating system around it.
Gotchas I hit
free lies inside the container. BusyBox's free reports the host's memory (16 GB) rather than the container's limit. /proc/meminfo, which Proxmox virtualizes through LXCFS, shows the real 225 MB. To see what a container really uses, read its cgroup from the host:
cat /sys/fs/cgroup/lxc/225/memory.current
No systemd habits. systemctl and journalctl don't exist. It is rc-service navidrome restart, rc-update and plain log files. If an app logs only to the journal on Debian, you have to point it at a file.
BusyBox tools are minimal. Commands like ps, grep and adduser are BusyBox versions with fewer flags. Scripts written for Debian sometimes need small changes, or the full package (apk add procps grep).
Check musl before you start. Run ldd on the app's binary first. If it links to glibc, either find a musl or static build or leave that app on Debian.
Was it worth it?
For small, single-binary services, yes. The container is smaller, boots faster, has fewer packages to patch, and is easier to understand because almost nothing in it is unrelated to the app. Since Navidrome I have moved several other small services the same way (cloudflared, Miniflux, qBittorrent and two of my own tools), and I keep Debian only where an app genuinely depends on it.
The lesson I took from it: the default template is a starting point, not a requirement. Picking the base image per service is one of the cheapest optimizations a homelab can make.