How to Install Snipe IT on Linux Mint Latest
Snipe IT is an open-source web-based asset management application that can help you track IT assets, software licenses, accessories, and more. In this tutorial, we will show you how to install Snipe IT on Linux Mint.
Requirements
- A Linux Mint system (preferably version 20 or newer)
- A user account with sudo access
- An internet connection
Steps:
Step 1: Update Your System
Before we begin, it's essential to ensure your system is up-to-date. Open the terminal and run the following command:
sudo apt update && sudo apt upgrade -y
This command will update the system package lists and upgrade any outdated packages.
Step 2: Install Required Packages
Snipe IT requires certain packages to run correctly. You can install them using the following command:
sudo apt install curl git unzip mariadb-server mariadb-client apache2 libapache2-mod-php7.4 php7.4-cli php7.4-curl php7.4-gd php7.4-json php7.4-mbstring php7.4-mysql php7.4-xml php7.4-zip php7.4-intl -y
This command will download and install curl, git, unzip, MariaDB, Apache2, and all required PHP modules.
Step 3: Install Composer
Composer is a dependency manager for PHP. You can install it using the following command:
curl -sS https://getcomposer.org/installer | sudo php -- --install-dir=/usr/local/bin --filename=composer
This command will download and install composer globally on your system.
Step 4: Clone Snipe IT Repository
Navigate to your desired installation directory, normally the "var/www/html" directory, and clone the Snipe IT repository using the following command:
cd /var/www/html/
sudo git clone https://github.com/snipe/snipe-it.git
Step 5: Install Snipe IT
Navigate to the Snipe IT directory and install the project dependencies using the following command:
cd snipe-it/
sudo composer install --no-dev --prefer-source
Step 6: Configure Database Connection
You need to create a database for Snipe IT in order to store the application data. You can do this using the following command:
sudo mysql --password
Once you are logged into the MySQL shell, execute the following command to create the Snipe IT database:
CREATE DATABASE snipeit;
Next, create a MySQL user account for Snipe IT using the following command:
CREATE USER 'snipeuser'@'localhost' IDENTIFIED BY 'password';
Note: Replace "password" with a secure password of your own choice.
Grant full privileges to the newly created user for the Snipe IT database:
GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeuser'@'localhost';
Flush the privileges:
FLUSH PRIVILEGES;
Exit the MySQL shell:
exit
Step 7: Configure Snipe IT Environment Variables
Snipe IT uses environment variables to manage database connection settings, email settings, and other settings. Copy the .env.example file as a new .env file:
sudo cp .env.example .env
Edit the .env file using a text editor of your choice (nano, vim, gedit, etc.). Replace the values of the following variables as per your settings:
APP_URL=http://your-domain_name
DB_DATABASE=snipeit
DB_USERNAME=snipeuser
DB_PASSWORD=password
Step 8: Configure Apache
You need to configure Apache to host Snipe IT. Navigate to your Apache configuration directory:
cd /etc/apache2/sites-available
Create a new Apache virtual host configuration file:
sudo touch snipeit.conf
Edit the configuration file using a text editor of your choice:
sudo nano snipeit.conf
Add the following content to the configuration file:
<VirtualHost *:80>
ServerName your-domain_name
DocumentRoot /var/www/html/snipe-it/public
<Directory /var/www/html/snipe-it/public>
Options Indexes FollowSymLinks
AllowOverride All
Require all granted
</Directory>
ErrorLog ${APACHE_LOG_DIR}/snipeit_error.log
CustomLog ${APACHE_LOG_DIR}/snipeit_access.log combined
</VirtualHost>
Note: Replace "your-domain_name" with your actual domain name.
Enable the Apache rewrite module:
sudo a2enmod rewrite
Enable the Snipe IT virtual host configuration:
sudo a2ensite snipeit.conf
Restart the Apache web server:
sudo systemctl restart apache2
Step 9: Install Snipe IT
Navigate to the Snipe IT installation directory and run the following command:
php artisan app:install
This command will set up the Snipe IT application.
Step 10: Access Snipe IT
You can access Snipe IT via your web browser by going to "http://your-domain_name" (replace "your-domain_name" with your actual domain name). Once you have accessed Snipe IT, you can log in using the default login credentials: "[email protected]" and "password."
That's it! You have successfully installed and configured Snipe IT on Linux Mint.