

How to Install Snipe-IT on Ubuntu 20.04
source link: https://www.vultr.com/docs/how-to-install-snipe-it-on-ubuntu-20-04
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.

Snipe-IT is an open-source Information Technology asset management tool that works on a Linux, Apache, MySQL, and PHP (LAMP) stack. With a powerful and user-friendly interface, Snipe-IT eliminates the need for complex IT asset tracking spreadsheets.
Thousands of customers use this free web-based application, and its code-base is updated frequently to fix bugs and improve reliability. If you run an IT department, you can use Snipe-IT to track the staff members assigned to computer hardware, accessories, and consumables. In addition, you can audit warranty and license information for all your IT components.
This guide explains how to install Snipe-IT on Ubuntu 20.04 server.
Prerequisites
To follow this tutorial, you need:
- An Ubuntu 20.04 server.
- A non-root sudo user.
- A LAMP Stack. This guide should work well on either a MySQL or a MariaDB database server.
A domain name such as example.com
is optional.
1. Install Dependencies
SSH to your server as a non-root sudo
user, update your software information index, and upgrade the installed packages.
$ sudo apt update && sudo apt -y upgrade
Enable Apache's mod_rewrite
module. Snipe-IT requires this extension to rewrite URLs more cleanly.
$ sudo a2enmod rewrite
Install the PHP extensions required by both the Snipe-IT application and a PHP Composer
tool.
$ sudo apt install -y php-{opcache,pdo,bcmath,bz2,calendar,ctype,exif,ffi,fileinfo,ftp,gd,iconv,intl,json,mbstring,mysqli,phar,posix,readline,shmop,sockets,sysvmsg,sysvsem,sysvshm,tokenizer,zip,curl,ldap}
Restart your Apache web server to apply the changes.
$ sudo systemctl restart apache2
2. Install PHP Composer
Set up PHP Composer, which is a PHP dependency management tool to install and update libraries in your Snipe-IT environment.
Navigate to your home directory.
$ cd ~
Download the Composer
installer.
$ curl -sS https://getcomposer.org/installer | php
Move the composer.phar
executable to /usr/local/bin/
.
$ sudo mv composer.phar /usr/local/bin/composer
3. Create a Database
Snipe-IT uses MySQL/MariaDB for data storage. To create the database, log in to your MySQL/MariaDB server as a root user.
$ sudo mysql -u root -p
When prompted, enter your root password for your MySQL/MariaDB server and press ENTER to proceed.
Create a snipe_it
database. To access the snipe_it
database, Snipe-IT requires a dedicated non-root MySQL user. Therefore, you must set up a snipe_it_user
with full privileges to the snipe_it
database. You'll require these database credentials later when setting up the Snipe-IT .env
configuration file.
Replace EXAMPLE_PASSWORD
with a strong password.
If your LAMP stack uses MySQL, run these commands.
mysql> CREATE DATABASE snipe_it; CREATE USER 'snipe_it_user'@'localhost' IDENTIFIED WITH mysql_native_password BY 'EXAMPLE_PASSWORD'; GRANT ALL PRIVILEGES ON snipe_it.* TO 'snipe_it_user'@'localhost'; FLUSH PRIVILEGES;
If your LAMP stack uses MariaDB, run these commands.
MariaDB [(none)]> CREATE DATABASE snipe_it; CREATE USER 'snipe_it_user'@'localhost' IDENTIFIED BY 'EXAMPLE_PASSWORD'; GRANT ALL PRIVILEGES ON snipe_it.* TO 'snipe_it_user'@'localhost'; FLUSH PRIVILEGES; EXIT;
4. Install Snipe-IT
Navigate to the root directory of your web server.
$ cd /var/www/
Use git to clone the latest Snipe-IT repository from the https://github.com/snipe/snipe-it
URL and copy the downloaded files to a snipe-it
directory.
$ sudo git clone https://github.com/snipe/snipe-it snipe-it
Switch to the snipe-it
directory.
$ cd /var/www/snipe-it
Snipe-IT ships with a sample configuration file. Copy it to /var/www/snipe-it/.env
.
$ sudo cp /var/www/snipe-it/.env.example /var/www/snipe-it/.env
Edit the configuration file.
$ sudo nano /var/www/snipe-it/.env
In the Snipe-IT configuration file, locate these settings.
APP_URL=null
APP_TIMEZONE='UTC'
Set APP_URL
to your server's Fully Qualified Domain Name, or it's public IP address. If you use a time zone other than UTC, change the timezone to a PHP-supported timezone, and enclose it in single quotes.
APP_URL=example.com
APP_TIMEZONE='America/New_York'
Locate these settings.
DB_DATABASE=null
DB_USERNAME=null
DB_PASSWORD=null
Change those values to the database information you set up in Step 3.
DB_DATABASE=snipe_it
DB_USERNAME=snipe_it_user
DB_PASSWORD=EXAMPLE_PASSWORD
Save and close the file.
Set the correct ownership and permission for the Snipe-IT data directory.
$ sudo chown -R www-data:www-data /var/www/snipe-it
$ sudo chmod -R 755 /var/www/snipe-it
Install the unzip
tool to avoid unpacking zip files using the PHP zip extensions, which might trigger some errors.
$ sudo apt-get install -y unzip
Install the Snipe-IT dependencies with Composer. You'll receive a warning not to run this as root on each command. It's okay to continue as root for the Snipe-IT install, so type yes
and hit ENTER.
$ sudo composer update --no-plugins --no-scripts
$ sudo 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
configuration file you created earlier. Type yes
and hit ENTER when prompted to continue.
$ sudo php artisan key:generate
5. Create a Virtual Host File
Apache comes with a default virtual host file named 000-default.conf
. To make troubleshooting easier, disable the default Apache configuration file and create a new Apache configuration file for Snipe-IT.
Disable the default Apache configuration file.
$ sudo a2dissite 000-default.conf
Create a new Apache configuration file.
$ sudo nano /etc/apache2/sites-available/snipe-it.conf
Paste the information below and replace example.com
with your server's domain name or public IP address.
<VirtualHost *:80>
ServerName example.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 exit the file.
Enable your new configuration file.
$ sudo a2ensite snipe-it.conf
Restart your Apache web server to apply the changes.
$ sudo systemctl restart apache2
6. Run the Setup Wizard
In a web browser, visit your server using its domain name or public IP address. Follow the prompts on the setup wizard to complete the installation. When finished, you should see the dashboard.
Conclusion
In this guide, you've installed the Snipe-IT asset management tool on your Ubuntu 20.04 server. Use the cloud-based application to manage your IT resources in your organization.
Want to contribute?
You could earn up to $600 by adding new articles
Recommend
-
126
addkeywget-qhttps://www.virtualbox.org/download/oracle_vbox_2016.asc-O-|sudoapt-keyadd-addsourcessudosh-c'echo"deb[arch=amd64]http://download.virtualbox.org/virtualbox/debianxenialcontrib">>/etc
-
72
addrepositoryaptadd-repositoryppa:webupd8team/javaupdateaptupdateinstallaptinstalloracle-java9*
-
85
README.md
-
63
下载ngx_devel_kit # cd /opt # git clone https://github.com/simplresty/ngx_devel_kit.git && cd ngx_devel_kit && git checkout master 下载lua-nginx-module
-
68
环境 Ubuntu14.04 Git 1.9.1 Gitolite 安装OpenSSH-Server sudo apt-get install openssh-server 安装Git服务端 ...
-
37
安装PPTP,以用来提供VPN服务 sudo apt-get install pptpd 配置pptp sudo vi /etc/pptpd.conf 取消掉以下两行的注释: localip 192.1...
-
12
MySQL is a common open source relational database for creating, reading, updating and deleting data in
-
5
How To Install Snipe-IT Asset Management on CentOS 8IntroductionSnipe-IT is a Free Open Source project built on Laravel made for IT asset management. This is to for example help to enable IT departments to track who has which laptop,...
-
17
<?xml encoding="utf-8" ??>Introduction Snipe-IT is a free and open-source project designed to handle IT asset management. It can handle keeping track of assets such as laptops, software, and lic...
-
3
Access denied Access denied Error code 1020 You do not have access to azhuge233.com.The site owner may have set restrictions that prevent you from accessing the site. Contact the site owner for ac...
About Joyk
Aggregate valuable and interesting links.
Joyk means Joy of geeK