How to Install OCS Inventory NG on Elementary OS

OCS Inventory NG is a free and open-source computer hardware and software inventory system. In this tutorial, we will guide you through the installation of OCS Inventory NG on Elementary OS.

Prerequisites

Before proceeding with the installation, make sure you have the following:

Step 1: Update the System

Before installing any new software, we recommended updating your system to the latest packages. To do this, run the following command:

sudo apt update && sudo apt upgrade

Step 2: Install required packages

Next, we need to install some packages required by OCS Inventory NG. Run the following command to install them:

sudo apt install apache2 php php-mysql libapache2-mod-php curl libcurl3 php-curl php-ldap php-mbstring php-xml php-bcmath php-gd php-gettext php-zip

Step 3: Download OCS Inventory NG

Download the OCS Inventory NG package from their official website or use the following command to download it:

wget https://github.com/OCSInventory-NG/OCSInventory-ocsreports/releases/download/2.8/OCSNG_UNIX_SERVER_2.8.tar.gz

Step 4: Extract OCS Inventory NG

After downloading the package, extract it to the /opt directory using the following command:

sudo tar xzf OCSNG_UNIX_SERVER_2.8.tar.gz -C /opt/

Step 5: Install OCS Inventory NG

After extracting the package, navigate to the OCS directory:

cd /opt/OCSNG_UNIX_SERVER_2.8/

Then run the following command to install OCS Inventory NG:

sudo sh setup.sh

Note: During the installation process, you will be prompted to enter some information. You can accept the default values, or configure it as per your requirement.

Step 6: Configure Apache

Next, we need to configure Apache to use OCS Inventory NG. Run the following command to create a new configuration file for OCS Inventory NG:

sudo nano /etc/apache2/conf-available/ocsinventory-reports.conf

Then paste the following configuration:

Alias /ocsreports /opt/OCSNG_UNIX_SERVER_2.8/ocsreports

<Directory /opt/OCSNG_UNIX_SERVER_2.8/ocsreports>
   Options FollowSymLinks
   AllowOverride All
   AddDefaultCharset UTF-8
   <IfModule mod_authz_core.c>
     # Apache 2.4
     Require local
   </IfModule>
   <IfModule !mod_authz_core.c>
     # Apache 2.2
     Order deny,allow
     Deny from all
     Allow from 127.0.0.1
     Allow from ::1
   </IfModule>
    <IfModule mod_php5.c>
        php_flag magic_quotes_gpc Off
        php_flag short_open_tag On
        php_flag register_globals Off
        php_flag session.auto_start Off
        php_value mbstring.func_overload 0
        php_value date.timezone Europe/Paris
    </IfModule>
    <IfModule !mod_php5.c>
        #you can comment the above, read WARNING above
        php_flag magic_quotes_gpc Off
        php_flag short_open_tag On
        php_flag register_globals Off
        php_flag session.auto_start Off
        php_value mbstring.func_overload 0
        php_value date.timezone Europe/Paris
    </IfModule>
</Directory>

Then save the file and exit.

Next, enable the configuration file by running the following command:

sudo a2enconf ocsinventory-reports

Finally, restart Apache to apply the changes:

sudo systemctl restart apache2

Step 7: Access OCS Inventory NG Web Interface

Now that OCS Inventory NG is installed and configured, you can access it via your web browser. Open your web browser and enter http://localhost/ocsreports/ in the address bar.

You will be prompted to enter your login details. The default username is admin and the password is admin. Once logged in, you can start managing and configuring your inventory system.

Congratulations! You have successfully installed OCS Inventory NG on your Elementary OS system.

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!