How to install Snipe-IT on Ubuntu 16.04 on AWS Free Tier

Today I show you how to install Snipe-IT on Ubuntu 16.04 using Amazon Web Services Free Tier EC2 instance.

 

After struggling through at least 5 or 6 incomplete “tutorials” on how to install Snipe-IT on Ubuntu 16.04, I gave up and scrapped the official documentation for you, bringing together the most complete Snipe-IT tutorial out there.

I’m going to utilize a Free Tier eligible instance of AWS EC2. If you want to know how to create a Free Tier eligible EC2 Instance on AWS, watch my YouTube video on it!

Alright, without further ado, let’s get to work.

 

1. Install LAMP

First we need to install LAMP, that is: Linux, Apache2, MySQL and PHP.

Go ahead and install LAMP following my guide.

2. Updating Ubuntu 16.04 and installing prerequisites

We start with assuming you have a freshly installed Ubuntu Server 16.04 in front of you or you followed the video above and created a fresh Ubuntu 16.04 instance on AWS EC2.

Updates first:

sudo apt-get update
sudo apt-get upgrade -y

 

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 'yourusername'@'localhost' IDENTIFIED BY 'yourpw';
    mysql> flush privileges;
    mysql> exit

Don’t mind the error message that the Database already exists in the screenshot. I had it created before and made a typo.

 

 

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

 

 

6. 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
sudo apt-get install 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

Almost done guys, hold tight.

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 YOURSERVERIP
   #Redirect permanent / https://snipeit.your-server-fqdn.com/
        ErrorLog /var/log/apache2/snipeIT.error.log
        CustomLog /var/log/apache2/access.log combined
</VirtualHost>

Make sure to replace YOURSERVERIP with, well, your server ip.

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. You should end up here:

Ignore the File Owner warning, this seems to be a bug and will probably be fixed in an update. 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 Software on your free tier Amazon EC2 instance.

 

Otherwise, if this saved you a ton of time, you know what to do đŸ™‚

 

Don’t forget to donate

đŸ™‚

Or, one of your favorite Cryptos:

Bitcoin Donations: 1KsqRQVg3caHFnYg8bvqR25sDDznpeNeCs
Ethereum Donations: 0xeB60dd10ab1146ad8504aEd127b6EF0168eF4FB5

All donations are highly appreciated!

 

 

Video:

 

 

Leave a Reply

%d bloggers like this: