MongoDB: Basic Installation

Here we will see how to Install, Configure and Start MongoDB on Windows machine.
We will discuss following steps to configure MongoDB server/client in this post.

  • Download
  • Configuration
  • Test Run


First of all download appropriate version from MongoDB official site,

Please select appropriate version of MongoDB distribution before downloading, generally it depends on Operating System and architecture (32bit or 64 bit) of machine.

Once downloaded than extract zip files on your drive.

After extracting you get one folder and 3 files which are shown in below image.

\bin directory contains binary files for MongoDB like mongod.exe, mongo.exe and other utility files, more shown on below image.


  • Setting up Data Directory
    • Data directory is a physical location where MongoDB engine store all data files.
    • You can create Data directory anywhere but we recommend to create in MongoDB folder for ease of use.
    • After creating data directory your MongoDB directory looks like. (Here we also create log directory to store logs and conf directory to store configuration files).
  • Create Configuration file.
    • Create configuration file in under mongodb/conf directory, here we created master.cfg, which looks like.

You can find more configuration option from

Test Run

  • Now start server using command,
    mongod.exe –config D:\kode12\MongoDB\conf\master.cfg
  • And at the end, start client, just double click on mongo.exe from MongoDb/bin directory

It displays connecting to your default database, here test. Means everything working fine.