How to Install Observium on Alpine Linux

Observium is a network monitoring tool that allows you to monitor all of your devices in your network. This tutorial will show you how to install Observium on Alpine Linux latest.

Prerequisites

Step 1: Installing PHP

Observium requires PHP to run. We will use the PHP7 version for this installation.

apk add php7 php7-fpm php7-curl php7-json php7-mysqli php7-session php7-zlib php7-posix

After installing PHP7, you need to configure it:

nano /etc/php7/php.ini

In the php.ini file, uncomment the following line:

;extension=mysqli.so

Once you have uncommented the line, save the file and exit.

Step 2: Installing MYSQL Server

Observium requires a MySQL server to store data. We will install the MariaDB server for this installation.

apk add mariadb mariadb-client

Once the installation is complete, start the MariaDB service:

/etc/init.d/mariadb start

Now that the MariaDB service is started, we need to secure the installation:

mysql_secure_installation

Answer the prompts with your preferred options.

Step 3: Installing Observium

We will need a few more packages to install Observium:

apk add nginx php7-gd php7-xml php7-zip php7-pecl-crypto php7-pear openssl-dev

Once the packages are installed, you can now download Observium:

wget http://www.observium.org/observium-community-latest.tar.gz -P /var/www/

Extract the downloaded file:

tar zxvf /var/www/observium-community-latest.tar.gz -C /var/www/

Now, we need to set permissions:

chown -R nginx:nginx /var/www/observium/
chmod -R 777 /var/www/observium/

Step 4: Configuring Observium

Create a config.php file:

cp /var/www/observium/config.php.default /var/www/observium/config.php

Edit the config.php file to include your MySQL credentials, SNMP community strings, and other details.

nano /var/www/observium/config.php

Step 5: Configuring Nginx

Observium uses Nginx as a web server. We need to configure it to serve Observium.

Create a new configuration file:

nano /etc/nginx/conf.d/observium.conf

Add the following configuration:

server {
    listen       80;
    server_name  observium.example.com;
    root         /var/www/observium;

    index index.php;

    access_log /var/log/nginx/access.log;
    error_log /var/log/nginx/error.log;

    location / {
        try_files $uri $uri/ /index.php$is_args$args;
    }

    location ~ \.php$ {
        fastcgi_pass unix:/var/run/php-fpm7.sock;
        fastcgi_index index.php;
        fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
        fastcgi_param PATH_INFO $fastcgi_path_info;
        include fastcgi_params;
    }

    location ~* \.(jpg|jpeg|gif|css|png|js|ico)$ {
        expires max;
        log_not_found off;
    }
}

Save and exit the file.

Restart Nginx:

/etc/init.d/nginx restart

Step 6: Accessing Observium

Open your browser and navigate to http://observium.example.com. You should see the Observium login page.

Login with the default credentials (username: admin, password: admin).

Once you are logged in, you can start monitoring your network devices.

That's it! You have successfully installed Observium on Alpine Linux.

If you want to self-host in an easy, hands free way, need an external IP address, or simply want your data in your own hands, give IPv6.rs a try!

Alternatively, for the best virtual desktop, try Shells!