Install-Mongo-DB.docx 1 | Page

Install Mongo Database
Dr. Tom Hicks
Trinity University Computer Science

Download The Software

1]Download the latest version of the software from

Download The Software

1]Push the green download button. (See Below!)

Install Mongo

1]My class is going to install this on Windows 10 Enterprise. Select the 64 bit version. We will not need the SSL support, but you may add it if you like (but install & configure the openssl before the Mongo if you so desire). (See Below!)

2]Using the mouse, double-click on the Mongo installer. (See Below!)

3]Using the mouse, select/push the Next button. (See Below!)

4]Accept the terms of the License Agreement. Using the mouse, select/push the Next button. (See Below!)

5]Select Complete. Using the mouse, select/push the Next button. (See Below!)

6]Using the mouse, select/push the Next button. (See Below!)

7]Using the mouse, select/push the Finish button. (See Below!)

Add Mongo To The Path

1]Open your Mongo install in the C:\Program Files directory. Navigate down to the bin file. Your path may be different than mine. Copy it to the clipboard C:\Program Files\MongoDB\Server\3.2\bin (See Below)

2]There are a number of ways in which to add Mongo to the your path. What follows is one of those ways.

3]Right-mouse click on your Computer  Select Properties

4]Push/select the Advanced System Settings (See Below)

5]Push/select the Environment Variables... (See Below)

6]Select the Path. Push/select the Edit button. (See Below)

7]We can all make mistakes. Changing the path can potentially mess up other installed software. I always encourage my students to copy the existing path (See Below)

and paste it into a temporary file  Use Notepad ++  save it as C:\temp\path.txt.This way they have a backup if they accidently mess things up!

8]Once they have the backup, append a semicolon (;) plus the path to the Mongo binary files (C:\Program Files\MongoDB\Server\3.2\bin) plus a semicolon (;) to the existing path. Once done correctly, push the OK button. (See Below)

9]Reboot your computer.

Create The Default Database Directories

1]Create folder C:\data

2]Create folder C:\data\db

3]Go to permissions on C:\data  Change the permissions to enable all users to have full control of C:\data and all sub-folders.

Start The Database Listener

1]You may choose to create a Mongo service that runs all of the time, but until you do so, you will have to start Mongo  before you can connect applications to it.

2]Start a command window. Enter mongodto start the Mongo Database Listener.

3] You can add passwords and configure the port, directory, etc. later. Minimize this window  but do not close it.

Connect A Command Line Client To The Mongo Database Listener

1] Start another command window. Enter mongoto connect the command line client Mongo Database Listener. (See Below)

2] Enter show dbsto display the names of all of the databases in the current Mongo directory. You should have local.

Check Out The Files In C:\data\db

1] When Mongo is connected to a database directory, it automatically creates those files necessary to run. Open C:\data\db and confirm that you have such a collection.

Install Mongod As A Service

1] Once you have written applications that use a database, it is critical to be able to have this database running non-stop. We do not want to have to run a command window and start the database listener; we want it running all the time with no intervention/action required.

2] Run a command window as an Administrator.

3] Enter the following command:

mongod --install --logpath c:\data\log\master.log --logappend

4] Start the Services GUI; note that the MongoDB service has been created, but it is not currently running. Start It!

5] Your service should look like the following: (See Below)

6] You should now be able to connect robomongo, a command line client, or any other application at all times. It will not require you to launch the listener. Try it! (See Below)