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 19th Dec 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 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 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

C:PROGRA~1MARIAD~1.0bin


Save this output in a text file as below

'C:\\PROGRA~1\\MARIAD~1.0\\bin'

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 as shown in the above screenshot

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 and click OK to start the website immediately.

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

Liked it? Take a second to support Jay Singh on Patreon!

About Jay Singh


Follow Me
Subscribe
Notify of
guest
79 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
saiful amri
saiful amri
3 years ago

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

1.PNG
Menno
Menno
3 years 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
3 years 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
3 years 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
3 years 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
3 years ago
Reply to  Jay Singh

Sorry!

Greg
Greg
3 years ago
Reply to  Greg

Here it is…

Greg
Greg
3 years 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
3 years ago
Reply to  Jay Singh

DB_DUMP_PATH=’C:Program FilesMariaDB 10.0bin’

Greg
Greg
3 years ago
Reply to  Jay Singh

I tried this as well:

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

Greg
Greg
3 years ago
Reply to  Jay Singh

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

Greg
Greg
3 years ago
Reply to  Jay Singh

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

Greg
Greg
3 years 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
3 years 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
3 years 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
3 years 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
3 years 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
3 years ago

Worked Perfectly!!!

K-marty
K-marty
3 years 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

Jim
Jim
3 years ago
Reply to  K-marty

Interesting. I couldn’t get it to work in cmd but it ran fine in PowerShell.

snipe_installer
snipe_installer
3 years 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 3 years ago by snipe_installer
Paul
Paul
3 years ago

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

Todd Avery
Todd Avery
3 years ago

I got this setup and working perfectly with 5.1.4. Do you have a how to guide on how to migrate? I am running 4.9.2 on a ubuntu server and want to migrate it over to this windows VM. Also want to upgrade it to the newest version when I migrate.

Todd Avery
Todd Avery
3 years ago
Reply to  Jay Singh

Thanks Jay. What about upgrading? I tried running the command that snipe recommends, php upgrade.php but no luck. Have you been able to upgrade?

Greg
Greg
3 years ago

Good morning!

I recently had to rebuild my server(server 2019) that contained SnipeIT(5.0.12). I have the program re-installed and need to import a backup. I have unzipped the backup file and placed it in /storage/app/backups. I then tried a couple of suggestions from Github(see attachment). Do I need to put it in a different directory? Do you happen to know if they are working on a one-click restore feature? Thank you for your time!

Greg

SnipeIT.PNG
Paul
Paul
2 years ago
Reply to  Jay Singh

this unfortunately seems to have killed my Snipe setup (5.1.3>5.3.3), i get 500 Server Error now. I will reinstall from scratch.

Paul
Paul
2 years ago
Reply to  Jay Singh

no worries, it was only a test environment 🙂 i reinstalled with mariadb-10.6.5-winx64 since the version listed here is no longer available, and it worked but i then got errors trying to make a backup – another forum elsewhere suggested that version of MariaDB was too new.. ?

Paul
Paul
2 years ago
Reply to  Jay Singh

looks like MariaDb 10.1.14 is still recommended, PHP is now 7.4 > 8 so i assume mine (7.4.26) is ok?

Paul
Paul
2 years ago
Reply to  Jay Singh

tried mariadb-10.2.41-winx64 (oldest version available, closest to 10.1.14 and it fails at “php artisan key:generate”, it doesnt produce an error but doesnt update the .env file either. Pretty sure i have the right path for MariaDB

Paul
Paul
2 years ago
Reply to  Paul

tricky (and quite fun) to play with this, it seems you need the right combination of Snipe, Maria DB and PHP to get this working. (Saw on another forum that a lot of people were having issues with PHP 7.4 and these artisan commands for instance).

Alockbox
Alockbox
2 years ago

Had a NIGHTMARE of a time completing Step 10 Install composer. It kept kicking back an error that php_gd2.dll could not be found. I finally realized the solution was to go into the php.ini file and edit the [PHP_GD2] extension=php_gd2.dll to php_gd.dll.

This is because in PHP 8, gd2 was replaced with gd. this matches linux, etc.

Alockbox
Alockbox
2 years ago

Oh and DEFINITELY install Notepad ++ do not use notepad built into windows

ezhil
ezhil
2 years ago

Hi…

I am getting below error while composer installation…

Please suggest…

comp error.jpg
Steve
Steve
2 years ago

Sry no Pics any more in the tutorail ;(

Ryan Homan
Ryan Homan
2 years ago

Hi
Seems like all the images for this guide no longer work.

kishore
kishore
2 years ago

Hi Images is not displaying

Ball
Ball
2 years ago

Hi, img do not show, How to solve it ?.

Thanks so much.

Ball
Ball
2 years ago

Hi, Images do not show, How to solve it ?.
Thanks so much.

tenty
tenty
2 years ago

hi im unable to connect or view the page, please help

ahmet
ahmet
2 years ago
brian
brian
2 years ago

getting this error when doing the key generate

snipeit error.JPG
Jonathan
Jonathan
2 years ago
Reply to  Jay Singh

I’m getting the same thing PHP 8.1.3 maria db 10.0.14 snipeit 5.3.10

Thinus
Thinus
2 years ago
Reply to  Jonathan

Getting the same error
PHP 8.1.3
MariaDB 10.0.14
Snipeit 5.4.1

Thinus
Thinus
2 years ago
Reply to  Jonathan

EDIT : Fixed the error by removing PHP 8.1.3 and installing PHP 7.4.28

Ajay
Ajay
2 years ago

Thank you for videos and blogs, It’s so much informative and quick start for a new commer. I would like to know if you would have explore the feature of requetable asset from users, The ideas is that i will import the user from AD and they have access on SnipeIT.
I would like to give them permission to request an asset ? How can i do this ?
Ajay

Noles001
Noles001
2 years ago

Great tutorial! It really helps with the set up process.

I am running into an issue with the Snipe-It set up. I get to the initial setup screen and everything looks good. When I click on “Next: Create Database Tables” I get a “500 | Server Error”. If I skip it and go on to the user setup it gives the same error when I try to save it.

Any thoughts? Everything else up to this point has worked without issue.

Brian
Brian
1 year ago

Hey Jay,
Great tutorial! I only had a couple of hiccups most of which I was able to solve. but I am running into one small issue I cannot solve. I am getting the following error: “HTTP Error 404.0 – Not Found” and when I browse the path it is looking for “C:inetpubwwwrootsnipe-itpublicsetup” there is no setup file there. what is the best way to remedy this?

BrianThe IT Guy
1 year ago

It is to bad I can’t get this working. I would have loved to use it but it just doesn’t work no matter what I do. I keep getting a 404 error no matter where I point it and can’t get anyone to help me figure out where to point it. I ran it step by step according to the docs and it doesn’t work. PITTY!! It sure would have been nice.

Brewmaster Ed
Brewmaster Ed
2 months ago

To fix the 404 error, ensure that your ‘app url’ in the env file is a complete match to that of your website binding. Do not add a following ‘/’ at the end of the website path within the env, and it will get rid of the 404 error.

Rich
Rich
1 year ago

How does the folder permissions affect security?

Ulrich
Ulrich
1 year ago

Hello Jay,

Thank you very much for this great tutorial. I followed it and was able to successfully build my Snipe-IT server.

Now I am trying to configure Active Directory Sync and getting the error that I attached.

I also included a screenshot of my configuration.

Please any idea on why I am getting that error?

Thanks,

Jishnu
Jishnu
1 year ago

Hi Bro,

Am getting 500 I Server Error after the preflight

Sam
Sam
3 months ago

Hi Jay,

I am getting the following error. Please can you help?

Thanks

Capture.PNG
FazzaGBR
3 months ago

We followed this a few years back and got up and running straight away! Now it’s time to upgrade it to the latest version but no sure how to easily go about it so do you have a guide on upgrading for those of us that followed this guide? Thanks!

boobalachandar
boobalachandar
1 month ago

Dear sir,

Snipe it setup was successfully configured on my Ubuntu server.However, the URL is not working.It only works with local IP addresses or 120.0.1.1.I tried changing it to snipeit.example.com.It’s not working.Please let me know what’s wrong with my setup.

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