How to install Snipe-IT Asset Management on CentOS 8

Introduction

Snipe-IT is a free and open source project built on Laravel for IT asset management. For example, this helps IT departments keep track of who owns which laptops, when they buy them, what software licenses and accessories are available, and more. This guide will show you how to install Snipe-IT Asset Management on a CentOS 8 Linux computer.

These are the steps for you to install and configure Snipe-IT Asset Management on CentOS 8 Linux system. You need root access to a server or standard account with sudo privileges.

Step 1: Update the server and install dependencies

Update your CentOS system.

sudo dnf -y update

Install git and add the EPEL repository:

sudo dnf -y install epel-release vim git

Step 2: Install Apache Web Server

The Apache httpd server will be used to host the Snipe-IT asset management web application on CentOS 8. Install by running the following command.

sudo dnf -y install httpd

Start and enable the Apache httpd service.

sudo systemctl start httpd.service
sudo systemctl enable httpd.service

Step 3: Install PHP and modules

PHP also needs to be a key dependency. Follow this guide to install PHP 7.4 on your system

How to install PHP 7.4 on CentOS 8 / RHEL 8

Snipe-IT also requires many other PHP modules:

sudo dnf -y install php-openssl php-pdo php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-fileinfo php-gd php-dom php-mcrypt

Step 4: Install MariaDB database server

Follow this guide to install MariaDB 10.4 on your system

How to install MariaDB on CentOS 8 / RHEL 8

Start and enable MariaDB:

sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service

Step 5: Create the Snipe-IT database

Log in to the database you installed in the previous step and create the database and user.

$ mysql -u root -p

CREATE DATABASE snipeit;
CREATE USER 'snipeit'@'localhost' IDENTIFIED BY 'Je1eimom4chahth'; # Make sure you have used strong password here.
GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeit'@'localhost';
FLUSH PRIVILEGES;
EXIT;

Step 6: Install PHP Composer

Composer is a PHP application package manager designed to provide a standard format for managing dependencies between PHP software and required libraries

Install PHP composer using this link

How to install PHP Composer on CentOS 8 / RHEL 8

Step 7: Download Snipe-IT on CentOS 8

Extract Snipe-IT from git:

sudo git clone https://github.com/snipe/snipe-it /var/www/html/snipe

Step 8: Configure Snipe-IT

Now that we have a copy of Snipe-IT on our local server, let us now proceed with the configuration. Create an .env file.

From the downloaded file we already have an .env.example file. Change to the directory where you downloaded the files from git, and then simply copy .env.example as shown below.

cd /var/www/html/snipe
sudo cp .env.example .env

Let’s edit now .env Archive accordingly. You may have noticed that this file has many options, but the following are the most important options so far. You can add other content as you like, such as mail server settings and other content.

$ sudo vim .env

APP_URL=example.com           # Input the IP Address or FQDN of your Snipe App
APP_TIMEZONE='UTC'            # Input it to match the country you are at
DB_DATABASE=snipeit           # Input the name of the database we created earlier
DB_USERNAME=snipeit           # Input the username of the database we created earlier 
DB_PASSWORD=Je1eimom4chahth   # Input the password of the database we created earlier

After finishing, still in the directory, we downloaded Snipe-IT and let us give the file the correct permissions and ownership as shown below.

sudo chown -R apache:apache storage public/uploads
sudo chmod -R 755 storage
sudo chmod -R 755 public/uploads

Step 9: Install PHP dependencies using composer

Using our previously installed Composer, let’s install all the dependencies of PHP.

Check where to install composer

$ which composer
/usr/local/bin/composer

Install dependencies. This may take a while to complete:

sudo /usr/local/bin/composer install --no-dev --prefer-source

You should see the output shown below

Step 10: Generate “APP_Key”.

Still in the directory where you downloaded the SnipeIT file, run the following command

$ sudo php artisan key:generate
Application In Production!     *  
Do you really wish to run this command? (yes/no) [no]:
  > yes 
Application key [base64:yXaQTcuJo/rXHoNxG+C/X/aYyHQ6/Va3NHu4YUPpBAQ=] set successfully.

Step 11: Configure Apache

Configure the firewall service to allow http ports:

sudo firewall-cmd --permanent --add-service=http
sudo firewall-cmd --reload

Navigate to the Apache folder and create the SnipeIT virtual host:

cd /etc/httpd/conf.d/

Create a file for your virtual host and add a regular VirtualHost configuration similar to the one shown below.

$ sudo vim geeksnipe.conf

  ServerName example.com
  DocumentRoot /var/www/html/snipe/public
  
    Options Indexes FollowSymLinks Multiviews
    AllowOverride All
    Order allow,deny
    allow from all
  

See screenshot below.

How to install Snipe-IT Asset Management on CentOS 8

Restart Apache:

sudo systemctl restart httpd

Step 12: Configure SELinux

Run the following command to get the management pack:

sudo yum provides /usr/sbin/semanage

You should get something like policycoreutils-python-utils-2.8-16.1.el8.noarch

How to install Snipe-IT Asset Management on CentOS 8

Install the package:

sudo yum install policycoreutils-python-utils

After installation, navigate to the directory where your SnipeIT files are saved and run the following command as root.

sudo semanage fcontext -a -t httpd_sys_content_t " /var/www/html/snipe(/.*)/?"  
sudo restorecon -R -v  /var/www/html/snipe/

SELinux may prevent Apache from opening any outgoing sockets. To allow it, run the following command as the root user:

sudo setsebool -P httpd_can_network_connect on

Step 13: Complete Snipe-IT setup on CentOS 8

Click ”Create a database table

How to install Snipe-IT Asset Management on CentOS 8

Click ”Create user“.

How to install Snipe-IT Asset Management on CentOS 8

Input page asks you for details

How to install Snipe-IT Asset Management on CentOS 8

Complete and load the dashboard

How to install Snipe-IT Asset Management on CentOS 8

in conclusion

We now have an asset management system. You can tour around and see what services they offer. For more information on SnipeIT, check out its full documentation.

Also read:

How to install Jira on CentOS 8 / RHEL 8 Linux

How to install SuiteCRM on CentOS 8 Linux

How to install Vagrant on CentOS 8 / RHEL 8

How to install Icinga Web 2 on CentOS 8 / RHEL 8

Install and configure DHCP server and client on CentOS 8 / RHEL 8

Sidebar