In this tutorial, we will show you how to install Snipe-IT on AlmaLinux 8. For those of you who didn’t know, 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 a web-based software, which enables IT, administrators, in medium to large enterprises to track physical assets, software licenses, accessories, and many more.
This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo
‘ to the commands to get root privileges. I will show you through the step-by-step installation of the Snipe-IT asset management system on an AlmaLinux 8. You can follow the same instructions for Fedora, RHEL, CentOS, and Rocky Linux distributions.
Prerequisites
- A server running one of the following operating systems: AlmaLinux 8.
- It’s recommended that you use a fresh OS install to prevent any potential issues.
- A
non-root sudo user
or access to theroot user
. We recommend acting as anon-root sudo user
, however, as you can harm your system if you’re not careful when acting as the root.
Install Snipe-IT on AlmaLinux 8
Step 1. First, let’s start by ensuring your system is up-to-date.
sudo dnf update sudo dnf install epel-release
Step 2. Installing a LAMP server.
An AlmaLinux LAMP server is required. If you do not have LAMP installed, you can follow our guide here.
Step 3. Installing Composer.
Run the following command to download the Composer installer script:
wget https://getcomposer.org/installer -O composer-installer.php
Once the installer is downloaded, we can install Composer on our AlmaLinux system using the command below:
php composer-installer.php --filename=composer --install-dir=/usr/local/bin
Verify the PHP Composer version once the installation is done:
composer --version
Step 4. Configuring MariaDB.
By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation
script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:
mysql_secure_installation
Configure it like this:
- Set root password? [Y/n] y - Remove anonymous users? [Y/n] y - Disallow root login remotely? [Y/n] y - Remove test database and access to it? [Y/n] y - Reload privilege tables now? [Y/n] y
Next, we will need to log in to the MariaDB console and create a database for Snipe-IT. Run the following command:
mysql -u root -p
This will prompt you for a password, so enter your MariaDB root password and hit Enter. Once you are logged in to your database server you need to create a database for Snipe-IT installation:
MariaDB [(none)]> CREATE DATABASE snipe_it; MariaDB [(none)]> CREATE USER ‘snipe_user’@’localhost’ IDENTIFIED BY ‘your-strong-password’; MariaDB [(none)]> GRANT ALL ON snipe_it.* TO ‘snipe_user’@'localhost’ IDENTIFIED BY ‘your-strong-password’ WITH GRANT OPTION; MariaDB [(none)]> FLUSH PRIVILEGES; MariaDB [(none)]> EXIT
Step 5. Installing Snipe-IT on AlmaLinux 8.
By default, Snipe-IT is not available on the AlmaLinux base repository. Now we clone the latest Snipe-IT repository from GitHub using the following command below:
cd /var/www/ git clone https://github.com/snipe/snipe-it snipe-it
Next, changes to the snipe-it directory:
cd /var/www/snipe-it cp /var/www/snipe-it/.env.example /var/www/snipe-it/.env
After that, edit the configuration file:
sudo /var/www/snipe-it/.env
Add the configuration file:
# -------------------------------------------- # REQUIRED: BASIC APP SETTINGS # -------------------------------------------- APP_ENV=production APP_DEBUG=false APP_KEY=ChangeMe APP_URL=your-domain.com APP_TIMEZONE='UTC' APP_LOCALE=en MAX_RESULTS=500 # -------------------------------------------- # REQUIRED: DATABASE SETTINGS # -------------------------------------------- DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=snipe_it DB_USERNAME=snipe_user DB_PASSWORD=your-strong-password DB_PREFIX=null DB_DUMP_PATH='/usr/bin' DB_CHARSET=utf8mb4 DB_COLLATION=utf8mb4_unicode_ci # --------------------------------------------
Then, set the correct ownership and permission for the Snipe-IT data directory:
chown -R apache:apache /var/www/snipe-it chmod -R 755 /var/www/snipe-it
Next, install the Snipe-IT dependencies with Composer:
composer update –no-plugins –no-scripts composer install –no-dev –prefer-source –no-plugins –no-scripts
Once the Composer finishes running, generate a Laravel APP_Key
value in the /var/www/snipe-it/.env
the configuration file you created earlier:
php artisan key:generate
Step 6. Configuring Apache.
Now we create a virtual host file on the webserver for Snipe-IT:
nano /etc/httpd/conf.d/snipe-it.conf
Add the following file:
<VirtualHost *:80> ServerName your-domian.com DocumentRoot /var/www/snipe-it/public <Directory /var/www/snipe-it/public> Options Indexes FollowSymLinks MultiViews AllowOverride All Order allow,deny allow from all </Directory> </VirtualHost>
Save and close the file, then restart the Apache webserver so that the changes take place:
sudo systemctl restart httpd sudo systemctl enable httpd
Step 7. Accessing Snipe-IT Web Interface.
Once successfully installed, open a web browser and point it to the address URL http://your-IP-address
to view the Snipe-IT web installation interface and complete the required steps to finish the installation.
Congratulations! You have successfully installed Snipe-IT. Thanks for using this tutorial for installing the Snipe-IT asset management system on your AlmaLinux 8 system. For additional help or useful information, we recommend you check the official Snipe-IT website.