How To Install Mongo

This feature is not available right now. Please try again later.

-->

MongoDB is a popular open-source, high-performance NoSQL database. This article guides you through installing and configuring MongoDB on a Windows Server 2016 virtual machine (VM) in Azure. You can also install MongoDB on a Linux VM in Azure.

Prerequisites

Before you install and configure MongoDB, you need to create a VM and, ideally, add a data disk to it. See the following articles to create a VM and add a data disk:

  • Create a Windows Server VM using the Azure portal or Azure PowerShell.
  • Attach a data disk to a Windows Server VM using the Azure portal or Azure PowerShell.

To begin installing and configuring MongoDB, log on to your Windows Server VM by using Remote Desktop.

Install MongoDB

Important

MongoDB security features, such as authentication and IP address binding, are not enabled by default. Security features should be enabled before deploying MongoDB to a production environment. For more information, see MongoDB Security and Authentication.

  1. After you've connected to your VM using Remote Desktop, open Internet Explorer from the taskbar.

  2. Select Use recommended security, privacy, and compatibility settings when Internet Explorer first opens, and click OK.

  3. Internet Explorer enhanced security configuration is enabled by default. Add the MongoDB website to the list of allowed sites:

    • Select the Tools icon in the upper-right corner.

    • In Internet Options, select the Security tab, and then select the Trusted Sites icon.

    • Click the Sites button. Add https://*.mongodb.com to the list of trusted sites, and then close the dialog box.

  4. Browse to the MongoDB - Downloads page (https://www.mongodb.com/downloads).

  5. If needed, select the Community Server edition and then select the latest current stable release forWindows Server 2008 R2 64-bit and later. To download the installer, click DOWNLOAD (msi).

    Run the installer after the download is complete.

  6. Read and accept the license agreement. When you're prompted, select Complete install.

  7. If desired, you can choose to also install Compass, a graphical interface for MongoDB.

  8. On the final screen, click Install.

Configure the VM and MongoDB

  1. The path variables are not updated by the MongoDB installer. Without the MongoDB bin location in your path variable, you need to specify the full path each time you use a MongoDB executable. To add the location to your path variable:

    • Right-click the Start menu, and select System.

    • Click Advanced system settings, and then click Environment Variables.

    • Under System variables, select Path, and then click Edit.

      Add the path to your MongoDB bin folder. MongoDB is typically installed in C:Program FilesMongoDB. Verify the installation path on your VM. The following example adds the default MongoDB install location to the PATH variable:

      Note

      Be sure to add the leading semicolon (;) to indicate that you are adding a location to your PATH variable.

  2. Create MongoDB data and log directories on your data disk. From the Start menu, select Command Prompt. The following examples create the directories on drive F:

  3. Start a MongoDB instance with the following command, adjusting the path to your data and log directories accordingly:

    It may take several minutes for MongoDB to allocate the journal files and start listening for connections. All log messages are directed to the F:MongoLogsmongolog.log file as mongod.exe server starts and allocates journal files.

    Note

    The command prompt stays focused on this task while your MongoDB instance is running. Leave the command prompt window open to continue running MongoDB. Or, install MongoDB as service, as detailed in the next step.

  4. For a more robust MongoDB experience, install the mongod.exe as a service. Creating a service means you don't need to leave a command prompt running each time you want to use MongoDB. Create the service as follows, adjusting the path to your data and log directories accordingly:

    The preceding command creates a service named MongoDB, with a description of 'Mongo DB'. The following parameters are also specified:

    • The --dbpath option specifies the location of the data directory.
    • The --logpath option must be used to specify a log file, because the running service does not have a command window to display output.
    • The --logappend option specifies that a restart of the service causes output to append to the existing log file.

    To start the MongoDB service, run the following command:

    For more information about creating the MongoDB service, see Configure a Windows Service for MongoDB.

Test the MongoDB instance

With MongoDB running as a single instance or installed as a service, you can now start creating and using your databases. To start the MongoDB administrative shell, open another command prompt window from the Start menu, and enter the following command:

You can list the databases with the db command. Insert some data as follows:

Search for data as follows:

The output is similar to the following example:

Exit the mongo console as follows:

Configure firewall and Network Security Group rules

Now that MongoDB is installed and running, open a port in Windows Firewall so you can remotely connect to MongoDB. To create a new inbound rule to allow TCP port 27017, open an administrative PowerShell prompt and enter the following command:

You can also create the rule by using the Windows Firewall with Advanced Security graphical management tool. Create a new inbound rule to allow TCP port 27017.

If needed, create a Network Security Group rule to allow access to MongoDB from outside of the existing Azure virtual network subnet. You can create the Network Security Group rules by using the Azure portal or Azure PowerShell. As with the Windows Firewall rules, allow TCP port 27017 to the virtual network interface of your MongoDB VM.

Note

TCP port 27017 is the default port used by MongoDB. You can change this port by using the --port parameter when starting mongod.exe manually or from a service. If you change the port, make sure to update the Windows Firewall and Network Security Group rules in the preceding steps.

Next steps

In this tutorial, you learned how to install and configure MongoDB on your Windows VM. You can now access MongoDB on your Windows VM, by following the advanced topics in the MongoDB documentation.

Active12 months ago

I am trying to test out mongoDB and see if it is anything for me. I downloaded the 32bit windows version, but have no idea on how to continue from now on.

I normally use the WAMP services for developing on my local computer. Can i run mongoDB on Wamp?

However, what's the best (easiest!) way to make it work on windows?

Thanks!

IndustrialIndustrial
16.2k59 gold badges169 silver badges277 bronze badges

15 Answers

It's not like WAMP. You need to start mongoDB database with a command after directory has been created C:/database_mongo

mongod --dbpath=C:/database_mongo/

you can then connect to mongodb using commands.

shingarashingara
41.5k11 gold badges92 silver badges101 bronze badges

Are you ready for the installation … and use …Technically, it’s not an installation it’s just Downloading…

I. Download the zip file http://www.mongodb.org/downloads

II. Extract it and copy the files into your desired location.

III. Start the DB engine.

IV. Test the installation and use it.

That's it! So simple, right? Ok let’s start

1. Download the zip file

  1. Go to http://www.mongodb.org/downloads
  2. You will see a screen like this:

    • I am using a windows 7 32 bit machine - that’s why I downloaded the package marked in red.
  3. Click download (It only takes a few seconds).

    • Wow... I got that downloaded. It was a zipped file called mongodb-win32-i386-2.4.4.zip (The name of the folder will change according to the version you download, here I got version 2.4.4).

OK all set.

2. Extract

  1. Extract the zip
  2. Copy the files into a desired location in your machine.
    • I am going to copy the extracted files to my D drive, since I don’t have many files there.
    • Alright then where are you planning to paste the mongo files? In C: or in your Desktop itself?
    • Ok, no matter where you paste... In the snap shot below, you can see that I have navigated to the bin folder inside the Mongo folder. I count fifteen files inside bin. What about you?

Finished! That’s all

What we have to do next?

3. Start the DB engine

Let’s go and start using our mongo db...

  1. Open up a command prompt, then navigate to `bin` in the mongo folder ![Navigating to mongo's bin folder][4]
  2. Type `mongo.exe` (which is the command used to start mongo Db Power shell).Then see the below response.. ![Executing mongo.exe][5]*That was an awesome exception J LOL … What is that?* > Couldn’t connect to server. *Why did the exception happen? I have no idea... Did I create a server in between?**No.* *Right, then how come it connected to a server in between? Silly Machine …Jz.**I got it! Like all other DBs - we have to start the DB engine before we use it.**So, how can we start it?*
  3. We have to start the mongo db by using the command `mongod`. Execute this from the `bin` folder of mongo.*Let’s see what had happened.*![enter image description here][6]*Again a wonderfully formatted exception J we got right? Did you notice what I have highlighted on top? Yeah it is the mongod command. The second one is the exception asking us to create a folder called data. And, inside the data folder, a folder called `db`.**So we have to create these `datadb` folders.**The next question is where to create these folders?*
  4. We have to create the `datadb` folders in the `C` drive of our BOX in which we are installing mongo. Let’s go and create the folder structure in C drive.A question arises here: 'Is it mandatory to create the datadb directories inside C?' Nooo, not really. Mongo looks in `C` by default for this folder, but you can create them wherever you want. However, if it's not in `C`, you have to tell mongo where it is. *In other words, if you don't want the mongo databases to be on `C:`, you have to set the db path for mongo.exe.*

    Optional

    1. Ok, I will create those folders in some other location besides `C` for better understanding of this option. I will create then in the `D` drive root, with the help of cmd.Why? Because it’s an opportunity for us to remember the old dos commands...![enter image description here][7]
    2. The next step is to set the Db path to mongo.exe.Navigate back to `bin`, and enter the command, `mongod.exe --dbpath d:data`.I got the response below:![enter image description here][8]I Hope everything went well... Because I didn’t see any ERROR *** in the console J.
  5. Next, we can go and start the db using the command `start mongo.exe`![enter image description here][9]I didn't see any error or warning messages. But, we have to supply a command to make sure mongo is up and running, i.e. mongod will get a response:![enter image description here][10]Hope everything went well.

4. Test the Mongo DB installation

Now we have to see our DB right? Yea very much, Otherwise how will we know it’s running?

For testing purpose MONGO has got a DB called test by default. Lets go query that.

But how without any management studios? Unlike SQL, we have to depend on the command prompt. Yes exactly the same command prompt… our good old command prompt… Heiiiii.. Don’t get afraid yes it’s our old command prompt only.Ok let’s go and see how we are going to use it…

Ohhh Nooo… don’t close the above Command prompt, leave it as it is…

  • Open a new cmd window.
  • Navigate to Bin as usual we do…

    I am sure you people may be remembering the old C programming which we have done on our college day’s right?

    In the command prompt, execute the command mongo or mongo.exe again and see what happens.

    You will get a screen as shown below:

    I mentioned before that Mongo has got a test db by default called test, try inserting a record into it.

    The next question here is 'How will we insert?' Does mongo have SQL commands? No, mongo has got only commands to help with.

    The basic command to insert is
    db.test.save( { KodothTestField: ‘My name is Kodoth’ } )

    Where test is the DB and .save is the insert command. KodothTestField is the column or field name, and My name is Kodoth is the value.

    Before talking more let’s check whether it’s stored or not by performing another command:

    Our Data got successfully inserted … Hurrayyyyyy..

    I know that you are thinking about the number which is displayed with every record right called ObjectId. It’s like a unique id field in SQL that auto-increments and all. Have a closer look you can see that the Object Id ends with 92, so it’s different for each and every record.

    At last we are successful in installing and verifying the MONGO right. Let’s have a party...So do you agree now MONGO is as Sweet as MANGO?

    Also we have 3rd party tools to explore the MONGO. One is called MONGO VUE. Using this tool we can perform operations against the mongo DB like we use Management studio for SQL Server.

    Can you just imagine an SQL server or Oracle Db with entirely different rows in same table? Is it possible in our relational DB table? This is how mongo works. I will show you how we can do that…

    First I will show you how the data will look in a relational DB.

    For example consider an Employee table and a Student table in relational way. The schemas would be entirely different right? Yes exactly…

    Let us now see how it will look in Mongo DB. The above two tables are combined into single Collection in Mongo…

    This is how Collections are stored in Mongo. I think now you can feel the difference really right?Every thing came under a single umbrella. This is not the right way but I just wanted to show you all how this happens that’s why I combined 2 entirely different tables in to one single Collection.

    If you want to try out you can use below test scripts

    Thanks

    Saravanabalagi Ramachandran
    3,4285 gold badges23 silver badges61 bronze badges
    Shivam SrivastavaShivam Srivastava
    3,8102 gold badges18 silver badges23 bronze badges

    Pretty good documentation is provided on the MongoDB website

    Install MongoDB

    1. Determine which MongoDB build you need.

      There are three builds of MongoDB for Windows:

      MongoDB for Windows Server 2008 R2 edition (i.e. 2008R2) runs only on Windows Server 2008 R2, Windows 7 64-bit, and newer versions of Windows. This build takes advantage of recent enhancements to the Windows Platform and cannot operate on older versions of Windows.

      MongoDB for Windows 64-bit runs on any 64-bit version of Windows newer than Windows XP, including Windows Server 2008 R2 and Windows 7 64-bit.

      MongoDB for Windows 32-bit runs on any 32-bit version of Windows newer than Windows XP. 32-bit versions of MongoDB are only intended for older systems and for use in testing and development systems. 32-bit versions of MongoDB only support databases smaller than 2GB.

      To find which version of Windows you are running, enter the following command in the Command Prompt:

    2. Download MongoDB for Windows.

      Download the latest production release of MongoDB from the MongoDB downloads page. Ensure you download the correct version of MongoDB for your Windows system. The 64-bit versions of MongoDB does not work with 32-bit Windows.

    3. Install the downloaded file.

      In Windows Explorer, locate the downloaded MongoDB msi file, which typically is located in the default Downloads folder. Double-click the msi file. A set of screens will appear to guide you through the installation process.

    4. Move the MongoDB folder to another location (optional).

      To move the MongoDB folder, you must issue the move command as an Administrator. For example, to move the folder to C:mongodb:

      Select Start Menu >All Programs >Accessories.

      Right-click Command Prompt and select Run as Administrator from the popup menu.

      Issue the following commands:

      MongoDB is self-contained and does not have any other system dependencies. You can run MongoDB from any folder you choose. You may install MongoDB in any folder (e.g. D:testmongodb)

    Run MongoDB

    Warning:

    Do not make mongod.exe visible on public networks without running in “Secure Mode” with the auth setting. MongoDB is designed to be run in trusted environments, and the database does not enable “Secure Mode” by default.

    1. Set up the MongoDB environment.

      MongoDB requires a data directory to store all data. MongoDB’s default data directory path is datadb. Create this folder using the following commands from a Command Prompt:

      You can specify an alternate path for data files using the --dbpath option to mongod.exe, for example:

      If your path includes spaces, enclose the entire path in double quotes, for example:

    2. Start MongoDB.

      To start MongoDB, run mongod.exe. For example, from the Command Prompt:

      This starts the main MongoDB database process. The waiting for connections message in the console output indicates that the mongod.exe process is running successfully.

      Depending on the security level of your system, Windows may pop up a Security Alert dialog box about blocking “some features” of C:Program FilesMongoDBbinmongod.exe from communicating on networks. All users should select Private Networks, such as my home or work network and click Allow access. For additional information on security and MongoDB, please see the Security Documentation.

    3. Connect to MongoDB.

      To connect to MongoDB through the mongo.exe shell, open another Command Prompt. When connecting, specify the data directory if necessary. This step provides several example connection commands.

      If your MongoDB installation uses the default data directory, connect without specifying the data directory:

      If you installation uses a different data directory, specify the directory when connecting, as in this example:

      If your path includes spaces, enclose the entire path in double quotes. For example:

      If you want to develop applications using .NET, see the documentation of C# and MongoDB for more information.

    4. Begin using MongoDB.

      To begin using MongoDB, see Getting Started with MongoDB. Also consider the Production Notes document before deploying MongoDB in a production environment.

      Later, to stop MongoDB, press Control+C in the terminal where the mongod instance is running.

    Configure a Windows Service for MongoDB

    Note:

    There is a known issue for MongoDB 2.6.0, SERVER-13515, which prevents the use of the instructions in this section. For MongoDB 2.6.0, use Manually Create a Windows Service for MongoDB to create a Windows Service for MongoDB instead.

    1. Configure directories and files.

      Create a configuration file and a directory path for MongoDB log output (logpath):

      Create a specific directory for MongoDB log files:

      In the Command Prompt, create a configuration file for the logpath option for MongoDB:

    2. Run the MongoDB service.

      Run all of the following commands in Command Prompt with “Administrative Privileges:”

      Install the MongoDB service. For --install to succeed, you must specify the logpath run-time option.

      Modify the path to the mongod.cfg file as needed.

      To use an alternate dbpath, specify the path in the configuration file (e.g. C:Program FilesMongoDBmongod.cfg) or on the command line with the --dbpath option.

      If the dbpath directory does not exist, mongod.exe will not start. The default value for dbpath is datadb.

      If needed, you can install services for multiple instances of mongod.exe or mongos.exe. Install each service with a unique --serviceName and --serviceDisplayName. Use multiple instances only when sufficient system resources exist and your system design requires it.

    3. Stop or remove the MongoDB service as needed.

      To stop the MongoDB service use the following command:

      To remove the MongoDB service use the following command:

    Manually Create a Windows Service for MongoDB

    The following procedure assumes you have installed MongoDB using the MSI installer, with the default path C:Program FilesMongoDB 2.6 Standard.

    If you have installed in an alternative directory, you will need to adjust the paths as appropriate.

    1. Open an Administrator command prompt.

      Windows 7 / Vista / Server 2008 (and R2)

      Press Win + R, then type cmd, then press Ctrl + Shift + Enter.

      Windows 8

      Press Win + X, then press A.

      Execute the remaining steps from the Administrator command prompt.

    2. Create directories.

      Create directories for your database and log files:

    3. Create a configuration file.

      Create a configuration file. This file can include any of the configuration options for mongod, but must include a valid setting for logpath:

      The following creates a configuration file, specifying both the logpath and the dbpath settings in the configuration file:

    4. Create the MongoDB service.

      Create the MongoDB service.

      sc.exe requires a space between “=” and the configuration values (eg “binPath=”), and a “” to escape double quotes.

      If successfully created, the following log message will display:

    5. Start the MongoDB service.

    6. Stop or remove the MongoDB service as needed.

      To stop the MongoDB service, use the following command:

      To remove the MongoDB service, first stop the service and then run the following command:

    AdhershMNair
    2,1372 gold badges15 silver badges27 bronze badges
    John ChanningJohn Channing
    4,3476 gold badges38 silver badges56 bronze badges

    I realize you've already accepted an answer for this, but I wrote this short howto article to install mongodb into the c:wamp directory and run it as a service. Here is the gist of it.

    Create these directories

    Download and extract win32 binaries into c:wamp directory along side mysql, apache.

    Create a mongo.conf file

    Install as a service

    Set service to automatic and start it using services.msc

    Add path to mongo.exe to your path

    Need more details? Read the full article here...

    JCutrerJCutrer
    1. Download msi file for windows 32 bit as you have done.
    2. Double click Install it and choose custom and browse the location where ever you have to install(personally i have create the mongodb folder in E drive and install it there).
    3. Ok,now you have to create the datadb two folder where ever createit by the way i have create it in the installed location root e.g onE:.
    4. Now link the mongod to these folder for storing data use thiscommand or modify according to your requirement go to using cmdE:mongodbbin and after that write in console mongod --dbpath E:data, it will link.
    5. Now go using cmd E:mongodbbin and write mongod.
    6. Open another cmd by right click and run as admin point to yourmonogodb installed directory and then to bin just likeE:mongodbbin and write this mongo.exe
    7. After that write db.test.save({Field:'Hello mongodb'}) this commandwill insert the a field having name Field and value is Hellomongodb.
    8. After, check the record db.test.find() and press enter you will findthe record that you have recently entered.
    Mohammad ZeshanMohammad Zeshan

    Installing MongoDB on Windows is bit tricky compared to other Executable files.. Got a good reference after long search i got Installing MongoDB in Windows

    After Installing open command prompt and type 'mongod', then keep the window minimized and open another command prompt window and type 'mongo' and you will find the success message of connecting to the test database

    LawrineLawrine

    Its very simple to install Mongo DB on windows 7 ( i used 32 bit win7 OS)

    1. Install the correct version of Mongodb ( according to ur bit 32/64 .. imp :- 64 bit is not compatible with 32 bit and vice versa)

    2.u can install Mongodb from thius website ( acc to ur OS) http://www.mongodb.org/downloads?_ga=1.79549524.1754732149.1410784175

    1. DOWNLOAD THE .MSI OR zip file .. and install with proper privellages

    4.copy the mongodb folder from c:programfiles to d: [optional]

    5.After installation open command prompt ( as administrator .. right click on cmd and u will find the option)

    1. navigate to D:MongoDB 2.6 Standardbin

    2. run mongo.exe ... you might get this error

    3. If you get then no isse you just need to do following steps

    i) try the coomand in following image yo will get to know the error

    ii)This means that u neeed to create a directory datadb

    iii) now you have two options either create above directory in c drive or create any 'xyz' name directory somewhere else ( doesnot make and diffrence) .. lets create a directory of mongodata in d:

    1. Now lets rerun the command but now like this :- mongod --dbpath d:mongodata [shown in fig] this time you will not get and error
    1. Hope everything is fine till this point .. open new command propmt [sufficent privellages (admin)]

    colured in orange will be the command u need to run .. it will open the new command propmt which we known as mongo shell (or mongodb shell)

    11.dont close the shell[any of command promt as well] as in this we will create /delete/insert our databse operations

    1. Lets perform basic operation

    a) show databases b) show current databse c) creation of collection / inserting data into it (name will be test)d) show data of collection

    12.please find scrren shot of results of our operation .. please not :- dont close any command propmt

    1. a diffrent structure type of number is object id :- which is created automatically

    2. Hope you get some important info for installing mongodb DB.

    Harit SinghHarit Singh

    1. Download MongoDB

    2. Install MongoDB

    3. Create the required folders:

    NOTE: If the directories do not exist, mongod.exe will not start.

    4. Create a simple configuration file:

    More info about how to create a configuration file: http://docs.mongodb.org/manual/reference/configuration-options/

    5. Install MongoDB as a Windows Service (this way it will start automatically when you reboot your computer)

    How To Install Mongo Shell

    Run cmd with administrator privilegies, and enter the following commands:

    6. Start the MongoDB Windows Service

    7. Connect to MongoDB via shell/cmd for testing

    NOTE: http://docs.mongodb.org/manual/tutorial/getting-started-with-the-mongo-shell/

    8. That's it! You are done. :)

    9. Uninstall/remove the MongoDB Windows Service (if you messed up something)

    Jo SmoJo Smo
    3,4218 gold badges30 silver badges56 bronze badges

    Update Nov -2017

    1) Go to Mongo DB download center https://www.mongodb.com/download-center#community and pick a flavor of MongoDB you want to install. You can pick from

    • MongoDB Atlas - MongoDB database in the cloud
    • Communiy Server - MongoDb for windows (with and without SSL),iOS, Linux
    • OpManger- Mongo Db for Data Center
    • Compass - UI tool for MongoDB

    To know your OS version run this command in cmd prompt

    To know your CPU architecture(32 or 64 bit) run this command in cmd prompt

    I am using Community version (150MBs- GNU license)

    2) Click on MSI and go through installation Process. Exe will install MongoDb and SSL required by the DB.

    Mongo DB should be installed on your C drive

    C:Program FilesMongoDB

    MongoDB is self-contained, it means and does not have any other system dependencies. If you are low on disk in C drive then you can run MongoDB from any folder you choose.

    You can now run mongodb.exe from bin folder. If you get Visual C++ error for missing dlls then download Visual C++ Redistributable from

    After installation, try to rerun mongo.exe.

    Hitesh SahuHitesh Sahu
    18.5k9 gold badges95 silver badges86 bronze badges

    You might want to check https://github.com/Thor1Khan/mongo.gitit uses a minimal workaround the 32 bit atomic operations on 64 bits operands(could use assembly but it doesn't seem to be mandatory here)Only digital bugs were harmed before committing

    ThorKhanThorKhan
    1. Download .msi from https://www.mongodb.com/download-center#community

    2. Double click install - complete option

    3. Installation folder C:Program FilesMongoDBServer3.6bin

    4. Create database folder in C:// - c:/data/db and c:/data/log and c:/data/log/mongo.log and set write permission if not

    5. Open cmd prompt in Administrator mode , navigate to C:Program FilesMongoDBServer3.6bin

    6. Type the following

      C:Program FilesMongoDBServer3.6bin>mongod --dbpath='c:/data/db' --logpath='c:/data/log/mongo.log'

    7. Check folder c:/data/db - there should be many files and folder

    8. Create a config file named 'mongo.config' ** inside C:data

    9. Type the following to set the config values from newly created config file

      C:Program FilesMongoDBServer3.6bin>mongod --config C:datamongo.config

    10. Open another new cmd prompt in Administrator mode , navigate to C:Program FilesMongoDBServer3.6binexecute the following lines on the console.

    11. Type the following to create service for MongoDB

      C:Program FilesMongoDBServer3.6bin>mongod --install --config C:datamongo.config --logpath='c:/data/log/mongo.log'

      If old MongoDB service exists then need to delete the old service first before mongod --install command, run the following in a new console to delete old mongodb service

      SC STOP MongoDB

    12. Type the following to start MongoDB

      C:Program FilesMongoDBServer3.6bin>net start MongoDB

    13. Type the following to stop MongoDB

      C:Program FilesMongoDBServer3.6bin>net stop MongoDB

    Now connect the DB on ip - 127.0.0.1 or 192.168.5.64 on port 27017 .

    ** File name - 'mongo.config' , paste the following on config file -

    bind_ip = 127.0.0.1,192.168.5.64

    port = 27017

    dbpath=C:datadb

    logpath=C:datalogmongo.log

    KoustavKoustav

    Install MongoDB Community Edition for Windows.

    1.Now go to Download Center.

    1. The Download Center should display the Current Stable Release for Windows

    2. Click Download (msi) and run it

    3. When you go through You can choose either the Complete or Custom setup type. Select Complete Setup.

    Starting MongoDB server from the Command Prompt

    1.Add this path to environmental variables

    “C:ProgramFilesMongoDBServer4.0bin” For those who struggle to setup environmental variable please follow this steps

    • Windows 10 and Windows 8

    • In Search, search for and then select: System (Control Panel)

    • Click the Advanced system settings link.

    • Click Environment Variables. In the section System Variables, findthe PATH environment variable and select it. Click Edit.

    • If the PATH environment variable does not exist, click New.

    • In the Edit System Variable (or New System Variable) window, specifythe value of the PATH as“C:ProgramFilesMongoDBServer4.0bin”environment variable.

    • Click OK.

    • Close all remaining windows by clicking OK.

    • Now create MongoDB Data Directory MongoDB requires a data directory to store all data. Open Command Prompt and paste below

    3.Lets point server to your database directory.Type below code

    4.Now lets connect to MongoDB Type below code

    mongo

    5.If it is working properly Command prompt will show

    [initandlisten] waiting for connections

    Bingo!! You are done, Apparently it is bit confusing to use CLI, well MongoDB introduced a GUI which you can see the actual data ,

    To use mongoDB GUI version Above steps must have been performed

    1. Now go to Download Center. Download MongoDb Compass ,a GUI for MongoDB
    2. Install it and open
    How to install mongodb on linux

    You can see the hostname : localhost and port : 27017.

    Whenever you wanted to connect to mongoDB Server , You have to open Command prompt

    Type

    How To Install Mongo Db In Ubuntu

    mongod

    then again start a new Command prompt and type

    mongo

    Keep ‘em all settings as it is in mongoDB Compass. Now click connect ,

    You are in !! Easy .. isn’t it?

    PrathapGPrathapG
    5801 gold badge4 silver badges19 bronze badges
    1. Download from http://www.mongodb.org/downloads
    2. Install .msi file in folder C:mongodb
    3. Create data, datadb, log directories and mongo.config file under C:mongodb.
    4. Add the following lines in'mongo.config' file dbpath=C:mongodbdatadblogpath=C:mongodblogmongo.log
    5. Start server : mongod.exe --config='C:mongodbmongo.config'

    That's it !!!

    Umar TariqUmar Tariq

    Install Mongo Shell

    Step 1: First download the .msi i.e is the installation file from

    Step 2: Perform the installation using the so downloaded .msi file.Automatically it gets stored in program files. You could perform a custom installation and change the directory.

    After this, you should be able to see a MongoDB folder under program files

    How To Install Mongodb On Linux

    starting MongoDB shell and service is not big a deal I Got a good reference after the long search Installing MongoDB in Windows

    ZubZub

    How To Install Mongodb On Centos 7

    WAMP = Windows + Apache + MySQL/MariaDB + PHP/Python/Perl

    You can't use MongoDB in wamp.You need to install MongoDB separately

    Thusila BandaraThusila Bandara

    Not the answer you're looking for? Browse other questions tagged windowsinstallmongodb or ask your own question.