Is Alpine on server a good idea?
-
- Offline
- 1 month 3 weeks ago
- 2017-09-19
I read a few posts about Alpine, which claim that this system is your best option if you want to avoid systemd.
Before I start to install it on my home server I'd like to know whether it is mature enough and I won't have serious problems with the installation and usage. I'd like to use drive encryption + btrfs + raid1 with 2x 128g SSD-s for the OS and btrfs + raid1 2x 1t WD blue HDD for the data. I'd like to run vpn, docker, git, samba and ssh on it and nodejs, python, php, pgsql, neo4j (requires java) and orientdb in the containers. At what grade are these supported?
According to distrowatch and wiki this distro is mainly developed for embedded devices. I am worried about the default settings too, because embedded devices have limited resources and my current microserver uses a Xeon E3-1230v5 with 16g ram, which is unlimited compared to a router. Will I have performance problems because of the settings e.g. too small buffers, etc.?
Hi,
I can certainly recommend Alpinelinux! I have been using Alpinelinux for about a year now and didn't find any issues so far. Alpinelinux as a micro-os proved to be stable and very easy to maintain.
You should treat Alpine als a micro-os, which means make as little changes as possible. I have a 3-page wiki with the instructions to install Alpine on my servers. This can be done in about 5 minutes. You then have very lite but capable server for running your containers.
My usage is much the same like you're planning:
- Alpine is installed on an usb-stick which is only needed at boottime, works like a charm.
- The local disks are mounted to /media/local, this is also used by docker to stores its images.
- The harddisks are formatted with btrfs, a snapshot is automatically made every day.
I am a huge fan of btrfs, I never had any issues. Also docker has a native driver for btrfs. However, I don't have any experience with drive encryption.
I currently have a couple of simple servers using Alpine but in the few month I except to migrate all my other servers to Alpinelinux too. I'm currently working hard to "dockerize" my applications.
So, in short, I use Alpinelinux for my Rapsberries al to way to my bigger RAID-6 8Tb 64Gb HP DL380p Gen8 servers.
Hi!
Thanks for you answer! I'll give it a try.
Do you have a blog or a place where you published your experiences with Alpine, maybe the wiki you mentioned?
Unfortunately I can't share my wiki but it's all very simple.
Alpine works pretty much just out-of-the box especially for docker.
That's why I use Alpine as a micro-os for docker, Alpine is perfect for this.
I did run into one issue with the elasticsearch docker container.
If you get a 'Java out of memory error' you may need to enable pax softmode.
Search for 'kernel.pax.softmode docker'
For other images it can also be necessary to disable grsec, see the last few lines in /etc/conf.d/docker
To install docker just run:
Since I run Alpine from a usb-stick all changes are lost at reboot.
That's why I have I have my disks mounted at /media/local
Homedirs are at /media/local/home and docker stores it's images at /media/local/docker
Add '--data-root=/media/local/docker' to DOCKER_OPTS in /etc/conf.d/docker
This way docker will store it images on /media/local/docker and not on the usb-stick.
docker-compose is not available as a package but you can use pip to install it.
I use the following commands to install docker-compose in the users homedir.
This way docker-compose is alway available even when I change the usb-stick.
Okay, thanks! I'll use SSD, so these changes will be permanent. I am not sure about the proper order by encryption, btrfs-raid, op-system install. By Ubuntu the installer solves all of this. Maybe the raid not. I read somewhere that it is harder to setup raid when you already use the disk, but maybe that was for raid5/6 and not for raid1, which is simple compared to them. Not to mention that btrfs raid5/6 works properly only from kernel 4.12, which the current Alpine does not support. https://www.phoronix.com/scan.php?page=news_item&px=Btrfs-Linux-4.12-RAID-5-6-Fixes