Introduction to MongoDB Install as a service

Rama Sagar
Posted by in NoSql category on for Beginner level | Points: 250 | Views : 6447 red flag
Rating: 4 out of 5  
 1 vote(s)

MongoDB (from "humongous") is a cross-platform document-oriented database system. Classified as a NoSQL database, MongoDB eschews the traditional table-based relational database structure in favor of JSON-like documents with dynamic schemas
Read Introduction to MongoDB Command Line options before this article.


In this article we will learn how to run mongoDB as a service.we will also see how to connect to the service and get started.

Previous articles have provided an introduction to mongodb and the set up and installation,and few command line options.You can get them from the following:


The objective of the article is to learn how to install mongo database as a service and get started.

Install as a Service

Till now we have been using the commands to start and stop the mongo server.If we want the mongo server to be running all the time may be even when the system starts up.On a windows machine we can install mongo as a service.

Lets look installing it as a service 

we have already created a configuration file in our previous article 

  • Step 1 Open command prompt in administrator mode fetch to the mongo directory and type the following command
 mongod -f c:\dotnetfunda\mongod.conf --install

 Its installed as a service

we can start the service by issuing net start  mongodb

If we want to check the mongo server is running or not we can use the following command

net start | findstr Mongo
we can find the Mongo service listed as shown below

we can also stop the service by the following command 

net stop mongodb
Thats it now we have the Mongo server up and running we can connect to it using the monogo shell. Since we are running the server on local machine and on default port we no need to specify any command line arguments to the shell,we can simply connect by typing mongo.

Let check the database inside mongo lets connect to server and we can check the databases by the command

show dbs

It will show that we have exactly one local database..


In this article we have seen how to install mongo as a service and get started.In coming articles we will know about replica sets in Mongo.


Page copy protected against web site content infringement by Copyscape

About the Author

Rama Sagar
Full Name: RamaSagar Pulidindi
Member Level: Silver
Member Status: Member,MVP
Member Since: 12/30/2012 1:51:40 AM
Country: India
A Software Profesional working in Microsoft .NET technologies since year 2008, and I work for Dake ACE. I am passionate about .NET technology and love to contribute to the .NET community at Dot Net Funda

Login to vote for this post.

Comments or Responses

Login to post response

Comment using Facebook(Author doesn't get notification)