How to Install Snipe IT on Ubuntu Server Latest
In this tutorial, we will guide you on how to install Snipe IT, an open-source asset management software, on Ubuntu Server Latest.
Prerequisites
Before proceeding with the Snipe IT installation, you need to have the following prerequisites on your Ubuntu Server:
- A non-root user account with sudo privileges
- Apache, PHP, and MySQL or MariaDB installed and configured on your Ubuntu Server
- PHP extensions required for Snipe IT to run, which include:
- php-curl
- php-mysql
- php-gd
- php-mbstring
- php-ldap
- php-xml
Step 1: Install Composer
Composer is a package manager for PHP that is required for Snipe IT installation. To install it, run the following command:
sudo apt-get install composer -y
After the installation has completed, verify the version of Composer:
composer --version
Step 2: Install Snipe IT
Now, we will download and install Snipe IT on our Ubuntu Server. To do this, follow the below steps:
Clone the Snipe IT repository from GitHub using the below command:
git clone https://github.com/snipe/snipe-it.git /var/www/snipe-itThe above command will clone the Snipe IT repository to the
/var/www/snipe-itdirectory on your Ubuntu Server.Once the repository has been cloned, navigate to the
snipe-itdirectory and install Snipe IT dependencies using the below command:cd /var/www/snipe-it composer install --no-dev --prefer-sourceThis command will install all the required packages and dependencies required for the Snipe IT installation.
Now, we will copy the
.env.examplefile to create a new.envfile:cp .env.example .envGenerate an application key using the below command:
php artisan key:generateEdit the
.envfile to configure the database settings. You will need to provide your database information such as database name, user, password, and host.nano .envNext, we will set appropriate permissions on the storage directory using the following command:
chmod -R 755 storage chmod -R 755 public/uploadsFinally, migrate the database using the below command:
php artisan migrate --seedThis command will create the database tables and seed some basic data.
Step 3: Configure Apache for Snipe IT
The final step is to configure Apache to serve the Snipe IT web application.
Create a new VirtualHost in Apache using the below command:
sudo nano /etc/apache2/sites-available/snipe-it.confPaste the following configuration in the
snipe-it.conffile:<VirtualHost *:80> ServerName example.com # Replace with your domain name or IP address DocumentRoot /var/www/snipe-it/public <Directory /var/www/snipe-it/public> AllowOverride All Options Indexes FollowSymLinks Require all granted </Directory> ErrorLog ${APACHE_LOG_DIR}/error.log CustomLog ${APACHE_LOG_DIR}/access.log combined </VirtualHost>Note: Replace the
ServerNamevalue with your domain name or IP address.Once you have saved the
snipe-it.conffile, you can enable the VirtualHost using the following command:sudo a2ensite snipe-it.confReload the Apache service to apply the changes:
sudo systemctl reload apache2
Step 4: Access Snipe IT Web Panel
In your web browser, browse to your domain name or IP address that you have used to configure Apache:
http://example.com
You will be presented with the Snipe IT login page. Use the default credentials to log in to the Snipe IT dashboard:
Email: [email protected]
Password: admin
You will then be prompted to change your password. Once done, you will have successfully installed and configured Snipe IT on your Ubuntu Server. Congrats!
Conclusion
In this tutorial, you have learned how to install and configure Snipe IT on Ubuntu Server with Apache web server.