<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0"><channel><title><![CDATA[Ewan Oomen]]></title><description><![CDATA[Ewan Oomen]]></description><link>https://blog.ewanoo.men</link><generator>RSS for Node</generator><lastBuildDate>Thu, 16 Apr 2026 14:15:48 GMT</lastBuildDate><atom:link href="https://blog.ewanoo.men/rss.xml" rel="self" type="application/rss+xml"/><language><![CDATA[en]]></language><ttl>60</ttl><item><title><![CDATA[How to install Snipe-IT on Ubuntu Server 20.04]]></title><description><![CDATA[What is Snipe-IT?
Snipe-IT is a free open source asset management system. This article will take you through the steps to install Snipe-IT on Ubuntu Server 20.04.
More information about Snipe-IT:

Website: https://snipeitapp.com/
Documentation: https...]]></description><link>https://blog.ewanoo.men/how-to-install-snipe-it-on-ubuntu-server-2004</link><guid isPermaLink="true">https://blog.ewanoo.men/how-to-install-snipe-it-on-ubuntu-server-2004</guid><category><![CDATA[Linux]]></category><category><![CDATA[Ubuntu]]></category><category><![CDATA[sysadmin]]></category><category><![CDATA[apache]]></category><dc:creator><![CDATA[Ewan Oomen]]></dc:creator><pubDate>Tue, 16 Feb 2021 20:58:56 GMT</pubDate><content:encoded><![CDATA[<h1 id="what-is-snipe-it">What is Snipe-IT?</h1>
<p>Snipe-IT is a free open source asset management system. This article will take you through the steps to install Snipe-IT on Ubuntu Server 20.04.</p>
<p>More information about Snipe-IT:</p>
<ul>
<li>Website: https://snipeitapp.com/</li>
<li>Documentation: https://snipe-it.readme.io/docs</li>
<li>GitHub repository: https://github.com/snipe/snipe-it</li>
</ul>
<h1 id="prerequisites">Prerequisites</h1>
<ul>
<li>Server with Ubuntu Server 20.04 installed</li>
<li>User with sudo privileges</li>
<li>Static IP/hostname</li>
<li>SSL certificate and private key in PEM format in case you want to use HTTPS (recommended)</li>
</ul>
<h1 id="installation">Installation</h1>
<p>These steps will install Snipe-IT in the <code>/var/www/snipe-it</code> directory. If you want to install Snipe-IT in a different directory you will need to change the commands accordingly. </p>
<h2 id="step-1-installing-packages">Step 1: Installing packages</h2>
<p>In this step the packages needed by Snipe-IT will be installed: Apache2, PHP + modules and MariaDB.</p>
<pre><code>sudo apt <span class="hljs-keyword">install</span> apache2 php libapache2-<span class="hljs-keyword">mod</span>-php php-<span class="hljs-keyword">json</span> php-mbstring php-tokenizer php-curl php-mysql php-ldap php-zip php-bcmath php-<span class="hljs-keyword">xml</span> php-imagick mariadb-<span class="hljs-keyword">server</span>
</code></pre><h2 id="step-2-creating-the-database">Step 2: Creating the database</h2>
<p>Snipe-IT needs a database to store it's data, this step will take you through creating the database and a database user.</p>
<p>Enter the following command to start a MySQL shell as the root user.</p>
<pre><code><span class="hljs-attribute">sudo</span> mysql -u root
</code></pre><p>Next enter the commands below to create the database <code>snipeit_data</code>, create the user <code>snipeit_data_user</code> and grant the user permissions on the database with a password. Afterwards enter <code>exit</code> to exit out of the shell.</p>
<blockquote>
<p>Please change <code>&lt;password&gt;</code> below to a secure password and take note of it. You will need this later.</p>
</blockquote>
<pre><code><span class="hljs-keyword">create</span> <span class="hljs-keyword">database</span> snipeit_data;
<span class="hljs-keyword">create</span> <span class="hljs-keyword">user</span> snipeit_data_user;
<span class="hljs-keyword">grant</span> <span class="hljs-keyword">all</span> <span class="hljs-keyword">on</span> snipeit_data.* <span class="hljs-keyword">to</span> <span class="hljs-string">'snipeit_data_user'</span>@<span class="hljs-string">'localhost'</span> <span class="hljs-keyword">identified</span> <span class="hljs-keyword">by</span> <span class="hljs-string">'&lt;password&gt;'</span>;
exit
</code></pre><h2 id="step-3-creating-snipe-it-directory-and-downloading-snipe-it">Step 3: Creating Snipe-IT directory and downloading Snipe-IT</h2>
<p>This step will create the <code>/var/www/snipe-it</code> directory and set it's permissions. After that we pull the source code from GitHub.</p>
<p>The following commands will create the directory; change the owner to our sudo user (administrator in my case, might differ in your case); set the group to <code>www-data</code>; set the permissions read, write and execute (7) for the owner, read and execute (5) for the group and none (0) for others; and set the inheritance of the group to newly created underlying files/directories.</p>
<pre><code>sudo mkdir /<span class="hljs-keyword">var</span>/www/snipe-it
sudo chown -R administrator /<span class="hljs-keyword">var</span>/www/snipe-it/
sudo chgrp -R www-<span class="hljs-keyword">data</span> /<span class="hljs-keyword">var</span>/www/snipe-it/
sudo chmod -R <span class="hljs-number">750</span> /<span class="hljs-keyword">var</span>/www/snipe-it/
sudo chmod g+s /<span class="hljs-keyword">var</span>/www/snipe-it/
</code></pre><p>Next up clone the Snipe-IT source code from the GitHub repository into the directory you just created.</p>
<pre><code>git clone <span class="hljs-symbol">https:</span>/<span class="hljs-regexp">/github.com/snipe</span><span class="hljs-regexp">/snipe-it /var</span><span class="hljs-regexp">/www/snipe</span>-it
</code></pre><p>The user as which the web server runs, www-data in our case, needs write permissions on 2 folders within the <code>/var/www/snipe-it</code> directory: <code>public/uploads</code> and <code>storage</code>.</p>
<pre><code>chmod g+w /<span class="hljs-keyword">var</span>/www/snipe-it/<span class="hljs-keyword">public</span>/uploads
chmod g+w /<span class="hljs-keyword">var</span>/www/snipe-it/storage
</code></pre><h2 id="step-4-editing-the-env-configuration-file">Step 4: Editing the .env configuration file</h2>
<p>Most of the configuration of Snipe-IT is done in the <code>.env</code> file. This file needs to be created first, the easiest way to do this is to create a copy of <code>.env.example</code>.</p>
<pre><code>cd /<span class="hljs-keyword">var</span>/www/snipe-it
cp .env.example .env
</code></pre><p>Next we can edit the newly created <code>.env</code> file. I use <em>vi</em> but you can use whatever text editor you prefer.</p>
<pre><code><span class="hljs-selector-tag">vi</span> <span class="hljs-selector-class">.env</span>
</code></pre><p>The documentation on https://snipe-it.readme.io/docs/configuration describes which settings can be configured. To continue you need to change at least the following:</p>
<pre><code><span class="hljs-attr">APP_URL</span>=&lt;domainname at which Snipe-IT will be running, including http:// or https://&gt;
<span class="hljs-attr">DB_DATABASE</span>=snipeit_data
<span class="hljs-attr">DB_USERNAME</span>=snipeit_data_user
<span class="hljs-attr">DB_PASSWORD</span>=&lt;password you created in step <span class="hljs-number">2</span>&gt;
<span class="hljs-attr">IMAGE_LIB</span>=imagick
</code></pre><p>After changing these settings save and close the <code>.env</code> file. (<code>ESC</code> and then <code>:wq</code> in case you're using <em>vi</em>)</p>
<h2 id="step-5-installing-dependencies-via-composer">Step 5: Installing dependencies via composer</h2>
<p>Snipe-IT needs specific vendor packages to function. These are installed via composer.</p>
<p>The following commands will install composer and install the dependencies.</p>
<pre><code><span class="hljs-attribute">cd</span> /var/www/snipe-it
curl -sS https://getcomposer.org/installer | php
php composer.phar update
php composer.phar install --<span class="hljs-literal">no</span>-dev --prefer-source
</code></pre><h2 id="step-6-configuring-the-web-server">Step 6: Configuring the web server</h2>
<p>The web server needs to point to the Snipe-IT files. These steps take you through configuring the web server.</p>
<p>Create a Apache2 VirtualHost config file.</p>
<pre><code><span class="hljs-built_in">cd</span> /etc/apache2/sites-available
sudo vi snipe-it.conf
</code></pre><p>The following configuration is set up for the use of HTTPS. It assumes the SSL certificate is located at <code>/etc/ssl/certs/snipe-it.pem</code> and the private key at <code>/etc/ssl/private/snipe-it.key</code>. You can change these locations if necessary.</p>
<pre><code><span class="hljs-section">&lt;VirtualHost *<span class="hljs-number">:443</span>&gt;</span>
    <span class="hljs-section">&lt;Directory /var/www/snipe-it/public&gt;</span>
        <span class="hljs-attribute"><span class="hljs-nomarkup">Allow</span></span> From <span class="hljs-literal">All</span>
        <span class="hljs-attribute">AllowOverride</span> <span class="hljs-literal">All</span>
        <span class="hljs-attribute"><span class="hljs-nomarkup">Options</span></span> +Indexes
    <span class="hljs-section">&lt;/Directory&gt;</span>
    <span class="hljs-attribute"><span class="hljs-nomarkup">DocumentRoot</span></span> /var/www/snipe-it/public

    <span class="hljs-attribute">SSLEngine</span> <span class="hljs-literal">on</span>
    <span class="hljs-attribute">SSLCertificateFile</span> /etc/ssl/certs/snipe-it.pem
    <span class="hljs-attribute">SSLCertificateKeyFile</span> /etc/ssl/private/snipe-it.key
<span class="hljs-section">&lt;/VirtualHost&gt;</span>
</code></pre><p>If you don't want to use HTTPS you can use the configuration below for standard HTTP.</p>
<pre><code><span class="hljs-section">&lt;VirtualHost *<span class="hljs-number">:80</span>&gt;</span>
    <span class="hljs-section">&lt;Directory /var/www/snipe-it/public&gt;</span>
        <span class="hljs-attribute"><span class="hljs-nomarkup">Allow</span></span> From <span class="hljs-literal">All</span>
        <span class="hljs-attribute">AllowOverride</span> <span class="hljs-literal">All</span>
        <span class="hljs-attribute"><span class="hljs-nomarkup">Options</span></span> +Indexes
    <span class="hljs-section">&lt;/Directory&gt;</span>
    <span class="hljs-attribute"><span class="hljs-nomarkup">DocumentRoot</span></span> /var/www/snipe-it/public
<span class="hljs-section">&lt;/VirtualHost&gt;</span>
</code></pre><p>After saving the configuration file you need to enable the following Apache2 modules. <code>ssl</code> is only required when using HTTPS.</p>
<pre><code><span class="hljs-attribute">sudo</span> a<span class="hljs-number">2</span>enmod rewrite
<span class="hljs-attribute">sudo</span> a<span class="hljs-number">2</span>enmod ssl
</code></pre><p>The last step is to disable the default site and enable the Snipe-IT site. And restart Apache2.</p>
<pre><code><span class="hljs-attribute">sudo</span> a<span class="hljs-number">2</span>dissite <span class="hljs-number">000</span>-default 
<span class="hljs-attribute">sudo</span> a<span class="hljs-number">2</span>ensite snipe-it 
<span class="hljs-attribute">sudo</span> systemctl restart apache<span class="hljs-number">2</span>
</code></pre><h2 id="step-7-starting-services-at-server-startup">Step 7: Starting services at server startup</h2>
<p>Automatically start the Apache2 and MariaDB service at server startup.</p>
<pre><code>sudo systemctl <span class="hljs-keyword">enable</span> apache2
sudo systemctl <span class="hljs-keyword">enable</span> mariadb
</code></pre><h2 id="step-8-snipe-it-pre-flight-and-setup">Step 8: Snipe-IT Pre-Flight &amp; Setup</h2>
<p>To complete the installation you need to fill in the required fields to set up your admin user.</p>
<p>Now you're all set and done and you can start using Snipe-IT to manage your assets!</p>
]]></content:encoded></item></channel></rss>