Mongodb Classroom image

Anil  Bist / Professional / DataBase

To post your Question Join Classroom
Lesson Topics's No:-  |1 | 2 | 3 | 4|Last
Lessons:- Installation


To install MongoDB, follow the steps below:

For Mac OS:

  • There are two options for Mac OS: manual install or homebrew.
  • Installing with homebrew:

1.  Type the following command into the terminal: 

      $ brew install mongodb


  • Installing manually:

2. Download the latest release here. Make sure that you are downloading the appropriate file, specially check whether your operating system type is 32-bit or 64-bit. The downloaded file is in format tgz.
3. Go to the directory where this file is downloaded. Then type the following command:

$ tar xvf mongodb-osx-xyz. tgz

Instead of xyz, there would be some version and system type information. The extracted folder would be same name as the  tgz  file. Inside the folder, their would be a subfolder named  bin  which would contain several binary file along with  mongod  and  mongo. 

4. By default server keeps data in folder /data/db. So, we have to create that directory and then

run the server having the following commands:

5. To start the server, the following command should be given from the current location:

$ ./mongod


It would start the server on port 27017 by default.

6. To start the client, a new terminal should be opened having the same directory as before. Then the following command would start the client and connect to the server. 

$ ./mongo


By default it connects to the test database. If you see the line like connecting to: test. Then you have successfully installed MongoDB. Congrats! Now, you can test Hello World to be more confident. 

Anil  Bist

Skills    Mongodb

Qualifications :- High School - SLV, College/University - Graphic Era Deemed Univ University,
Location :-Dehradun,Dehradun,Uttarakhand,India

I started my Professional Journey in 2006 with one of the Web Development Company in Bangalore and my 1st framework was "Ruby on Rail" as Web development and delivered around 5+ Projects using this platform. Then came another dimension as JEE/Sturst framework, Gradually I realized that I want to build something on my own and give my passion and energy on creating something different a


  Students (0)