How to Install Snipe IT on Kali Linux
Snipe-IT is a free, open-source IT asset management software provided by Snipe IT Inc. It is used to manage assets like computers, smartphones, and other electronic equipment. In this tutorial, we will see how to install Snipe IT on Kali Linux.
Requirements
- Kali Linux OS
- Root user access
- A webserver (e.g., Apache or Nginx)
Step 1: Update the System
Before installing any package, it is a good practice to update the system to ensure everything is up to date. Execute the following command in the terminal:
sudo apt update && sudo apt upgrade
Step 2: Install Required Packages
Snipe-IT is built with PHP, so we need to install some PHP-related packages. To install them, run the following command:
sudo apt-get install php php-gd php-mysql php-curl php-cli php-mbstring php-ldap php-bcmath php-zip
Once the installation completes, run the following command:
sudo systemctl restart apache2
This will reload our webserver with new PHP modules.
Step 3: Install Composer
Composer is a dependency manager used to install and manage PHP packages. Run the following command to install Composer:
sudo apt-get install composer
Step 4: Download Snipe IT
Next, we will download Snipe IT's latest version from the official website using the following command:
sudo wget https://github.com/snipe/snipe-it/archive/master.zip
Step 5: Extract Snipe IT
Now that we have downloaded Snipe IT, we need to extract it from the zip file using the following command:
sudo unzip master.zip
This will extract the Snipe IT folder into our current directory.
Step 6: Install Snipe IT
Execute the following commands to install Snipe IT:
mv snipe-it-master/ /usr/share/snipe-it
cd /usr/share/snipe-it/
sudo composer install --no-dev
sudo chown -R www-data:www-data /usr/share/snipe-it/
sudo chmod -R 755 /usr/share/snipe-it/
This will install Snipe IT to /usr/share/snipe-it directory, and set the appropriate permissions.
Step 7: Create a Database
Now, we need to create a database for Snipe IT to use. Open the MySQL command-line interface by running the following command:
sudo mysql -u root -p
Enter the root password when prompted.
Once you are in the MySQL CLI, create a database and user for Snipe IT with the following commands:
CREATE DATABASE snipeit;
CREATE USER 'snipeituser'@'localhost' IDENTIFIED BY 'password';
GRANT ALL PRIVILEGES ON snipeit.* TO 'snipeituser'@'localhost';
FLUSH PRIVILEGES;
Replace password with your desired password.
Step 8: Required Environment Variables
Snipe IT has some configuration details that must be specified in environment variables. We will create a new file in /etc/apache2/sites-available directory for our Snipe IT virtual host:
sudo touch /etc/apache2/sites-available/snipeit.conf
sudo nano /etc/apache2/sites-available/snipeit.conf
Add the following lines to the file:
<VirtualHost *:80>
ServerAdmin webmaster@localhost
ServerName snipeit.example.com # Replace "example.com" with your domain or IP address
DocumentRoot /usr/share/snipe-it/public/
<Directory /usr/share/snipe-it/public>
AllowOverride All
Require all granted
</Directory>
SetEnv APP_ENV production
SetEnv APP_DEBUG false
SetEnv APP_URL http://snipeit.example.com # Replace "example.com" with your domain or IP address
SetEnv APP_KEY your_app_key # Generate an APP_KEY with the artisan command from the next section
SetEnv APP_CIPHER AES-256-CBC
SetEnv APP_LOCALE en
SetEnv APP_TIMEZONE UTC
SetEnv APP_LOG daily
SetEnv APP_LOG_LEVEL warn
SetEnv APP_TRUSTED_PROXIES
SetEnv DB_CONNECTION mysql
SetEnv DB_HOST localhost
SetEnv DB_PORT 3306
SetEnv DB_DATABASE snipeit
SetEnv DB_USERNAME snipeituser
SetEnv DB_PASSWORD password # Replace with your own DB password
</VirtualHost>
Save and close the file.
Step 9: Enable Snipe IT
Execute the following commands to enable the Snipe IT virtual host and restart Apache:
sudo a2ensite snipeit.conf
sudo systemctl restart apache2
Step 10: Generate App Key
Run the following command to generate an APP_KEY:
cd /usr/share/snipe-it
sudo php artisan key:generate --force
Step 11: Setup Snipe IT
Now that Snipe IT is installed, we need to set it up by browsing to the URL of the virtual host. In our example, the URL is http://snipeit.example.com.
Follow the on-screen instructions to set up Snipe IT. When prompted for database details, enter the following:
- Driver: MySQL
- Host: localhost
- Port: 3306
- Database: snipeit
- Username: snipeituser
- Password: the password you set in Step 7
Once everything is configured, log in with the default username and password:
- Username:
admin - Password:
password
Note: Please change the default password immediately after logging in.
Congratulations! You have successfully installed Snipe IT on Kali Linux.