How to Install Snipe IT asset management on Ubuntu

How to Install Snipe IT asset management on Ubuntu

In large IT environment, hell in any IT setup, keeping track of where your assets is vital. There’s a wealth of great asset management tools out there – including apps like Wasp Asset Management or the specialist School Asset Manager – but if you are after an open source solution then Snipe is definitely the one to look at.

Like any open source tool it can take some tweaking but what you get is a decent asset management tool that supports checkin and checkout receipts, custom fields, reporting, QR codes and much more. To make things easier here’s a belt and braces guide to getting it up and working. We’ll be using Ubuntu 14 Server LTS configured for a standard LAMP implementation – just choose LAMP from the list of installation options during the setup of Ubuntu – but Snipe also supports Windows with WAMP and IIS support but I found it waayyyyyyyyyy easier to get running in Linux.

  1. Download the handy Snipe install script to your home directory.
    wget https://raw.githubusercontent.com/snipe/snipe-it/master/install.sh
  2. Make it executable.
    chmod 744 install.sh ./install.sh
  3.  Run the install script.
    ./install.sh
  4. Once the installer has run through it’s paces, and asked you a series of questions, you will have a working Snipe installation. Congratulations. Now to a few tweaks.
  5. Copy the example app.php file to a new file.
    sudo vi /var/www/snipeit/app/config/production/app.example.php
  6. Change the following lines to ensure that your server is working. If you want to enable HTTPS via an SSL cert then feel free to skip this step and have a google as to how to use OpenSSL to do that.Change…
    'url' => 'https://myhostname',
    for…
    'url' => 'http://myhostname',
  7. Change the following lines to ensure that email addresses user imports are handled nicely. If you won’t be doing any imports feel free to skip this step but it’s good practice to update this.Change…
    'domain' => '',
    for…
    'domain' => 'http://myhostname.co.uk',

Sending mail

You’ll be wanting to make use of email in order to support the check-in and check-out receipts. Snipe supports SMTP and Sendmail. I couldn’t get its SMTP implementation working for love nor money but, whilst I’m no lover of Sendmail, I did get Sendmail working.

We use Exchange here as our local mail server so we only needed Sendmail to send emails out via Exchange as a smart relay. A very simple implementation. If you need something more, have a quick google.

  1. Install sendmail on Ubuntu.
    sudo apt-get install sendmail
  2. Edit the sendmail.mc and configure your smart relay host.
    sudo vi /etc/mail/sendmail.mc
  3. At the bottom of the file add the following line and save and exit.
    define('SMART_HOST','exchange.mydomain.co.uk')
  4. Update Sendmail with the new configuration. Run sendmailconfig and just keep pressing Y for yes.
    sudo sendmailconfig
  5. Now it’s time to edit the Snipe config file and enter the new settings. Copy the example mail configuration file.
    sudo cp /var/www/snipeit/app/config/production/mail.example.php /var/www/snipeit/app/config/production/mail.php
  6. Edit the file and make the changes.
    sudo vi /var/www/snipeit/app/config/production/mail.php
  7. Change the following lines to enable sendmail use.  On a normal install you shouldn’t have to change the location of Sendmail but, if you do need to, you can also look at sendmail location parameter at the end of the mail.php file.Change…
    'driver' => 'smtp',
    for…
    'driver' => 'sendmail',
  8. Now when you are adding your Asset Categories in Snipe you can tick the box to send check-in emails and the user will receive them.snipe_email

Configuring LDAP

If you are an organisation of any decent size then adding your users will be a real effort. It’s much easier to look at importing via LDAP direct from your Active Directory servers.

  1. Create a user in Active Directory for the LDAP settings to connect with. This doesn’t have to be an administrator, just a normal user. However make sure that they have a good secure password, and you might want to secure the account and prevent external logons and the like. I’ll leave that to you.
  2. Log in to Snipe using your admin logon created during the install process. Click on the Admin menu then choose Settings.Snipe Settings
  3. You’ll need to configure the LDAP settings for your own environment but here are my settings. The “LDAP Bind Username” parameter points to the username of your LDAP user that you created before. The “Base Bind DN” is the location in your directory where your users reside. You might want to specify the root, or you might want to target a specific OU.
    Click to enlarge

    Click to enlarge

  4. Make sure you have a Location created in Snipe. Go to Admin > Locations and click Create New.
  5. Now go to the Peoples section of Snipe and click the LDAP Import button. Choose which location to import those users to and hit import.
    LDAPImport

Author

Oliver Marshall

Oliver works as a Director at Oakson who provide absolutely awesome IT support in Brighton, UK. Out of hours he’s a runner with a limp, has a board game addiction and a owns a dog that looks like a badger.

  • Lee

    Thank you for this.
    I’m currently using XAMPP to install Snipe-IT on Windows but will be sure to use this guide if / when I transfer to Ubuntu. Having the same issues using SMTP so will see if I have any better luck with SendMail on Windows.

    • Oliver Marshall

      Hi Lee

      I gave up using XAMPP. Not because it didn’t work but just because the ubuntu install script seemed to take care of the majority of the footwork. It’s a shame there isn’t a PHP install script which could be used on any OS.

      Thanks for the comment.

  • Nicky Woo

    Thanks for the installation guide but I’m still failed to install it. I’m very sorry because I seldom use Ubuntu, so quite confuse about it. It would be nice if you can provide a video of the installation. Again, sorry if my request is too much and give trouble to you.

    • Hi Nick. Which bit are you stuck on?

      Tell me what error you get and I might know how to help – of course I might not 🙂

      • Nicky Woo

        Hi Mr. Oliver,

        I’ve followed all the steps which provided by you but when I try to login to it, it cannot display it properly which is showing at the attached JPG file. Please advise how to fix it, Thank you.

        • Hi Nick

          Well there are two things you can try. Firstly run the following command from your command line on that Ubuntu server;

          tail /var/log/apache2/error.log -n20

          This will show you the last 20 lines of the apache2 error log. There might be something obvious in there.

          Next up, paste the output of the following command line.

          less /var/log/snipeit-install.log

          That will show you the output of the SnipeIT install log which is the most likely place to show any errors that may have arisen.

          If we can’t see anything obvious then it may be worth posting on the SnipeIT support forum at GIT. Here’s the link…

          https://github.com/snipe/snipe-it/issues

Show Buttons
Hide Buttons

Before you go...

or
Subscribe to my newsletter

If you enjoyed this article then why not let me know.