Installing MongoDB as a Service on Windows

Tags: MongoDB

I was a little surprised that MongoDB doesn't install itself as a windows service when you run the installation package.  So here's a command to install it as a service.  It will be set to startup type Automatic.

mongod --dbpath "C:\mongo_data" --logpath "C:\mongo_log\log.txt" --install

 

The dbpath and logpath are up to you.  Run this as an administrator.  You will have to manually start the service after you run the command.  Go Mongo!


 

No Comments

Add a Comment