Install MongoDB Community Edition on Windows — MongoDB Manual

Run MongoDB Community Edition from the Command Interpreter

On this page

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

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.

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

Use this tutorial to install MongoDB 6.0 Community Edition on Windows using the default installation wizard.

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

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

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

MongoDB is not supported on Windows Subsystem for Linux (WSL). To run MongoDB on Linux, use a supported Linux system.

See Platform Support for more information.

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

MongoDB 6.0 Community Edition supports the following 64-bit versions of Windows on x86_64 architecture:

The MongoDB Shell ( mongosh ) is not installed with MongoDB Server. You need to follow the mongosh installation instructions to download and install mongosh separately.

See Run MongoDB Community Edition from the Command Interpreter for instructions to start a MongoDB instance.

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

The MongoDB service starts upon successful installation. Configure the MongoDB instance with the configuration file <install directory>\bin\mongod.cfg .

The .msi installer does not include mongosh . Follow the mongosh installation instructions to download and install the shell separately.

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

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

Go to the directory where you downloaded the MongoDB installer ( .msi file). By default, this is your Downloads directory.

For example, from the Windows Explorer/File Explorer:

In the Package dropdown, select msi.

In the Platform dropdown, select Windows.

In the Version dropdown, select the version of MongoDB to download.

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

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

Starting in version 4.0, you can install and configure MongoDB as a
Windows Service during installation. The MongoDB service
starts upon successful installation. Configure the MongoDB instance
with the configuration file
<install directory>\bin\mongod.cfg.

If you have not already done so, follow the
mongosh installation instructions to download and
install the MongoDB Shell (mongosh).

Be sure to add the path to your mongosh.exe binary to your
PATH environment variable during installation.

Open a new Command Interpreter and enter mongosh.exe
to connect to MongoDB.

For more information on connecting to a mongod using
mongosh.exe, such as connecting to a MongoDB instance
running on a different host and/or port, see
Connect to a Deployment .

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

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 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).

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

Xổ số miền Bắc