Register Now

Login

Lost Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Snipe-IT Installation On Windows Server

Snipe-IT Installation On Windows Server

In this detailed tutorial, we will go through all the required steps needed to be performed in order to successfully install Snipe-IT on Windows Server 2019.

This blog is updated on 31st Jan 2021. Make sure you install Visual C++ 2015-2019 Redistributable if you are planning to use PHP Version 7.3 or higher

Software Requirements:

1. Server 2019 Setup

It can be a virtual machine or a physical server. Make sure you have a static IP address assigned and a working Internet connection.

In our example:

  • Server Name: AMS-04
  • IP Address: 10.0.0.2

2. IIS Server and CGI Roles

 Let’s add required roles to our server.

  • Open Server Manager and start add IIS Server Role and CGI feature in Applications Development

3. Install Visual C++ 2015-2019

  • Run downloaded exe file and follow the prompts

4. Install URL Rewrite

Download URL Rewrite 2.1

Run the downloaded exe file. Depends on the download you might need working Internet connection.

5. Install PHP Manager

Download PHP Manager and install it from downloaded msi file.

Test PHP Manager Installation

6. PHP Installation

  • Download PHP , In this tutorial I have used 7.3.7 Non Thread Safe  x64
  • Check what version is required from SNIPE-IT PHP requirements
  • Create a new folder “PHP” in the System Drive. In the most cases it is C: Drive.

  • Copy all data from original downloaded folder PHP.7.*.* to C:PHP

  • Open IIS Server Manager
  • Click on your Server Name and you will see the following Window.
  • Double click on PHP Manager and register new PHP-CGI.EXE. You will find PHP-CGI.EXE file in C:\PHPPHP-CGI.EXE. Follow the steps below to accomplish this task.

Test PHP Installation

There are two ways in which PHP could be tested.

  • First Method (this test will be enough)

It can be tested within IIS Server Manager.

  • Second method

A separate text file you could create within c:\inetpub\wwwroot > name it phpinfo.php > Edit with notepad and add this content without quotation marks

<?php phpinfo(); ?>

You might need to restart your IIS Server through IIS Server Manager is some cases before you open http://localhost/phpinfo.php

Enable/Disable PHP Extensions

  • Open IIS Manager
  • Click on your Server Name > Open PHP Manager
  • Disable following extensions leave other enabled extensions as enabled

php_gettext.dll

php_soap.dll

php_xmlrpc.all

  • Enable following extensions in addition to already enabled extensions

php_exif.dll

fileinfo.dll

php_pdo_mysql.dll

php_ldap.dll

After enabling and disabling, you will end up with the following extensions.

7. MariaDB installation

  • SNIPE-IT Requirements – SNIPE-IT recommends 10.0.14.
  • MariaDB Download
  • Download msi file

  • Run downloaded msi file and follow the prompts

  1. Database Setup
  • Double click on HeidiSQL shortcut or search it in the Start Menu > Applications
  • Start a new session and use root credentials to login

  • Create a new database, name it snipeit

2. Create New User

  • Create a new user, name it snipeit

 

  • Change user permissions and provide full access to database snipeit

8. Configure Snipe-IT Root Folder

  • Download the latest version of Snipe-it

  • Extract the files from the zip folder

  • Create a new folder c:\inetpub\wwwroot\snipeit
  • Copy all files and folders from downloaded snipeit to c:\inetpub\wwwroot\snipeit

9. Update environmental file

Find DB Dump Path (It will be needed in the .env file)

Follow the below steps to find the DB_DUMP_PATH

  • Find where MariaDB is located, in my case, it is C:\Program FilesMariaDB\10.0\bin.
  • To find MariaDB bin folder location, open Command Prompt as administrator and run the following command without quotations:

“cmd /c for %A in (“C:\Program Files\MariaDB 10.0\bin”) do @echo %~sA”

cmd /c for %A in ("C:\Program Files\MariaDB 10.0\bin") do @echo %~sA

The output would be the DB_DUMP_PATH, copy that path. In my case, it was the following (without quotations)

“C:PROGRA~1MARIAD~1.0bin”

Save this output in a text file as below

‘C:\\PROGRA~1\\MARIAD~1.0\\bin’ (Single quotation with two backslashes)

Open .env.example with Notepad++, .env file is located in the Snipe-IT root folder

  • Update required fields as shown in the screenshot
    – APP_URL
    – DB_DATABASE
    – DB_USERNAME
    – DB_PASSWORD
    – DB_DUMP_PATH

  • Save that file as .env

10. Install Composer

  • Download Composer exe file

  • Copy that file to Snipeit root directory, c:\intepub\wwwroot\snipeit

  • Run Composer exe file > Leave Developer Mode unchecked > Browse to PHP root directory as discussed in step number 5 > Select PHP.exe file > Follow the prompts and finish

  • Open Command Prompt (this might not work in PowerShell) as an administrator in the Snipe-IT root directory and run the following command (this step requires Internet connectivity, make sure you test it before hand)

             composer install

11. Generate App Key

  • Open command prompt as an administrator in the Snipe-IT root directory and run the following command

php artisan key:generate

  • Open .env file with Notepad++ and you would see App Key populated in the .env file automatically

12. Create a new website

  • Open IIS Manager
  • Update Bindings of Default Web Site

Create new website

  • Open IIS Server Manager and enter the details as shown in the screenshot below

Update Handler Mappings

  • In IIS Manager, click on Sites and double click on newly created site SNIPE IT
  • Double Click on Handler Mappings
  • Update the settings as shown in the screenshot

13. Fix Folder Permissions

Add permissions for the IIS user for the uploads folder:

  • Go to C:\inetpub\wwwroot\snipe-it\public
  • Right Click uploads > Properties
  • Go to the Security Tab > Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR full control
  • Click OK twice

Add permissions for the IIS user for the cache folder:

  • Go to C:\inetpub\wwwroot\snipe-it\bootstrap
  • Right Click cache > Properties
  • Go to the Security Tab > Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR full control
  • Click OK twice

Add permissions for the IIS user for the storage folder:

Go to C:\inetpub\wwwroot\snipe-it

  • Right Click storage > Properties
  • Go to Security Tab > Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR modify permissions
  • Click OK twice

Add permissions for the IIS user for the Windows Temp folder:

  • Go to C:\Windows
  • Right Click temp > Properties
  • Go to the Security Tab > Edit
  • Click Add and change location to local machine
  • Type IUSR in object name box
  • Click OK
  • Give IUSR modify permissions
  • Click OK twice

Add permissions for the IIS_IUSRS for the Windows Temp folder:

  • Go to C:\Windows
  • Right Click Temp > Properties
  • Go to the Security Tab > Edit
  • Click Add and change location to local machine
  • Type IIS_IUSRS in object name box
  • Click OK
  • Give IIS_IUSRS modify permissions
  • Click OK twice

Add permissions for the IIS_IUSRS for the Storage folder:

  • Go to c:\inetpub\wwwroot\snipe-it
  • Right Click Storage > Properties
  • Go to the Security Tab > Edit
  • Click Add and change location to local machine
  • Type IIS_IUSRS in object name box
  • Click OK
  • Give IIS_IUSRS modify permissions
  • Click OK twice

14. Browse to Snipe-IT Pre Flight Setup

  • Change security settings for IE in the Server Manager > Local Server > Enhanced Mode > Turn Off For Administrators

  • Open IE and browse to your IIS Server’s IP address > In this case it is 10.0.0.2

  • Snipe-IT Page will load
  • Click Next Create Database Tables

  • It might show Something Went Wrong > Refresh the page

  • Next: Create User > Fill all the required information > You should see the below page

Congratulations – all done!

More

About Jay Singh


Follow Me
Subscribe
Notify of
guest
34 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
saiful amri
saiful amri
1 year ago

Hi..
may i know can i ignore this error?

1.PNG
Menno
Menno
10 months ago

Thanks for the great tutorial!!! Could you please also make a tutorial how to upgrade to a newer version? (upgrading Snipe-IT, PHP version and MariaDB)

Greg
Greg
10 months ago
Reply to  Jay Singh

That would be awesome if you could get that out! I followed the original to set it up, but the project sort of halted, and now I want to get it set up again with the newest version of Snipe IT, but I don’t want to start completely over if possible.

Greg
Greg
10 months ago
Reply to  Jay Singh

Would be great if you had that guide! I just tried upgrading my environment, and now the website isn’t accessible….oops.

Greg
Greg
10 months ago

So I got as far as installing composer in powershell. But when I go to generate a key, I get an error(see attachment). This is on Server 2016. Thank you!

Greg
Greg
10 months ago
Reply to  Jay Singh

Sorry!

Greg
Greg
10 months ago
Reply to  Greg

Here it is…

Greg
Greg
10 months ago
Reply to  Jay Singh

PS C:inetpubwwwrootsnipe-it> php artisan key:generate
The environment file is invalid!
Failed to parse dotenv file due to an unexpected escape sequence. Failed at [‘C:Program FilesMariaDB 10.0bin’].
PS C:inetpubwwwrootsnipe-it> php artisan key:generate
The environment file is invalid!
Failed to parse dotenv file due to an unexpected escape sequence. Failed at [‘C:Program FilesMariaDB 10.0bin’].

Greg
Greg
10 months ago
Reply to  Jay Singh

DB_DUMP_PATH=’C:Program FilesMariaDB 10.0bin’

Greg
Greg
10 months ago
Reply to  Jay Singh

I tried this as well:

DB_DUMP_PATH=’C:PROGRA~1\MARIAD~1.0\bin’

Greg
Greg
10 months ago
Reply to  Jay Singh

So what should the dump path be? I’m running PHP 7.2.26.

Greg
Greg
10 months ago
Reply to  Jay Singh

Do you mean save the .env file as .php?

Greg
Greg
9 months ago
Reply to  Jay Singh

So this is what I get when I try to generate the key:  file_get_contents(C:inetpubwwwrootsnipe-it.env): failed to open stream: No such file or directory I noticed that icon for the .env file looks like a txt file. I used Notepad++ to edit it it. Here is how the file reads: # ——————————————– # REQUIRED: BASIC APP SETTINGS # ——————————————– APP_ENV=production APP_DEBUG=false APP_KEY=ChangeMe APP_URL=http://10.1.0.50 APP_TIMEZONE=’UTC’ APP_LOCALE=en MAX_RESULTS=500 # ——————————————– # REQUIRED: UPLOADED FILE STORAGE SETTINGS # ——————————————– PRIVATE_FILESYSTEM_DISK=local PUBLIC_FILESYSTEM_DISK=local_public # ——————————————– # REQUIRED: DATABASE SETTINGS # ——————————————– DB_CONNECTION=mysql DB_HOST=127.0.0.1 DB_DATABASE=snipeit DB_USERNAME=snipeit DB_PASSWORD=Greg1955 DB_PREFIX=null DB_DUMP_PATH=’C:PROGRA~1MARIAD~1.0bin’ DB_CHARSET=utf8mb4 DB_COLLATION=utf8mb4_unicode_ci # ——————————————– # OPTIONAL: SSL DATABASE… Read more »

Greg
Greg
9 months ago
Reply to  Jay Singh

Hi Jay,

I’m at the Pre-Flight Setup. When I go to http://10.1.0.50/setup, I get ‘Not Found’ error. When I go to snipe-it.mydomain.org, I get a Plesk Default Page. If I add /setup to it, I get a similar error that references Apache. What am I missing here?

Peter Ade Alabi
Peter Ade Alabi
9 months ago

Hi Jay, thank you for the guide, i followed your instructions but my pre-flight page setup is completely blank, could you please help with this?

Luky
Luky
9 months ago

Hi Jay ,

Thank you for the great instructions, but I have problem. When I go to generate a key, I get an error (in CMD):

C:>cd C:inetpubwwwrootsnipe-it

C:inetpubwwwrootsnipe-it>php artisan key:generate
The environment file is invalid!
Failed to parse dotenv file due to an unexpected escape sequence. Failed at [‘C:PROGRA~1MARIAD~1.0bin’].

C:inetpubwwwrootsnipe-it>

OS:Windows server 2019
PHP version :7.3.27 but I tried 8.0.2 or 7.2.0

In .env file I tried DB_DUMP_PATH:’C:Program FilesMariaDB 10.0bin’ and DB_DUMP_PATH=’C:PROGRA~1MARIAD~1.0bin’ but problem is same

File .env isn´t in txt format.

Luky
Luky
9 months ago

Hi Jay, I have problem when generate a key
Error:
C:>cd C:inetpubwwwrootsnipe-it

C:inetpubwwwrootsnipe-it>php artisan key:generate
The environment file is invalid!
Failed to parse dotenv file due to an unexpected escape sequence. Failed at [‘C:PROGRA~1MARIAD~1.0bin’].

C:inetpubwwwrootsnipe-it>

I tried to edit DB_DUMP_PATH in .env file (DB_DUMP_PATH=’C:Program FilesMariaDB 10.0bin’) but error is same :

C:inetpubwwwrootsnipe-it>php artisan key:generate
The environment file is invalid!
Failed to parse dotenv file due to an unexpected escape sequence. Failed at [‘C:Program FilesMariaDB 10.0bin’].

C:inetpubwwwrootsnipe-it>

OS:Win Server2019
PHP version : 7.3.27 but i tried 8.0.2 and 7.2.0 – same problem

.env file isn’t in txt format .

Davion Billups
Davion Billups
9 months ago

Worked Perfectly!!!

K-marty
K-marty
8 months ago

THANK YOU FOR GUIDE!!!
It’s really straightforward 🙂
the only issue I had was when I was trying the command “compose install” on powershell and I was getting an error message. But when using cmd it worked

snipe_installer
snipe_installer
8 months ago

For anyone having dump path issues, the fix for me was to use the picture, not copy/paste text – the text shows a single slash in the path, the image shows double slashes – double works, single doesn’t!
It’s mentioned in the guide, but is easy to miss if you follow the guide and just copy/paste your own path!

Last edited 8 months ago by snipe_installer
Paul
Paul
8 months ago

this is wonderful, first time i have got this running properly on Windows and i have tried lots of times in the past.

34
0
Would love your thoughts, please comment.x
()
x