How to Install MongoDB on Windows 10 – Step by Step

MongoDB is an open source and widely use NoSQL database around. It offers JSON-like documents, ad hoc queries, indexing and real time aggregation which makes the mongoDB so popular in database world.

In this tutorial we will see how to download and install mongodb on windows 10 . I will cover all the steps with images so it will easy for you guys to follow.

At the time of writing this tutorial mongodb has 4.0 version. I will install and configure mongodb only. I won’t be installing mongodb compass in this tutorial. I will cover that later.

If you are wondering what is mongodb compass is so it is the official graphical user interface for mongodb which comes with installer. But it doesn’t mean that you cannot install it separately.

So lets start.


Steps: Download and install Mongodb on Windows

  • Goto https://www.mongodb.com/download-center#community and download the installation package
  • Once the package download, click on it and installer wizard will open.
  • Click on Next straight away and it will take to agreement page.
  • Accept the agreement by clicking on the checkbox and click on next.
  • In choose setup type window, click on complete setup button. Custom type is for advanced users.
  • In service configuration window (under complete) you specify optional settings. But do not change anything and click on next
  • In this window, wizard will ask if you want to install MongoDB compass or not. If you also want to download MongoDB compass along with mongodb then you can click on this check box. Otherwise uncheck Install MongoDB Compass checkbox.
    Note: If you check this checkbox then your installation will take more time.
  • Click on Install and you are ready to install mongodb.
  • Once installation will complete. Then goto mongodb folder and copy bin folder directory path which is usually C:\Program Files\MongoDB\Server\4.0\bin
  • Now goto environment variables setting and add copy path. See images below if you feel confusion
  • Now open command prompt(cmd) and start mongodb server by typing mongod. Remember mongod is a command which runs mongodb server. If you want to use mongodb connection in programming language, then you must run this command before.
  • Now open another command promt(cmd) and start mongodb shell by typing mongo. Type show databases; and mongodb list default dbs. Thats it.

Note: Default address of mongodb server is 127.0.0.1 and default port is 27017.

Step by Step Images:

download mongodb windows installer

mongodb download screen 1

mongodb download screen 2

mongodb download screen 3

mongodb download screen 4

mongodb download screen 5

mongodb download screen 6

mongodb download screen 7

mongodb download screen 8

copy mongodb path

type envrionement variable

click environment variables

edit envrionement variable

add envrionement variable

start mongodb server

run mongodb command

 

Author: Ahsan Zameer

I am a web developer and love to search new stuff on web. Trying different approaches and ideas to make web developing more interesting and enjoyable.