Docs Menu

Install MongoDB Enterprise Edition on Windows

On this page

Note
MongoDB Atlas

MongoDB Atlas is a hosted MongoDB service option in the cloud which requires no installation overhead and offers a free tier to get started.

Use this tutorial to install MongoDB 4.4 Enterprise Edition on Windows using the default installation wizard.

MongoDB Enterprise Edition is available on select platforms and contains support for several features related to security and monitoring.

This tutorial installs MongoDB 4.4 Enterprise Edition. To install a different version of MongoDB Enterprise, use the version drop-down menu in the upper-left corner of this page to select the documentation for that version.

This tutorial installs MongoDB on Windows using the default MSI installation wizard. To install MongoDB using the msiexec.exe command-line tool instead, see Install MongoDB using msiexec.exe. The msiexec.exe tool is useful for system administrators who wish to deploy MongoDB in an unattended fashion using automation.

Note
EOL Notice
  • MongoDB 4.4 Enterprise Edition removes support for Windows 8.1 / Server 2012 R2
  • MongoDB 4.4 Enterprise Edition removes support for Windows 8 / Server 2012
  • MongoDB 4.4 Enterprise Edition removes support for Windows 7 / Server 2008 R2

MongoDB 4.4 Enterprise Edition supports the following 64-bit versions of Windows on x86_64 architecture:

  • Windows Server 2019
  • Windows 10 / Windows Server 2016

MongoDB only supports the 64-bit versions of these platforms.

See Supported Platforms for more information.

Oracle offers experimental support for VirtualBox on Windows hosts where Hyper-V is running. However, Microsoft does not support VirtualBox on Hyper-V.

Disable Hyper-V if you want to install MongoDB on Windows using VirtualBox.

Before deploying MongoDB in a production environment, consider the Production Notes document which offers performance considerations and configuration recommendations for production MongoDB deployments.

Follow these steps to install MongoDB Enterprise Edition using the Windows Installation wizard. The installation process installs both the MongoDB binaries as well as the default configuration file <install directory>\bin\mongod.cfg.

1

Download the MongoDB Enterprise .msi installer from the following link:

MongoDB Download Center

  1. In the Version dropdown, select the version of MongoDB to download.
  2. In the Platform dropdown, select Windows.
  3. In the Package dropdown, select msi.
  4. Click Download.
2

For example, from the Windows Explorer/File Explorer:

  1. Go to the directory where you downloaded the MongoDB installer (.msi file). By default, this is your Downloads directory.
  2. Double-click the .msi file.
3

The wizard steps you through the installation of MongoDB and MongoDB Compass.

  1. Choose Setup Type
    You can choose either the Complete (recommended for most users) or Custom setup type. The Complete setup option installs MongoDB and the MongoDB tools to the default location. The Custom setup option allows you to specify which executables are installed and where.
  2. Service Configuration

    Starting in MongoDB 4.0, you can set up MongoDB as a Windows service during the install or just install the binaries.

  3. Install MongoDB Compass
    Optional. To have the wizard install MongoDB Compass, select Install MongoDB Compass (Default).
  4. When ready, click Install.

The MongoDB service is started upon successful installation [1].

To begin using MongoDB, connect a mongo.exe shell to the running MongoDB instance. Either:

  • From Windows Explorer/File Explorer, go to C:\Program Files\MongoDB\Server\4.4\bin\ directory and click on mongo.exe.
  • Or, open a Command Interpreter with Administrative privileges and run:

    "C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"

For information on CRUD (Create,Read,Update,Delete) operations, see:

[1] The MongoDB instance is configured using the configuration file <install directory>\bin\mongod.cfg.

If you only installed the executables and did not install MongoDB as a Windows service, you must manually start the MongoDB instance.

See Start MongoDB Enterprise Edition from the Command Interpreter for instructions to start a MongoDB instance.

1

Create the data directory where MongoDB stores data. MongoDB's default data directory path is the absolute path \data\db on the drive from which you start MongoDB.

From the Command Interpreter, create the data directories:

cd C:\
md "\data\db"
2

To start MongoDB, run exe.

"C:\Program Files\MongoDB\Server\4.4\bin\mongod.exe" --dbpath="c:\data\db"

The --dbpath option points to your database directory.

If the MongoDB database server is running correctly, the Command Interpreter displays:

[initandlisten] waiting for connections
Important

Depending on the Windows Defender Firewall settings on your Windows host, Windows may display a Security Alert dialog box about blocking "some features" of C:\Program Files\MongoDB\Server\4.4\bin\mongod.exe from communicating on networks. To remedy this issue:

  1. Click Private Networks, such as my home or work network.
  2. Click Allow access.

To learn more about security and MongoDB, see the Security Documentation.

3

To connect a mongo.exe shell to the MongoDB instance, open another Command Interpreter with Administrative privileges and run:

"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"

For more information on connecting a mongo.exe shell, such as to connect to a MongoDB instance running on a different host and/or port, see The mongo Shell. For information on CRUD (Create,Read,Update,Delete) operations, see:

Starting in version 4.0, you can install and configure MongoDB as a Windows Service during the install, and the MongoDB service is started upon successful installation.

To start/restart the MongoDB service, use the Services console:

  1. From the Services console, locate the MongoDB service.
  2. Right-click on the MongoDB service and click Start.

To begin using MongoDB, connect a mongo.exe shell to the running MongoDB instance. To connect, open a Command Interpreter with Administrative privileges and run:

"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"

For more information on connecting a mongo.exe shell, such as to connect to a MongoDB instance running on a different host and/or port, see The mongo Shell. For information on CRUD (Create,Read,Update,Delete) operations, see:

You can also manually manage the service from the command line. To start the MongoDB service from the command line, open a Windows command prompt/interpreter (cmd.exe) as an Administrator, and run the following command:

1

Close all other command prompts, then invoke the following command:

net start MongoDB
2

Check your MongoDB log file for the following line:

[initandlisten] waiting for connections on port 27017

You may see non-critical warnings in the process output. As long as you see this message in the MongoDB log, you can safely ignore these warnings during your initial evaluation of MongoDB.

3

To connect to MongoDB through the mongo.exe shell, open another Command Interpreter.

"C:\Program Files\MongoDB\Server\4.4\bin\mongo.exe"

To stop/pause the MongoDB service, use the Services console:

  1. From the Services console, locate the MongoDB service.
  2. Right-click on the MongoDB service and click Stop (or Pause).

You can also manage the service from the command line. To stop the MongoDB service from the command line, open a Windows command prompt/interpreter (cmd.exe) as an Administrator, and run the following command:

net stop MongoDB

To remove the MongoDB service, first use the Services console to stop the service. Then open a Windows command prompt/interpreter (cmd.exe) as an Administrator, and run the following command:

sc.exe delete MongoDB

By default, MongoDB launches with bindIp set to 127.0.0.1, which binds to the localhost network interface. This means that the mongod.exe can only accept connections from clients that are running on the same machine. Remote clients will not be able to connect to the mongod.exe, and the mongod.exe will not be able to initialize a replica set unless this value is set to a valid network interface.

This value can be configured either:

  • in the MongoDB configuration file with bindIp, or
  • via the command-line argument --bind_ip
Warning

Before binding to a non-localhost (e.g. publicly accessible) IP address, ensure you have secured your cluster from unauthorized access. For a complete list of security recommendations, see Security Checklist. At minimum, consider enabling authentication and hardening network infrastructure.

For more information on configuring bindIp, see IP Binding.

If you installed MongoDB with the Windows installer (.msi), that .msi automatically upgrades within its release series (e.g. 4.2.1 to 4.2.2).

Upgrading a full release series (e.g. 4.0 to 4.2) requires a new installation.

All command-line examples in this tutorial are provided as absolute paths to the MongoDB binaries. You can add C:\Program Files\MongoDB\Server\4.4\bin to your System PATH and then omit the full path to the MongoDB binaries.

Give Feedback
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.