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.
Here at Ibmi Media, as part of our Server Management Services, we regularly help our Customers to perform related Software Installation queries.
In this context, we shall look into how to install Snipe-IT on AlmaLinux 8.
1. Perform System Update
To begin, ensure that your system is up-to-date with the below command:
$ sudo dnf update
Next, install EPEL:
$ sudo dnf install epel-release
2. Install LAMP server on the system
Now install LAMP server on AlmaLinux.
3. Install 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
4. Configure 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
5. Install Snipe-IT on the system
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
6. Configure 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
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.
Once you complete the setup wizard, you will redirected to the Snipe-IT dashboard.
This article covers how to install Snipe-IT on AlmaLinux 8. In fact, Snipe-IT is a open-source IT asset management and it eliminates the need for complex IT asset tracking spreadsheets.