How to install Snipe-IT on Ubuntu -2018


1-Update your system

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

2-Installing Apache2

sudo apt-get install apache2

3-Installing MySQL

sudo apt-get install mysql-server

Now we are also going to secure our installation:

sudo mysql_secure_installation

Enter the root password you entered before.

Now you get asked a couple of questions, answer as below:

Enter current password for root (enter for none): Enter your root password

Would you like to setup VALIDATE PASSWORD plugin? N

Change the password for root? [Y/n] N

Remove anonymous users? [Y/n] {ENTER}

Disallow root login remotely? [Y/n] {ENTER}

Remove test database and access to it? [Y/n] {ENTER}

Reload privilege tables now? [Y/n] {ENTER}

That’s it. Let’s continue with PHP.

5-Installing PHP

sudo apt-get install php libapache2-mod-php php-mysql php-curl php-gd php-intl php-pear php-imagick php-imap php-mcrypt php-memcache php-pspell php-recode php-sqlite3 php-tidy php-xmlrpc php-xsl php-mbstring php-gettext

Let’s restart apache2:

sudo /etc/init.d/apache2 restart  

Then we are going to login with root by typing:

sudo -i 

Next, we are going to download composer: (if curl not install please install it- apt install curl

curl -sS | php   

Then we are going to move composer to another folder:

mv composer.phar /usr/local/bin/composer

cd /var/www/

Alright, time to download snipe-it:(if git not install please install first –apt install git)

git clone snipeit

cd snipeit/

Finally we replace .env.example with .env:

cp .env.example .env

6-Configuring the MySQL Database

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 “your username” and “yourpw” with your own username and password:

    mysql> create database snipeit;
    mysql> CREATE USER 'yourusername'@'localhost' IDENTIFIED BY 'yourpw';
    mysql> GRANT ALL PRIVILEGES ON snipeit.* TO 'yourusername'@'localhost';
    mysql> flush privileges;
    mysql> exit

7-Editing the .env file

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

8-Adjusting permissions

chown -R www-data:www-data storage public/uploads

chmod -R 775 storage

chmod -R 755 public/uploads

9-Installing PHP dependencies

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

apt-get install php-bcmath

10-Installing Composer & generating our App Key

composer install --no-dev --prefer-source

php artisan key:generate

11-Editing configuration files and wrapping up

sudo nano /etc/apache2/sites-available/

And paste the text into the box below:

<VirtualHost *:80>
ServerAdmin [email protected]
<Directory /var/www/snipeit/public>
        Require all granted
        AllowOverride All
    DocumentRoot /var/www/snipeit/public
   #Redirect permanent /
        ErrorLog /var/log/apache2/snipeIT.error.log
        CustomLog /var/log/apache2/access.log combined

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

Press CTRL+O to save and CTRL+X to exit.

sudo a2ensite
sudo a2enmod rewrite
sudo systemctl restart apache2

sudo a2dissite 000-default.conf

sudo service apache2 restart

Change directory

cd /etc/apache2/sites-available

sudo cp 000-default.conf 000-default.confTEMP
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

12-Setup with the Web Browser

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

Up Next

Related Posts

2 Discussion to this post

  1. Teknoloji says:

    Hi! I know this is kinda off topic nevertheless I’d figured I’d ask.
    Would you be interested in exchanging links or maybe guest authoring a blog post or vice-versa?
    My site addresses a lot of the same topics as yours and I believe we could greatly benefit
    from each other. If you might be interested feel free to
    shoot me an e-mail. I look forward to hearing from you!
    Awesome blog by the way!

  2. BestAntonia says:

    I see you don’t monetize your blog, don’t waste your traffic, you can earn additional bucks every month because you’ve
    got hi quality content. If you want to know how to make extra $$$, search for:
    Ercannou’s essential adsense alternative

Leave a Reply

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