Skip to content

Instantly share code, notes, and snippets.

@manuelbieh
Created January 4, 2013 00:18
Show Gist options
  • Save manuelbieh/4448788 to your computer and use it in GitHub Desktop.
Save manuelbieh/4448788 to your computer and use it in GitHub Desktop.
Install MongoDB as Windows Service
  • Download the recent version: http://www.mongodb.org/downloads
  • Copy everything to a folder (I used C:\tools\mongodb)
  • Add C:\tools\mongodb\bin to your PATH variable
  • Open Commandline and cd to C:\tools\mongodb
  • mkdir data\db && mkdir log
  • echo logpath=C:\tools\mongodb\log\mongo.log > C:\tools\mongodb\mongod.cfg
  • echo dbpath=C:\tools\mongodb\data\db >> C:\tools\mongodb\mongod.cfg
  • C:\mongodb\bin\mongod.exe --config C:\mongodb\mongod.cfg --install
  • net start mongodb
  • That's it. You're done!

To remove the MongoDB service: C:\tools\mongodb\bin\mongod.exe --remove

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment