Summary when installed on Windows10.

environment

  • Windows10
  • MongoDB: 3.6.2

Main unit installation

Download the latest version suitable for the environment from the following site
MongoDB homepage (English)

Install the downloaded msi file
If you want to install in your own location, select "Customize".

Create the following directory manually
C: \ Program Files \ MongoDB \ Server \ 3.6 \ data
C: \ Program Files \ MongoDB \ Server \ 3.6 \ logs

Add the following directory to the Windows environment variable Path
C: \ Program Files \ MongoDB \ Server \ 3.6 \ bin

Windows service registration

Create configuration file
Create "mongodb.conf" file in the following folder.
C: \ Program Files \ MongoDB \ Server \ 3.6 \ mongodb.conf

net: bindIp: 127.0.0.1 port: 27017 storage: dbPath: C: \ Program Files \ MongoDB \ Server \ 3.6 \ data systemLog: destination: file path: C: \ Program Files \ MongoDB \ Server \ 3.6 \ logs \ mongodb. log logAppend: true storage: journal: enabled: true

Windows service registration with Mongodb command
Open the DOS window as an administrator and execute the following command.
* The path to the config file must be an absolute path

mongod.exe --config "C: \ Program Files \ MongoDB \ Server \ 3.6 \ mongodb.conf" --install --serviceName MongoDB

Service startup

For the first time, start the service from "Control Panel-> Administrative Tools-> Services-> MongoDB". It should be executed automatically from the second start.