HostOnNet Blog

Alpine Linux – Tiny Linux Distribution

Looking for Linux Server Admin or WordPress Expert? We can help.

Alpine Linux is a tiny linux distribution based on busybox.

System details are

/ # cat /etc/*release
NAME="Alpine Linux"
PRETTY_NAME="Alpine Linux v3.5"
/ # uname -r
/ #

Total size of file system is 4.3 MB.

After running apk update, file system usage is 5.2 MB.

~ # du -h -d 1 /
0	/dev
8.0K	/root
4.0K	/mnt
4.0K	/home
216.0K	/sbin
0	/proc
4.0K	/run
2.6M	/lib
296.0K	/etc
212.0K	/usr
16.0K	/media
1.1M	/var
4.0K	/tmp
808.0K	/bin
4.0K	/srv
0	/sys
5.2M	/
~ # 

Installing Software

First you need to update software repository used by apk.

apk update


~ # apk update
v3.5.2-18-g781d2272fd []
v3.5.2-14-gd7ba0e189f []
OK: 7959 distinct packages available
~ # 

To install a package, run

apk add PKG-NAME


~ # apk add nginx
(1/2) Installing pcre (8.39-r0)
(2/2) Installing nginx (1.10.3-r0)
Executing nginx-1.10.3-r0.pre-install
Executing busybox-1.25.1-r0.trigger
OK: 5 MiB in 13 packages
~ # 

There is /etc/init.d/nginx, but i can’t run it for some reason.

~ # /etc/init.d/nginx start
/bin/sh: /etc/init.d/nginx: not found
~ # ls -l /etc/init.d/nginx 
-rwxr-xr-x    1 root     root          1364 Mar  2 19:29 /etc/init.d/nginx
~ # 

Here is what i done to get nginx runnin

~ # nginx 
~ # nginx: [emerg] open() "/run/nginx/" failed (2: No such file or directory)

~ # mkdir /run/nginx
~ # nginx
~ # curl localhost
<head><title>404 Not Found</title></head>
<body bgcolor="white">
<center><h1>404 Not Found</h1></center>
~ # 

Posted in Linux

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.