One if the requirements to set up and run Sitecore in your machine is installing mongodb. However, the documentation is a bit tricky.
Following the steps in this post, hopefully you will find it much easier.
MongoDB is needed for Sitecore analytics data.
To install MongoDB:
- Download MongoDB from link
you will need to fill up a form then you will have access to msi file.
- Run the Mongo installer that you downloaded from step 1.
- Choose the Custom install setting and decide on the installation folder.
- Click Next until you finish the installation.
You also can go with scripts and run the installation command with Choco:
Set up MongoDB as a Windows Service
If MongoDB has installed successfully, the next step is to register it as a Windows Service.
- Create a main folder with 2 sub-folders, for example :
- Inside data folder create a config file (XML configuration file) for example name it mongo.config. Change it's content to the following text:
dbpath=C:\data\db logpath=C:\data\log\mongo.log smallfiles=true
- Open cmd (command prompt) in administrator mode and type following command:
"C:\Program Files\MongoDB\Server\3.4\bin\mongod.exe" --config "C:\data\mongo.config" --install
First path is the location mongo in installed and second path is the folder you created.
2. If you have successfully registered Mongo as service, do a Windows search for services.
4. Check the status column of the service and confirm it is running. If not, try to start the service.
5. It is now ready to go