How to Install Snipe-IT (IT Asset Management) on CentOS and Ubuntu

Snipe-IT is a free and open source, cross-platform, feature-rich IT asset management system built using a PHP framework called Laravel. It is web-based software, which enables IT administrators in medium to large enterprises to track physical assets, software licenses, accessories and consumables in a single place.

Check out a live, up-to-date version of Snipe-IT Asset Management Tool:

Snipe-IT Features:

  1. It is a cross-platform – works on Linux, Windows and Mac OS X.
  2. It is mobile-friendly for easy asset updates.
  3. Easily Integrates with Active Directory and LDAP.
  4. Slack notification integration for checkin/checkout.
  5. Supports one-click (or cron) backups and automated backups.
  6. Supports optional two-factor authentication with Google authenticator.
  7. Supports generation of custom reports.
  8. Supports custom status labels.
  9. Supports bulk user actions and user role management for different levels of access.
  10. Supports several languages for easy localization and so much more.

In this article, I will explain how to install a IT asset management system called Snipe-IT using a LAMP (Linux, Apache, MySQL & PHP) stack on CentOS and Debian based systems.

Step 1: Install LAMP Stack

1. First update the system (meaning update the list of packages that needs to be upgraded and add new packages that have entered in repositories enabled on the system).

$ sudo apt update        [On Debian/Ubuntu]
$ sudo yum update        [On CentOS/RHEL] 

2. Once system has been updated, now you can install LAMP (Linux, Apache, MySQL & PHP) stack with all needed PHP modules as shown.

Install LAMP on Debian/Ubuntu

$ sudo apt-get install software-properties-common
$ sudo add-apt-repository ppa:ondrej/php
$ sudo apt-get update
$ sudo apt install apache2 apache2-utils libapache2-mod-php mariadb-server mariadb-client php7.3 php7.3-pdo php7.3-mbstring php7.3-tokenizer php7.3-curl php7.3-mysql php7.3-ldap php7.3-zip php7.3-fileinfo php7.3-gd php7.3-dom php7.3-mcrypt 

Install LAMP on CentOS/RHEL

3. Snipe-IT requires PHP greater than 7.x and PHP 5.x has reached end of life, so to have PHP 7.x, you need to enable the Epel and Remirepository as shown.

$ sudo yum install epel-release
$ sudo rpm -Uvh
$ sudo yum -y install yum-utils
$ sudo yum-config-manager --enable remi-php71   [Install PHP 7.1]
$ sudo yum-config-manager --enable remi-php72   [Install PHP 7.2]
$ sudo yum-config-manager --enable remi-php73   [Install PHP 7.3]

4. Next, install PHP 7.x on CentOS 7 with the required modules needed by Snipe-IT.

$ sudo yum install httpd mariadb mariadb-server php php-openssl php-pdo php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-fileinfo php-gd php-dom php-mcrypt

5. After the LAMP stack installation completes, start the web server for the mean time, and enable it to start on the next system boot with the following command.

$ sudo systemctl start enable status apache2       [On Debian/Ubuntu]
$ sudo systemctl start enable status httpd         [On CentOS/RHEL]

6. Next verify Apache and PHP installation and all its current configurations from a web browser, let’s create a info.php file in the Apache DocumentRoot (/var/www/html) using the following command.

$ sudo echo "<?php  phpinfo(); ?>" | sudo tee -a /var/www/html/info.php

Now open a web browser and navigate to following URL’s to verify Apache and PHP configuration.


7. Next, you need to secure and harden your MySQL installation using the following command.

$ sudo mysql_secure_installation     

You will be asked you to set a strong root password for your MariaDB and answer Y to all of the other questions asked (self explanatory).

8. Finally start MySQL server and enable it to start at the next system boot.

$ sudo systemctl start mariadb            
$ sudo systemctl start mysql

Step 2: Create Snipe-IT Database on MySQL

9. Now log in to the MariaDB shell and create a database for Snipe-IT, a database user and set a suitable password for the user as follows.

$ mysql -u root -p

Provide the password for the MariaDB root user.

MariaDB [(none)]> CREATE DATABASE snipeit_db;
MariaDB [(none)]> CREATE USER 'tecmint'@'localhost' IDENTIFIED BY 't&[email protected]';
MariaDB [(none)]> GRANT ALL PRIVILEGES ON snipeit_db.* TO 'tecmint'@'localhost';
MariaDB [(none)]> exit

Step 3: Install Composer – PHP Manager

10. Now you need to install Composer – a dependency manager for PHP, with the commands below.

$ sudo curl -sS | php
$ sudo mv composer.phar /usr/local/bin/composer

Step 4: Install Snipe-IT Asset Management

11. First install Git to fetch and clone the latest version of Snipe-IT under Apache web-root directory.

$ sudo apt -y install git      [On Debian/Ubuntu]
$ sudo yum -y install git      [On CentOS/RHEL]

$ cd  /var/www/
$ sudo git clone

12. Now go into the snipe-it directory and rename the .env.example file to .env.

$ cd snipe-it
$ ls
$ sudo mv .env.example .env

Step 5: Configure Snipe-IT Asset Management

13. Next, configure the snipe-it environment, here you’ll provide the database connection settings and many more.

First open the .env file.

$ sudo vi .env

Then Find and change the following variables according to instructions given.

APP_TIMEZONE=Africa/Kampala                                   #Change it according to your country
APP_URL=                                #set your domain name or IP address
APP_KEY=base64:BrS7khCxSY7282C1uvoqiotUq1e8+TEt/IQqlh9V+6M=   #set your app key
DB_HOST=localhost                                             #set it to localhost
DB_DATABASE=snipeit_db                                        #set the database name
DB_USERNAME=tecmint                                           #set the database username
DB_PASSWORD=password                                          #set the database user password

Save and close the file.

14. Now you need to set the appropriate permissions on certain directories as follows.

$ sudo chmod -R 755 storage 
$ sudo chmod -R 755 public/uploads
$ sudo chown -R www-data:www-data storage public/uploads   [On Debian/Ubuntu]
sudo chown -R apache:apache storage public/uploads         [On CentOS/RHEL]

15. Next, install all the dependencies required by PHP using Composer dependency manager as follows.

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

16. Now you can generate the “APP_KEY” value with the following command (this will be set automatically in the .env file).

$ sudo php artisan key:generate

17. Now, you need to create a virtual host file on the web server for Snipe-IT.

$ sudo vi /etc/apache2/sites-available/     [On Debian/Ubuntu]
$ sudo vi /etc/httpd/conf.d/                [On CentOS/RHEL]

Then add/modify the line below in your Apache config file (use your server IP address here).

    ServerName snipeit.tecmint.lan
    DocumentRoot /var/www/snipe-it/public
    <Directory /var/www/snipe-it/public>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Order allow,deny
        allow from all

Save and close the file.

18. On Debian/Ubuntu, you need to enable virtual host, mod_rewrite and mcrypt using the following commands.

$ sudo a2ensite snipeit.conf
$ sudo a2enmod rewrite
$ sudo php5enmod mcrypt

19. Lastly, restart Apache web server to take new changes into effect.

$ sudo systemctl restart apache2       [On Debian/Ubuntu]
$ sudo systemctl restart httpd         [On CentOS/RHEL]

Step 6: Snipe-IT Web Installation

20. Now open your web browser and enter the URL: http://SERVER_IP to view the Snipe-IT web installation interface.

First you will see the Pre-Flight Check page below, click Next: Create Database Tables.

Snipe-IT Pre Flight Check

Snipe-IT Pre Flight Check

21. You will now see all the tables created, click Next: Create User.

Create Snipe-IT User

Create Snipe-IT User

22. Here, provide all the admin user information and click Next: Save User.

Snipe-IT User Information

Snipe-IT User Information

23. Finally open the login page using the URL http://SERVER_IP/login as shown below and login to view the Snipe-IT dashboard.

Snipe-IT Login

Snipe-IT Login

Snipe-IT Dashboard

Snipe-IT Dashboard

Snipe-IT Homepage:

In this article, we discussed how to setup Snipe-IT with LAMP (Linux Apache MySQL PHP) stack on CentOS and Debian based systems. If any issues, do share with us using our comment form below.

If You Appreciate What We Do Here On TecMint, You Should Consider:

TecMint is the fastest growing and most trusted community site for any kind of Linux Articles, Guides and Books on the web. Millions of people visit TecMint! to search or browse the thousands of published articles available FREELY to all.

If you like what you are reading, please consider buying us a coffee ( or 2 ) as a token of appreciation.

Support Us

We are thankful for your never ending support.

Aaron Kili

Aaron Kili is a Linux and F.O.S.S enthusiast, an upcoming Linux SysAdmin, web developer, and currently a content creator for TecMint who loves working with computers and strongly believes in sharing knowledge.

Your name can also be listed here. Got a tip? Submit it here to become an TecMint author.

RedHat RHCE and RHCSA Certification Book
Linux Foundation LFCS and LFCE Certification Preparation Guide

You may also like...

49 Responses

  1. Hillary says:

    HI, Aaron i am not seeing where i create a company name under Admin.

  2. Anony Mouse says:

    You’re leaving people open to attack by having them add “Indexes” to their web server config in directory options. You should really change it to "-Indexes".

  3. wahyu says:

    Hi, I have a problem.

    I created a new user with some deny permission, but i can’t login again with administrator or my new user ; error username and password wrong

    can you help me?

  4. Troy says:

    I can’t generate the key. I get a PHP Fatal Error. I would post the whole error message but I’m getting blocked when I try to do it.

  5. Troy says:

    I ran into in error when I got to Step 15. The composer command could not be found. I had to move the composer executable from /usr/local/bin/composer to /usr/bin/composer. I believe there is an error in step 3 for CentOS 7.

    Also, when I tried to verify the Apache and PHP installation it didn’t work. I had to create an exception in the firewall before I could navigate to the URL. I’m just posting this in case someone else is trying to do this on CentOS 7 and runs into the same issues.

  6. Troy says:

    Hi, I get an error when trying to execute the following command:

    $ sudo rpm -Uvh
    The error is:
    warning: /var/tmp/rpm-tmp.bUyFtE: Header V4 DSA/SHA1 Signature, key ID 00f97f56: NOKEY
    error: Failed dependencies:
            epel-release = 7 is needed by remi-release-7.5-2.el7.remi.noarch

    I am new to this so any help is appreciated.

    • Ravi Saive says:


      First install EPEL repository and then install Remi as shown.

      $ sudo yum install epel-release
      $ sudo rpm -Uvh
  7. tminh says:

    Could you please make a tutorial how to integrate with active directory ?

  8. FazzaGBR says:

    At Step 7 I get this error:

    error 2002 hy000 can’t connect to local mysql

  9. Andy says:

    solved by my self. I copy paste issue..

  10. Andy says:


    when I try to execute the composer command on a CentOS7.4, but I receive the below warn and error messages. I’m expert on php and composer too. Can someone suggest me a solution?

    Do not run Composer as root/super user! See for details

      The "-▒" option does not exist.

Got something to say? Join the discussion.

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.