Install Snipe-IT on Debian 10/Ubuntu 18.04

0
292

Welcome to our guide on how to install Snipe-IT on Debian 10/Ubuntu 18.04. Snipe-IT is a free and opensource IT asset/license management system that enables IT departments to track who has which device, when it was purchased, which software licenses and accessories are available,…

Read more about Snipe-IT features on the features and overview page.

Install Snipe-IT on Debian 10/Ubuntu 18.04

Snipe-IT can be run as a hosted service or self-hosted. This guide focuses on self-hosted Snipe-IT.

Prerequisites

Snipe-IT requires LAMP stack set in order to run. Hence, follow the guides below to setup LAMP Stack on Debian 10 or Ubuntu 18.04.

Install LAMP Stack with MariaDB 10 on Debian 10 Buster

Install LAMP Stack (Apache,MariaDB, PHP 7.2) on Ubuntu 18.04 LTS

Install Extra PHP Extensions and other requirements.

apt install php-{bcmath,cli,xml,mbstring,tokenizer,curl,zip,ldap,gd} openssl curl git wget zip

Create Snipe-IT Database

Next, login to MariaDB/MySQL and create Snipe-IT database and database user with all the privileges granted on Snipe-IT database.

mysql -u root -p
create database snipeitdb;
grant all on snipeitdb.* to [email protected] identified by '[email protected]';
flush privileges;
quit

Install Snipe-IT on Debian 10/Ubuntu 18.04

Download Snipe-IT

Clone the Snipe-IT github directory to your web server root directory.

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

Configure Snipe-IT

Rename the Snipe-IT variables file .env.example to .env file.

cp /var/www/html/snipeit/.env.example /var/www/html/snipeit/.env

Open the environment configuration file.

vim /var/www/html/snipeit/.env

Snipe-IT Basic Application Settings

Set the URL you will use to access your Snipe-IT, the Application language, Timezone. The URL should not have a trailing slash.

# --------------------------------------------
# REQUIRED: BASIC APP SETTINGS
# --------------------------------------------
APP_ENV=production
APP_DEBUG=false
APP_KEY=ChangeMe
APP_URL=http://snipeit.example.com
APP_TIMEZONE='Europe/London'
APP_LOCALE=en

Snipe-IT Database Settings

Set the database host, database name, user and password created above,

# --------------------------------------------
# REQUIRED: DATABASE SETTINGS
# --------------------------------------------
DB_CONNECTION=mysql
DB_HOST=127.0.0.1
DB_DATABASE=snipeitdb
DB_USERNAME=snipeadmin
[email protected]
DB_PREFIX=null
DB_DUMP_PATH='/usr/bin'
DB_CHARSET=utf8mb4
DB_COLLATION=utf8mb4_unicode_ci

If you are gonna need your Snipe-IT to send emails, configure Email Server settings.

Install Required PHP Libraries

To install other required Snipe-IT PHP libraries, you need to install PHP Composer. Note that these are not the same as the PHP extensions installed on our prerequisites page. Hence, navigate to Snipe-IT install directory and install the libraries as follows.

cd /var/www/html/snipeit
curl -sS https://getcomposer.org/installer | php
php composer.phar install --no-dev --prefer-source

Set Snipe-IT Directory Ownership and Permissions

Set the user and group Ownership of Snipe-IT web root directory to Web server www-data.

chown -R www-data:www-data /var/www/html/snipeit

Generate Snipe-IT App Key

App key is a randomly generated key that Snipe-IT uses to encrypt data. The value generated will be assigned automatically to APP_KEY variable in the Snipe-IT configuration file.

php artisan key:generate

This command has to be run from the Snipe-IT directory.

**************************************
*     Application In Production!     *
**************************************

 Do you really wish to run this command? (yes/no) [no]:
 > yes

Application key [base64:7xHLDhywQyccOYN9IIOVpkqsdpv34F5RjgtC+Lf+iW8=] set successfully.

The key generated is automatically set as the value of the APP_KEY variable in the .env file.

Configure Apache Web Server for Snipe-IT

Create Snipe-IT Apache configuration file wth the content below;

vim /etc/apache2/sites-available/snipeit.conf
<VirtualHost 192.168.56.105:80>
	DocumentRoot /var/www/html/snipeit/public
	ServerName snipeit.example.com

	<Directory /var/www/html/snipeit/public>
		Allow From All
		AllowOverride None
		Options None
	</Directory>

	RewriteEngine On
	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
	RewriteCond %{REQUEST_URI} (.+)/$
	RewriteRule ^ %1 [L,R=301]
	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-d
	RewriteCond %{DOCUMENT_ROOT}%{REQUEST_FILENAME} !-f
	RewriteRule ^ /index.php [L]

	ErrorLog ${APACHE_LOG_DIR}/snipeit-error.log
	CustomLog ${APACHE_LOG_DIR}/snipeit-access.log combined
</VirtualHost>

Save the configuration file and run a file syntax test.

apachectl configtest

If the command return, Syntax Ok, proceed. Otherwise fix the would errors.

Enable Snipe-IT site configuration.

a2ensite snipeit.conf

Enable Rewrite module.

a2enmod rewrite

Restart Apache

systemctl restart apache2

Snipe-IT Pre-Flight & Setup

Run the pre-flight setup to verify that all configurations are okay. You can access Snipe-IT pre-flight page via the URL; http://<Snipe-Hostname or Address>.

The first page will do a system check to make sure your configuration is correct.

Install Snipe-IT on Debian 10/Ubuntu 18.04

If all is fine, proceed to database configuration page. Since we already set up the database, you will be told that it is already setup.

Snipe-IT database setup

Create Snipe-IT admin user and fill in their details.

Snipe-IT create admin user

Click Next to save the user and go to Snipe-IT dashboard.

Snipe-IT dashboard

There you go. You have successfully installed Snipe-IT Asset management tool on Debian 10 Buster/Ubuntu 18.04.

The Snipe-IT dashboard has so many functionalities. Read throughbthe user manual to learn about them.

Snipe-IT Overview

In our next tutorial, we are going to learn how to add assets to Snipe-IT for management.

Snipe-IT has also some command line utilities. Read more about them on Snipe-IT Command Line Utilities page.

Other Tutorials;

Install WonderCMS on Debian 10 Buster

Install WonderCMS with Nginx on Debian 10

Install GoAccess on Ubuntu 18.04/Debian 10 Buster

Configure APT Proxy on Debian 10 Buster

LEAVE A REPLY

Please enter your comment!
Please enter your name here