MongoDB Documentation, Release 3.0.4 Step 3: Run the MongoDB service. Step 4: Stop or remove the MongoDB service as needed. Step 1: Open an Administrator command prompt. Manually Create a Windows Service for MongoDB 31 2.3. Installation Guides You can set up the MongoDB server as a Windows Service that starts automatically at boot time. The following procedure assumes you have installed MongoDB using the .msi installer with the path C:\mongodb\ . If you have installed in an alternative directory, you will need to adjust the paths as appropriate. Press the Win key, type cmd.exe , and press Ctrl + Shift + Enter to run the Command Prompt as Adminis- trator. Execute the remaining steps from the Administrator command prompt. Create directories for your database and log files: To remove the MongoDB service use the following command: To stop the MongoDB service use the following command: If needed, you can install services for multiple instances of mongod.exe or mongos.exe . Install each service with a unique --serviceName and --serviceDisplayName . Use multiple instances only when sufficient system resources exist and your system design requires it. If the dbpath directory does not exist, mongod.exe will not start. The default value for dbpath is \data\db . To use an alternate dbpath , specify the path in the configuration file (e.g. C:\mongodb\mongod.cfg ) or on the command line with the --dbpath option. Install the MongoDB service. For --install to succeed, you must specify the logpath run-time option. Important: Run all of the following commands in Command Prompt with “Administrative Privileges” Modify the path to the mongod.cfg file as needed. Step 2: Create directories. "C:\mongodb\bin\mongod.exe" --config "C:\mongodb\mongod.cfg" --install net stop MongoDB "C:\mongodb\bin\mongod.exe" --remove mkdir c:\data\db mkdir c:\data\log