Start MongoDB service

  • Start cmd as Administrator
  •  Create a directory for mongodb in c:
    mkdir mongodb
  • Create two directories for log and db in mongodb folder
    cd mongodb
    mkdir log
    mkdir db
  • Create a configuration file called mongodb.cfg in mongodb folder with contents:
             destination: file
             path: c:\mongodb\log\mongod.log
             dbPath: c:\mongodb\db
  • Create an empty file and save it as mongod.log and put it in c:\mongodb\log\

Adding to Windows service


"C:\Program Files\MongoDB\Server\3.2\bin\mongod.exe" --config "C:\mongodb\mongodb.cfg" --install

Start the service

net start MongoDB


Stop the service

net stop MongoDB

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s