billysoftacademy.com

Learn how to install Snipe-IT on Linux Ubuntu 22.04 LTS

Introduction

Snipe-IT is a web-based application that is open-source and designed to manage assets. It is mainly focused on IT assets, which makes it an ideal choice for tracking hardware and software within an organization. The primary objective of Snipe-IT is to offer a centralized and efficient approach for businesses to keep track of their assets, including computers, servers, software licenses, and other types of equipment. In this tutorial, we will guide you through the step-by-step process of installing Snipe-IT on a server running Linux Ubuntu 22.04 LTS.

Requirements

The following is a list of items needed to complete the installation successfully:
1) Linux Ubuntu 22.04 LTS or newer
2) A computer with 4GB RAM, a dual core processor and 50GB of free disk space
3) An SSH client such as SolarPuTTY or PuTTy
4) A fully qualified domain name
5) A public static IP address.

Overview

The following is an overview of the steps to take to complete the installation:

1) Download and install the LEMP stack.
2) Create a MySQL database and install Snipe-IT.
3) Create a VirtualHost and access the Snipe-IT Web Admin dashboard.
4) Conclusion and next steps.

Step 1: Download and install the LEMP stack

To install Snipe-IT, you need to set up a LEMP (Linux, NGINX, MySQL, PHP) stack. Here are the detailed steps to install the required packages:

1. First, update the package list by running the following command:`

 apt update -y

2. After that, you need to install the necessary packages by running the following command:

 apt install nginx mariadb-server php-bcmath php-common php-ctype php-curl php-fileinfo php-fpm php-gd php-iconv php-intl php-mbstring php-mysql php-soap php-xml php-xsl php-zip git -y

This command installs all the required packages, including NGINX, MariaDB, PHP, and other dependencies.

3. Once you’ve installed the packages, run the following command to install PHP Composer:

apt install composer -y

After successful installation of PHP Composer, you can proceed to the next step.

Step 2: Create a MySQL database and install Snipe-IT

The next step is creating a database for Snipe-IT. Connect to the MySQL shell by running the command:
mysql -u root -p
After connecting, create a database and user with the following commands:
 mysql> CREATE DATABASE snipeit;
mysql> GRANT ALL ON snipeit.* TO snipeit@localhost identified by 'password';
Once done, flush the privileges and exit from the MySQL shell by running the following commands:
mysql> FLUSH PRIVILEGES; 
mysql> \q
Next, navigate to the NGINX web root directory by running the command:
cd /var/www/html 
Download the latest version of Snipe-IT using the following command:
 git clone https://github.com/snipe/snipe-it 
Then, move to the Snipe-IT directory and copy the sample environment file as follows:
 cd snipe-it cp .env.example .env 
Next, edit the environment file using the command
 nano .env 
and define your app URL, database, and other information like this:
APP_URL=http://snipeit.example.com
APP_TIMEZONE='UTC'
DB_DATABASE=snipeit
DB_USERNAME=snipeit
DB_PASSWORD=password
Save and close the file, then set proper permissions and ownership by running the following commands:
 chown -R www-data: /var/www/html/snipe-it chmod -R 755 /var/www/html/snipe-it 
After that, update and install plugins and other required dependencies with the following commands:
 composer update --no-plugins --no-scripts composer install --no-dev --prefer-source --no-plugins --no-scripts 
Finally, generate the artisan key using the following command:
 php artisan key:generate 
You will see an output like this:
**************************************
* Application In Production! *
**************************************
Do you really wish to run this command? (yes/no) [no]: > yes

Step 3: Create a VirtualHost and access the Snipe-IT Web Admin dashboard.

The next step is creating a new NGINX virtual host for Snipe-IT, follow these steps: 1. Open the file /etc/nginx/conf.d/snipeit.conf using the nano editor. 2. Add the following configuration to the file:
server {
        listen 80;
        server_name snipeit.example.com;
        root /var/www/html/snipe-it/public;
        
        index index.php;
                
        location / {
                try_files $uri $uri/ /index.php?$query_string;
        }
        
        location ~ \.php$ {
            include fastcgi.conf;
            include snippets/fastcgi-php.conf;
            fastcgi_pass unix:/run/php/php8.1-fpm.sock;
            fastcgi_split_path_info ^(.+\.php)(/.+)$;
            fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
            include fastcgi_params;
        }
}
3. Save the file and then edit the NGINX main configuration file /etc/nginx/nginx.conf. 4. Add the following line after the line “http {“:
server_names_hash_bucket_size 64;
5. Save the file and then restart Nginx service to apply the changes using the command:
systemctl restart nginx
To access the Snipe-IT Web Interface, follow these steps:

1. Open your web browser and access the Snipe-IT web interface using the URL http://snipeit.example.com.
2. You will see the pre-flight check page. Ensure all required dependencies are installed and click the “Next: Create Database Table” button.
3. On the next page, click the “Next: Create User” button.
4. Define your site name, email, user, and password on the following page and click the “Next: Save User” button.
5. You will see the Snipe-IT dashboard.

Conclusion and next steps

By following this guide, you have successfully installed Snipe-IT on your Ubuntu 22.04 LTS server. You can now access the Snipe-IT web interface and begin managing your IT assets. Here are some next steps to consider:

1) Familiarize yourself with the various features offered by Snipe-IT, such as asset tracking, license management, and reporting.
2) Snipe-IT offers a variety of customization options. You can customize fields, workflows, and branding to fit your specific needs.
3) Grant access to Snipe-IT to your team members and assign appropriate permissions based on their roles.
4) If you have existing asset data, you can import it into Snipe-IT to save time and effort.

For further information and assistance, refer to the official Snipe-IT documentation. Please also check the home page for more helpful guides and tutorials.

Thank you for reading!

Scroll to Top