Alpine is probably one of the lightweight Linux distribution out there. It’s a very small, simple and security oriented. It doesn’t shipped with hundreds of bloatware which you probably don’t use in your lifetime. It just have the minimal packages installed which gets you up and running. You always have the option to install your desire packages later. Alpine is one of my favorite Linux distribution since it is lightweight, RAM and CPU efficient. Also it is very easy to setup.

DigitalOcean doesn’t provide Alpine as distribution. Currently it supports Ubuntu, Fedora, FreeBSD, Debian & CentOS. We will see how to ‘install’ Alpine Linux in DigitalOcean droplet. Basically we will convert Debian droplet to Alpine distribution.

First thing first, if you don’t have DigitalOcean account, simply create one by clicking here (referral link). You will receive 50$ free credit upon registration if you register via this link.

Now, create a droplet in DigitalOcean with debian-10 x64

<img class="alignnone size-full wp-image-401" src="./static/2019/12/do_distro.png" alt="" width="1070" height="410" srcset="./static/2019/12/do_distro.png 1070w, ./static/2019/12/do_distro-768x294.png 768w" sizes="(max-width: 1070px) 100vw, 1070px" />

Now under authentication, use SSH key, not password. If you use password as authentication, you won’t be able to login when we convert our droplet to Alpine. So use SSH key as authentication. I’ve written another tutorial about DigitalOcean where I explained how to generate SSH key.

<img class="alignnone size-full wp-image-402" src="./static/2019/12/do_key.png" alt="" width="1260" height="340" srcset="./static/2019/12/do_key.png 1260w, ./static/2019/12/do_key-768x207.png 768w" sizes="(max-width: 1260px) 100vw, 1260px" />

After droplet creation, login to your droplet with SSH key and let’s get our hands dirty by executing the following commands:

wget https://github.com/k4mrul/digitalocean-alpine/raw/master/digitalocean-alpine.sh
chmod +x digitalocean-alpine.sh
./digitalocean-alpine.sh

Success! Wait for a few seconds or take a cup of coffee. Your droplet will be converted to Alpine Linux. Remember to use the same SSH key for login.

Thanks to bontibon for that script.

If you want to try out Alpine for your server or vm, you can download the respective package from their download site