How to install Snipe-IT on Ubuntu 16.04

Snipe-IT was made for IT asset management, to enable IT departments to track who has which laptop, when it was purchased, which software licenses and accessories are available, and so on.

1. Install LAMP

First of all, we need to install LAMP (Linux, Apache2, MySQL and PHP).

Go ahead and install LAMP following this link.

2. Updating Ubuntu 16.04 and installing prerequisites

Updates first:

~$ sudo apt-get update && sudo apt-get upgrade -y

Be sure you have curl command is working. If not then install it with the below command:

~$ sudo apt-get install curl

Next we are going to download composer:

~$ sudo curl -sS https://getcomposer.org/installer | php

 

Then we are going to move composer to another folder:

~$ sudo mv composer.phar /usr/local/bin/composer

~$ cd /var/www/

 

Alright, time to download snipe-it:

~$ sudo git clone https://github.com/snipe/snipe-it snipeit

~$ cd snipeit/

 

Finally we replace .env.example with .env:

~$ sudo cp .env.example .env

3. Configuring the MySQL Database

Time to create our MySQL Database:

~$ sudo mysql -u root -p

Now you need to run a couple of commands, make sure to use the EXACT commands like in the box below, replace “yourusername” and “yourpw” with your own username and password:

  • mysql> create database snipeit;
  • mysql> GRANT ALL ON *.* TO ‘your_username’@‘%’ IDENTIFIED BY ‘your_password’;
  • mysql> flush privileges;
  • mysql> exit

4. Editing the .env file

Now we are going to edit the .env config file.

~$ sudo nano .env

You need to adjust the values according to your server and the database we created earlier. Remember to enter your username and password that you set in step 3.

Don’t worry about the APP_KEY either, we are going to generate that later.

Hit CTRL+O to write and CTRL+X to exit.

5. Adjusting permissions

Now we got to adjust a couple of permissions:

~$ sudo chown -R www-data:www-data storage public/uploads

~$ sudo chmod -R 775 storage

~$ sudo chmod -R 755 public/uploads

. Installing PHP dependencies

Installing PHP dependencies:

~$ sudo apt-get install -y git unzip php php-mcrypt php-curl php-mysql php-gd php-ldap php-zip php-mbstring php-xml php-bcmath

 

 

7. Installing Composer & generating our App Key

Installing Composer:

~$ sudo composer install –no-dev –prefer-source

 

And generating our APP Key:

~$ sudo php artisan key:generate

Type yes when you get asked if you really want to run that command.

 

 

8. Editing configuration files and wrapping up

Now we are going to enable our Virtual Host:

~$ sudo nano /etc/apache2/sites-available/snipeit.example.com.conf

And paste the text in the box below:

<VirtualHost *:80>
ServerAdmin webmaster@localhost
<Directory /var/www/snipeit/public>
Require all granted
AllowOverride All
</Directory>
DocumentRoot /var/www/snipeit/public
ServerName 192.168.71.129
#Redirect permanent / https://snipeit.your-server-fqdn.com/
ErrorLog /var/log/apache2/snipeIT.error.log
CustomLog /var/log/apache2/access.log combined
</VirtualHost>

 

Change the IP(ServerName) then press CTRL+O to save and CTRL+X to exit.

Now we are going to run a couple apache commands:

~$ sudo a2ensite snipeit.example.com.conf

~$ sudo a2enmod rewrite

~$ sudo systemctl restart apache2

 

And we are going to disable the default.conf

~$ sudo a2dissite 000-default.conf

~$ sudo service apache2 restart

 

Change directory

~$ cd /etc/apache2/sites-available

 

And we are going to rename the default.conf to keep it as backup:

~$ sudo cp 000-default.conf 000-default.confTEMP

 

And finally remove it:

~$ sudo rm 000-default.conf

 

Already and finally wrapping it up with:

~$ sudo phpenmod mcrypt

~$ sudo phpenmod mbstring

~$ sudo a2enmod rewrite

~$ sudo service apache2 restart

 

9. Setup with the Web Browser

Now you are as good as done. Open a Web Browser and enter your server IP and enter:

 

Click on Next: Create Database Tables.

You will likely get an error:

 

Don’t panic, just refresh the page by hitting F5

Click on Next: Create User

Finalize everything to your liking, click F5 if you get the error again.

 

And congratulations, you are now running a powerful, completely free cloud based instance of the Snipe IT Asset Management!

2 Comments

Leave a Reply

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

Time limit is exhausted. Please reload CAPTCHA.