> For the complete MongoDB documentation index, see www.mongodb.com/docs/llms.txt

<!--
Tab options on this page. Append to the .md URL to filter:
  ?tabs=<id,...>   select specific tabs (e.g. ?tabs=nodejs,shell)
  ?allTabs=true    include every tab
  (no param)       default: one tab per tabset

Available tabs:
  other tabs: service, mongodb
-->

# Install MongoDB Community on Windows

Select your installation method to view instructions for MongoDB Community Edition.

**Note:**

By default, MongoDB Community Edition does not include MongoDB Search. To use MongoDB Search with MongoDB Community, you must install MongoDB Search with [Docker](https://www.mongodb.com/docs/search/self-managed/current/installation/docker.md#std-label-mongot-deployment-using-docker) or [Linux](https://www.mongodb.com/docs/search/self-managed/current/installation/linux.md#std-label-mongot-deployment-on-linux) separately.

## Install MongoDB Community Edition on Windows

### Overview

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

#### MongoDB Version

This tutorial installs MongoDB 9.0 Community Edition. To install a different version of MongoDB Community, use the version drop-down menu in the sidebar and select the documentation for that version.

#### Installation Method

This tutorial installs MongoDB on Windows using the default MSI installation wizard. You can also install MongoDB on Windows by these other methods:

- [Install MongoDB using msiexec.exe.](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows-msiexec)

- [Install MongoDB from the zip file](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows-zip)

### Considerations

#### MongoDB Shell, `mongosh`

The MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)) is not installed with MongoDB Server. You need to follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install [mongosh](https://www.mongodb.com/docs/mongodb-shell/) separately.

#### Platform Support

MongoDB 9.0 Community Edition supports the following 64-bit versions of Windows on x86\_64 architecture:

- Windows Server 2022

- Windows 11

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

For more information, see [Platform Support.](https://www.mongodb.com/docs/manual/administration/production-notes.md#std-label-prod-notes-supported-platforms)

**Note:**

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

#### Virtualization

Oracle offers [experimental support](https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html) for VirtualBox on Windows hosts where Hyper-V is running. However, Microsoft does not support [VirtualBox on Hyper-V.](https://docs.microsoft.com/en-us/troubleshoot/windows-client/application-management/virtualization-apps-not-work-with-hyper-v)

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

#### Production Notes

Before deploying MongoDB in a production environment, see the [Production Notes for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/production-notes.md) document for performance considerations and configuration recommendations.

#### Full Time Diagnostic Data Capture

MongoDB logs diagnostic data to assist with troubleshooting. For detailed information, see [Full Time Diagnostic Data Capture.](https://www.mongodb.com/docs/manual/administration/full-time-diagnostic-data-capture.md#std-label-ftdc-stub)

On Windows, to collect system data such as disk, CPU, and memory, FTDC requires Microsoft access permissions from the following groups:

- Performance Monitor Users

- Performance Log Users

If the user running [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) is not an administrator, add them to these groups to log FTDC data. For more information, see the [Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/perfctrs/restricting-access-to-performance-extension--dlls).

### Install MongoDB Community Edition

#### Procedure

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](https://www.mongodb.com/docs/manual/reference/configuration-options.md#std-label-configuration-options) `<install
    directory>\bin\mongod.cfg`.

1. Download the installer.

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

   ➤

   [MongoDB Download Center](https://www.mongodb.com/try/download/community)

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

   In the Platform dropdown, select Windows.

   In the Package dropdown, select msi.

   Click Download.

2. Run the MongoDB installer.

   For example, from the Windows Explorer/File Explorer:

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

   Double-click the `.msi` file.

3. Follow the MongoDB Community Edition installation wizard.

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

   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.

   Service Configuration

   You can set up MongoDB as a Windows service during the install or just install the binaries.

   ### MongoDB Service

   You can configure and start MongoDB as a Windows service during the install, and the MongoDB service is started upon successful installation.

   - Select Install MongoD as a Service.

   - Select one of these options:

     - Run the service as Network Service user (Default)

       This is a Windows user account that is built-in to Windows.

     - Run the service as a local or domain user

       - For an existing local user account, specify a period (`.`) for the Account
         Domain and specify the Account Name and the Account Password for the user.

       - For an existing domain user, specify the Account Domain, Account
         Name and Account Password for that user.

   - Service Name. Specify the service name. Default name is `MongoDB`. If you already have a service with the specified name, you must choose another name.

   - Data Directory. Specify the data directory, which corresponds to the [`--dbpath`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--dbpath). If the directory does not exist, the installer will create the directory and sets the directory access to the service user.

   - Log Directory. Specify the Log directory, which corresponds to the [`--logpath`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--logpath). If the directory does not exist, the installer will create the directory and sets the directory access to the service user.

   Install MongoDB Compass

   *Optional*. To have the wizard install [MongoDB Compass](https:///www.mongodb.com/products/compass), select Install MongoDB Compass (Default).

   When ready, click Install.

#### Install `mongosh`

The `.msi` installer does not include [mongosh](https://www.mongodb.com/docs/mongodb-shell/). Follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the shell separately.

#### If You Installed MongoDB as a Windows Service

The MongoDB service starts upon successful installation.

If you would like to customize the service, you must [stop the service](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-stop-mongodb-community-edition-windows-service). Customize the MongoDB instance by editing the configuration file at `<install directory>\bin\mongod.cfg`.

For information about the available configuration options, refer to [Self-Managed Configuration File Options.](https://www.mongodb.com/docs/manual/reference/configuration-options.md#std-label-configuration-options)

After making changes, [start the service again.](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-start-mongodb-community-edition-windows-service)

#### If You Did Not Install MongoDB as a Windows Service

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

See [Run MongoDB Community Edition from the Command Interpreter](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-run-mongodb-from-cmd) for instructions to start a MongoDB instance.

### Run MongoDB Community Edition as a Windows Service

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](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

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`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) using [mongosh.exe](https://www.mongodb.com/docs/mongodb-shell/), such as connecting to a MongoDB instance running on a different host and/or port, see [Connect to a Deployment.](https://www.mongodb.com/docs/mongodb-shell/connect/)

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

- [Create Documents](https://www.mongodb.com/docs/manual/tutorial/insert-documents.md#std-label-write-op-insert)

- [Read Documents](https://www.mongodb.com/docs/manual/tutorial/query-documents.md#std-label-read-operations-queries)

- [Update Documents](https://www.mongodb.com/docs/manual/tutorial/update-documents.md#std-label-write-op-update)

- [Delete Documents](https://www.mongodb.com/docs/manual/tutorial/delete-documents.md#std-label-write-op-delete)

#### Start MongoDB Community Edition as a Windows Service

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.

#### Stop MongoDB Community Edition as a Windows Service

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

#### Remove MongoDB Community Edition as a Windows Service

To remove the MongoDB service, first use the Services console to stop the service. Then open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

```bat
sc.exe delete MongoDB
```

### Run MongoDB Community Edition from the Command Interpreter

You can run MongoDB Community Edition from the Windows command prompt/interpreter (`cmd.exe`) instead of as a service.

Open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator.

**Important:**

You must open the command interpreter as an Administrator.

1. Create database directory.

   Create the [data directory](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-dbpath) 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:

   ```bat
   cd C:\
   md "\data\db"
   ```

2. Start your MongoDB database.

   To start MongoDB, run [`mongod.exe`.](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe)

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

   The [`--dbpath`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--dbpath) option points to your database directory.

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

   ```bash
   [initandlisten] waiting for connections
   ```

   **Important:**

   Depending on the [Windows Defender Firewall](https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/) settings on your Windows host, Windows may display a Security Alert dialog box about blocking "some features" of `C:\Program Files\MongoDB\Server\9.0\bin\mongod.exe` from communicating on networks. To remedy this issue:

   Click Private Networks, such as my home or work
   network.

   Click Allow access.

   To learn more about security and MongoDB, see the [Security Documentation.](https://www.mongodb.com/docs/manual/security.md#std-label-security)

3. Connect to MongoDB.

   If you have not already done so, follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

   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 `mongod` using [mongosh.exe](https://www.mongodb.com/docs/mongodb-shell/), such as connecting to a MongoDB instance running on a different host and/or port, see [Connect to a Deployment.](https://www.mongodb.com/docs/mongodb-shell/connect/)

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

   - [Create Documents](https://www.mongodb.com/docs/manual/tutorial/insert-documents.md)

   - [Read Documents](https://www.mongodb.com/docs/manual/tutorial/query-documents.md)

   - [Update Documents](https://www.mongodb.com/docs/manual/tutorial/update-documents.md)

   - [Delete Documents](https://www.mongodb.com/docs/manual/tutorial/delete-documents.md#std-label-write-op-delete)

### Additional Considerations

#### Localhost Binding by Default

By default, MongoDB launches with [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) set to `127.0.0.1`, which binds it to the localhost network interface. This means that the `mongod.exe` instance only accepts connections from clients running on the same machine. To allow remote clients to access the `mongod.exe` instance or to initialize a [replica set](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-replica-set) on the instance, you must bind `mongod.exe` to a publicly-accessible network interface.

To bind the network interface, use the [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) setting in the configuration file or start `mongod.exe` with the [`--bind_ip`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--bind_ip) command-line option.

**Warning:**

Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see [Security Checklist for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-security-checklist). At minimum, consider [enabling authentication](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-checklist-auth) and [hardening network infrastructure.](https://www.mongodb.com/docs/manual/core/security-hardening.md#std-label-network-config-hardening)

For more information on configuring [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp), see [IP Binding in Self-Managed Deployments.](https://www.mongodb.com/docs/manual/core/security-mongodb-configuration.md#std-label-ip-binding)

#### Point Releases and `.msi`

If you installed MongoDB with the Windows installer (`.msi`), the `.msi` automatically upgrades within its [release series](https://www.mongodb.com/docs/manual/reference/versioning.md#std-label-release-version-numbers) (e.g. 7.2.1 to 7.2.2).

Upgrading a full release series (e.g. 6.0 to 7.0) requires a new installation.

#### Add MongoDB binaries to the System PATH

If you add `C:\Program Files\MongoDB\Server\9.0\bin` to your System `PATH` you can omit the full path to the MongoDB Server binaries. You should also add the path to [mongosh](https://www.mongodb.com/docs/mongodb-shell/) if you have not already done so.

## Install MongoDB Community on Windows using `msiexec.exe`

### Overview

Use this tutorial to install MongoDB 9.0 Community Edition on Windows in an unattended fashion using `msiexec.exe` from the command line. This is useful for system administrators who wish to deploy MongoDB using automation.

#### MongoDB Version

This tutorial installs MongoDB 9.0 Community Edition. To install a different version of MongoDB Community, use the version drop-down menu in the sidebar and select the documentation for that version.

#### Installation Method

This tutorial installs MongoDB on Windows by extracting from a zip file. You can also install MongoDB on Windows by these other methods:

- [Install MongoDB using the MSI Installer](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows)

- [Install MongoDB from the zip file](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows-zip)

### Considerations

#### MongoDB Shell, `mongosh`

The MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)) is not installed with MongoDB Server. You need to follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install [mongosh](https://www.mongodb.com/docs/mongodb-shell/) separately.

#### Platform Support

MongoDB 9.0 Community Edition supports the following 64-bit versions of Windows on x86\_64 architecture:

- Windows Server 2022

- Windows 11

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

For more information, see [Platform Support.](https://www.mongodb.com/docs/manual/administration/production-notes.md#std-label-prod-notes-supported-platforms)

**Note:**

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

#### Virtualization

Oracle offers [experimental support](https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html) for VirtualBox on Windows hosts where Hyper-V is running. However, Microsoft does not support [VirtualBox on Hyper-V.](https://docs.microsoft.com/en-us/troubleshoot/windows-client/application-management/virtualization-apps-not-work-with-hyper-v)

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

#### Production Notes

Before deploying MongoDB in a production environment, see the [Production Notes for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/production-notes.md) document for performance considerations and configuration recommendations.

#### Full Time Diagnostic Data Capture

MongoDB logs diagnostic data to assist with troubleshooting. For detailed information, see [Full Time Diagnostic Data Capture.](https://www.mongodb.com/docs/manual/administration/full-time-diagnostic-data-capture.md#std-label-ftdc-stub)

On Windows, to collect system data such as disk, CPU, and memory, FTDC requires Microsoft access permissions from the following groups:

- Performance Monitor Users

- Performance Log Users

If the user running [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) is not an administrator, add them to these groups to log FTDC data. For more information, see the [Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/perfctrs/restricting-access-to-performance-extension--dlls).

### Install MongoDB Community Edition

#### Procedure

Follow these steps to install MongoDB Community Edition unattended on Windows from the [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) using `msiexec.exe`.

1. Download the installer.

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

   ➤

   [MongoDB Download Center](https://www.mongodb.com/try/download/community)

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

   In the Platform dropdown, select Windows.

   In the Package dropdown, select msi.

   Click Download.

2. Run the Windows Installer from the Windows Command Interpreter.

   **Important:**

   You must open the command interpreter as an Administrator.

   Use the `.msi` installer to install all MongoDB binaries, including [MongoDB Compass.](https:///www.mongodb.com/products/compass)

   From the Command Interpreter, go to the directory containing the `.msi` installation binary and run:

   ```bat
   msiexec.exe /l*v mdbinstall.log  /qb /i mongodb-windows-x86_64-9.0-signed.msi

   ```

   The operation installs the binaries to the default directory `C:\Program Files\MongoDB\Server\9.0\bin`.

   To specify a different installation location for the executables, add the `INSTALLLOCATION` value.

   ```bat
   msiexec.exe /l*v mdbinstall.log  /qb /i mongodb-windows-x86_64-9.0-signed.msi ^
               INSTALLLOCATION="C:\MongoDB\Server\9.0\"

   ```

   To suppress the installation of [MongoDB Compass](https://www.mongodb.com/docs/compass/current.md#std-label-compass-index), you must explicitly include the `SHOULD_INSTALL_COMPASS="0"` argument.

   ```bat
   msiexec.exe /l*v mdbinstall.log  /qb /i mongodb-windows-x86_64-9.0-signed.msi ^
               SHOULD_INSTALL_COMPASS="0"

   ```

   To install specific MongoDB component sets, you can specify them in the `ADDLOCAL` argument using a comma-separated list including one or more of the following component sets:

   | Component Set Name | Binaries Included in the Component Set |
   | --- | --- |
   | `ServerNoService` | [`mongod.exe`](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe) |
   | `ServerService` | Set up [`mongod.exe`](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe) as a Windows service. |
   | `Router` | [`mongos.exe`](https://www.mongodb.com/docs/manual/reference/program/mongos.exe.md#mongodb-binary-bin.mongos.exe) |
   | `MonitoringTools` | [`mongostat.exe`](https://www.mongodb.com/docs/database-tools/mongostat.md#mongodb-binary-bin.mongostat), [`mongotop.exe`](https://www.mongodb.com/docs/database-tools/mongotop.md#mongodb-binary-bin.mongotop) |
   | `ImportExportTools` | [`mongodump.exe`](https://www.mongodb.com/docs/database-tools/mongodump.md#mongodb-binary-bin.mongodump), [`mongorestore.exe`](https://www.mongodb.com/docs/database-tools/mongorestore.md#mongodb-binary-bin.mongorestore), [`mongoexport.exe`](https://www.mongodb.com/docs/database-tools/mongoexport.md#mongodb-binary-bin.mongoexport), [`mongoimport.exe`](https://www.mongodb.com/docs/database-tools/mongoimport.md#mongodb-binary-bin.mongoimport) |
   | `MiscellaneousTools` | `mongodecrypt.exe`, [`mongokerberos.exe`](https://www.mongodb.com/docs/manual/reference/program/mongokerberos.md#mongodb-binary-bin.mongokerberos), [`mongoldap.exe`](https://www.mongodb.com/docs/manual/reference/program/mongoldap.md#mongodb-binary-bin.mongoldap) |

   For example, to install the MongoDB server ([`mongod.exe`](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe)) with the legacy `mongo` client and then set up the MongoDB server as a Windows service, run:

   ```bat
   msiexec.exe /l*v mdbinstall.log  /qb /i mongodb-windows-x86_64-9.0-signed.msi ^
               ADDLOCAL="ServerService,LegacyClient" ^
               SHOULD_INSTALL_COMPASS="0"

   ```

   To include Compass in the installs, remove `SHOULD_INSTALL_COMPASS="0"`.

### Start MongoDB Community Edition from the Command Interpreter

Open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator.

**Important:**

You must open the command interpreter as an Administrator.

1. Create database directory.

   Create the [data directory](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-dbpath) 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:

   ```bat
   cd C:\
   md "\data\db"
   ```

2. Start your MongoDB database.

   To start MongoDB, run [`mongod.exe`.](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe)

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

   The [`--dbpath`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--dbpath) option points to your database directory.

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

   ```bash
   [initandlisten] waiting for connections
   ```

   **Important:**

   Depending on the [Windows Defender Firewall](https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/) settings on your Windows host, Windows may display a Security Alert dialog box about blocking "some features" of `C:\Program Files\MongoDB\Server\9.0\bin\mongod.exe` from communicating on networks. To remedy this issue:

   Click Private Networks, such as my home or work
   network.

   Click Allow access.

   To learn more about security and MongoDB, see the [Security Documentation.](https://www.mongodb.com/docs/manual/security.md#std-label-security)

3. Connect to MongoDB.

   If you have not already done so, follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

   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 `mongod` using [mongosh.exe](https://www.mongodb.com/docs/mongodb-shell/), such as connecting to a MongoDB instance running on a different host and/or port, see [Connect to a Deployment.](https://www.mongodb.com/docs/mongodb-shell/connect/)

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

   - [Create Documents](https://www.mongodb.com/docs/manual/tutorial/insert-documents.md)

   - [Read Documents](https://www.mongodb.com/docs/manual/tutorial/query-documents.md)

   - [Update Documents](https://www.mongodb.com/docs/manual/tutorial/update-documents.md)

   - [Delete Documents](https://www.mongodb.com/docs/manual/tutorial/delete-documents.md#std-label-write-op-delete)

### Run MongoDB Community Edition as a Windows Service

#### Start MongoDB Community Edition as a Windows Service

You can install and configure MongoDB as a Windows Service during the install, and the MongoDB service starts upon successful installation.

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](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

1. Start the MongoDB service.

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

   ```bat
   net start MongoDB
   ```

2. Verify that MongoDB has started successfully.

   Check your MongoDB log file for the following line:

   ```none
   [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. Connect to the MongoDB server.

   If you have not already done so, follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

   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.

#### Stop MongoDB Community Edition as a Windows Service

To stop/pause the MongoDB service, you can 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](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

```bat
net stop MongoDB
```

#### Remove MongoDB Community Edition as a Windows Service

To remove the MongoDB service, first use the Services console to stop the service. Then open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

```bat
sc.exe delete MongoDB
```

### Additional Considerations

#### Localhost Binding by Default

By default, MongoDB launches with [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) set to `127.0.0.1`, which binds it to the localhost network interface. This means that the `mongod.exe` instance only accepts connections from clients running on the same machine. To allow remote clients to access the `mongod.exe` instance or to initialize a [replica set](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-replica-set) on the instance, you must bind `mongod.exe` to a publicly-accessible network interface.

To bind the network interface, use the [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) setting in the configuration file or start `mongod.exe` with the [`--bind_ip`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--bind_ip) command-line option.

**Warning:**

Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see [Security Checklist for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-security-checklist). At minimum, consider [enabling authentication](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-checklist-auth) and [hardening network infrastructure.](https://www.mongodb.com/docs/manual/core/security-hardening.md#std-label-network-config-hardening)

For more information on configuring [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp), see [IP Binding in Self-Managed Deployments.](https://www.mongodb.com/docs/manual/core/security-mongodb-configuration.md#std-label-ip-binding)

#### Point Releases and `.msi`

If you installed MongoDB with the Windows installer (`.msi`), the `.msi` automatically upgrades within the [same release series](https://www.mongodb.com/docs/manual/reference/versioning.md#std-label-release-version-numbers) (e.g. 7.2.1 to 7.2.2).

Upgrading a full release series (e.g. 6.0 to 7.0) requires a new installation.

#### Add MongoDB binaries to the System PATH

If you add `C:\Program Files\MongoDB\Server\9.0\bin` to your System `PATH`, you can omit the full path to the MongoDB Server binaries. You should also add the path to [mongosh](https://www.mongodb.com/docs/mongodb-shell/) if you have not already done so.

## Install MongoDB Community on Windows using the Zip File

### Overview

Use this tutorial to install MongoDB Community on Windows by downloading and extracting the zip file.

#### MongoDB Version

This tutorial installs MongoDB 9.0 Community Edition. To install a different version of MongoDB Community, use the version drop-down menu in the sidebar and select the documentation for that version.

#### Installation Method

This tutorial installs MongoDB on Windows by extracting from a zip file. You can also install MongoDB on Windows by these other methods:

- [Install MongoDB using msiexec.exe](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows-msiexec)

- [Install MongoDB using the MSI Installer](https://www.mongodb.com/docs/manual/administration/install-community-windows.md#std-label-install-mdb-community-windows)

### Considerations

#### MongoDB Shell, `mongosh`

The MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)) is not installed with MongoDB Server. You need to follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install [mongosh](https://www.mongodb.com/docs/mongodb-shell/) separately.

#### Platform Support

MongoDB 9.0 Community Edition supports the following 64-bit versions of Windows on x86\_64 architecture:

- Windows Server 2022

- Windows 11

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

For more information, see [Platform Support.](https://www.mongodb.com/docs/manual/administration/production-notes.md#std-label-prod-notes-supported-platforms)

**Note:**

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

#### Virtualization

Oracle offers [experimental support](https://docs.oracle.com/en/virtualization/virtualbox/6.0/admin/hyperv-support.html) for VirtualBox on Windows hosts where Hyper-V is running. However, Microsoft does not support [VirtualBox on Hyper-V.](https://docs.microsoft.com/en-us/troubleshoot/windows-client/application-management/virtualization-apps-not-work-with-hyper-v)

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

#### Production Notes

Before deploying MongoDB in a production environment, see the [Production Notes for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/production-notes.md) document for performance considerations and configuration recommendations.

#### Full Time Diagnostic Data Capture

MongoDB logs diagnostic data to assist with troubleshooting. For detailed information, see [Full Time Diagnostic Data Capture.](https://www.mongodb.com/docs/manual/administration/full-time-diagnostic-data-capture.md#std-label-ftdc-stub)

On Windows, to collect system data such as disk, CPU, and memory, FTDC requires Microsoft access permissions from the following groups:

- Performance Monitor Users

- Performance Log Users

If the user running [`mongod`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#mongodb-binary-bin.mongod) and [`mongos`](https://www.mongodb.com/docs/manual/reference/program/mongos.md#mongodb-binary-bin.mongos) is not an administrator, add them to these groups to log FTDC data. For more information, see the [Microsoft documentation](https://learn.microsoft.com/en-us/windows/win32/perfctrs/restricting-access-to-performance-extension--dlls).

### Install MongoDB Community Edition

#### Procedure

Follow these steps to install MongoDB Community Edition from the zip file.

1. Download the zip file.

   Download the MongoDB Community `.zip` file from the following link:

   ➤

   [MongoDB Download Center](https://www.mongodb.com/try/download/community)

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

   In the Platform dropdown, select Windows x64.

   In the Package dropdown, select zip.

   Click Download.

2. Extract the MongoDB files.

   Go to the directory where you downloaded the MongoDB `.zip` file. By default, this is your `Downloads` directory.

   Double-click the `.zip` file.

   Extract the files to your preferred location. For example, you may want to use `C:\MongoDB`.

3. Create Configuration File (Optional).

   You can create a configuration file to specify options for MongoDB. To do so, create a file named `mongod.cfg` in the `\bin\` directory within the directory where you extracted the MongoDB files (`<install directory>\bin\mongod.cfg`). For more information on creating a config file, see [Configuration File.](https://www.mongodb.com/docs/manual/reference/configuration-options.md#std-label-conf-file)

4. Create Required and Optional Directories.

   MongoDB needs a data directory to store your data. By default, it uses `C:\data\db`, but you may specify a different location in your config file. You can create the data directory using the Windows Command Prompt:

   ```bat
   mkdir c:\data\db
   ```

   If you specified a log path in the configuration file, create the log directory in the same way.

### Start MongoDB Community Edition from the Command Interpreter

Open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator.

**Important:**

You must open the command interpreter as an Administrator.

1. Create database directory.

   Create the [data directory](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-dbpath) 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:

   ```bat
   cd C:\
   md "\data\db"
   ```

2. Start your MongoDB database.

   To start MongoDB, run [`mongod.exe`.](https://www.mongodb.com/docs/manual/reference/program/mongod.exe.md#mongodb-binary-bin.mongod.exe)

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

   The [`--dbpath`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--dbpath) option points to your database directory.

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

   ```bash
   [initandlisten] waiting for connections
   ```

   **Important:**

   Depending on the [Windows Defender Firewall](https://learn.microsoft.com/en-us/windows/security/operating-system-security/network-security/windows-firewall/) settings on your Windows host, Windows may display a Security Alert dialog box about blocking "some features" of `C:\Program Files\MongoDB\Server\9.0\bin\mongod.exe` from communicating on networks. To remedy this issue:

   Click Private Networks, such as my home or work
   network.

   Click Allow access.

   To learn more about security and MongoDB, see the [Security Documentation.](https://www.mongodb.com/docs/manual/security.md#std-label-security)

3. Connect to MongoDB.

   If you have not already done so, follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

   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 `mongod` using [mongosh.exe](https://www.mongodb.com/docs/mongodb-shell/), such as connecting to a MongoDB instance running on a different host and/or port, see [Connect to a Deployment.](https://www.mongodb.com/docs/mongodb-shell/connect/)

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

   - [Create Documents](https://www.mongodb.com/docs/manual/tutorial/insert-documents.md)

   - [Read Documents](https://www.mongodb.com/docs/manual/tutorial/query-documents.md)

   - [Update Documents](https://www.mongodb.com/docs/manual/tutorial/update-documents.md)

   - [Delete Documents](https://www.mongodb.com/docs/manual/tutorial/delete-documents.md#std-label-write-op-delete)

### Run MongoDB Community Edition as a Windows Service

#### Start MongoDB Community Edition as a Windows Service

You can install and configure MongoDB as a Windows Service during the install, and the MongoDB service starts upon successful installation.

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](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

1. Start the MongoDB service.

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

   ```bat
   net start MongoDB
   ```

2. Verify that MongoDB has started successfully.

   Check your MongoDB log file for the following line:

   ```none
   [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. Connect to the MongoDB server.

   If you have not already done so, follow the [mongosh installation instructions](https://www.mongodb.com/docs/mongodb-shell/install/) to download and install the MongoDB Shell ([mongosh](https://www.mongodb.com/docs/mongodb-shell/)).

   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.

#### Stop MongoDB Community Edition as a Windows Service

To stop/pause the MongoDB service, you can 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](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

```bat
net stop MongoDB
```

#### Remove MongoDB Community Edition as a Windows Service

To remove the MongoDB service, first use the Services console to stop the service. Then open a [Windows command prompt/interpreter](https://docs.microsoft.com/en-us/windows-server/administration/windows-commands/cmd) (`cmd.exe`) as an Administrator, and run the following command:

```bat
sc.exe delete MongoDB
```

### Additional Considerations

#### Localhost Binding by Default

By default, MongoDB launches with [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) set to `127.0.0.1`, which binds it to the localhost network interface. This means that the `mongod.exe` instance only accepts connections from clients running on the same machine. To allow remote clients to access the `mongod.exe` instance or to initialize a [replica set](https://www.mongodb.com/docs/manual/reference/glossary.md#std-term-replica-set) on the instance, you must bind `mongod.exe` to a publicly-accessible network interface.

To bind the network interface, use the [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp) setting in the configuration file or start `mongod.exe` with the [`--bind_ip`](https://www.mongodb.com/docs/manual/reference/program/mongod.md#std-option-mongod.--bind_ip) command-line option.

**Warning:**

Before you bind your instance to a publicly-accessible IP address, you must secure your cluster from unauthorized access. For a complete list of security recommendations, see [Security Checklist for Self-Managed Deployments](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-security-checklist). At minimum, consider [enabling authentication](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-checklist-auth) and [hardening network infrastructure.](https://www.mongodb.com/docs/manual/core/security-hardening.md#std-label-network-config-hardening)

For more information on configuring [`bindIp`](https://www.mongodb.com/docs/manual/reference/configuration-options.md#mongodb-setting-net.bindIp), see [IP Binding in Self-Managed Deployments.](https://www.mongodb.com/docs/manual/core/security-mongodb-configuration.md#std-label-ip-binding)

#### Point Releases and `.msi`

If you installed MongoDB with the Windows installer (`.msi`), the `.msi` automatically upgrades within the [same release series](https://www.mongodb.com/docs/manual/reference/versioning.md#std-label-release-version-numbers) (e.g. 7.2.1 to 7.2.2).

Upgrading a full release series (e.g. 6.0 to 7.0) requires a new installation.

#### Add MongoDB binaries to the System PATH

If you add `C:\Program Files\MongoDB\Server\9.0\bin` to your System `PATH`, you can omit the full path to the MongoDB Server binaries. You should also add the path to [mongosh](https://www.mongodb.com/docs/mongodb-shell/) if you have not already done so.

## Next Steps

After you install MongoDB Community Edition, you can:

- **Get started**: Work through an introductory tutorial. To learn more, see [Getting Started with MongoDB.](https://www.mongodb.com/docs/manual/tutorial/getting-started.md#std-label-getting-started)

- **Deploy a replica set**: Set up replication for high availability. To learn how, see [Deploy a Self-Managed Replica Set.](https://www.mongodb.com/docs/manual/tutorial/deploy-replica-set.md#std-label-server-replica-set-deploy)

- **Set up access control**: Secure your deployment with authentication. To learn how, see [Enable Access Control on Self-Managed Deployments.](https://www.mongodb.com/docs/manual/tutorial/enable-authentication.md#std-label-enable-access-control)

- **Review the security checklist**: Confirm your deployment follows security best practices. To learn more, see [Security Checklist for Self-Managed Deployments.](https://www.mongodb.com/docs/manual/administration/security-checklist.md#std-label-security-checklist)

## Upgrade Community Edition to Enterprise Edition Tutorials

**Important:**

Do not use these instructions to upgrade to another release version.

For general guidance on MongoDB version numbering, release types, and upgrade paths, see [MongoDB Versions and Upgrade Paths.](https://www.mongodb.com/docs/mongodb-versions.md#std-label-versions-and-upgrade-paths)

- [Upgrade to MongoDB Enterprise (Standalone)](https://www.mongodb.com/docs/manual/tutorial/upgrade-to-enterprise-standalone.md#std-label-upgrade_to_enterprise_standalone)

- [Upgrade to MongoDB Enterprise (Replica Set)](https://www.mongodb.com/docs/manual/tutorial/upgrade-to-enterprise-replica-set.md#std-label-upgrade_to_enterprise_rs)

- [Upgrade to MongoDB Enterprise (Sharded Cluster)](https://www.mongodb.com/docs/manual/tutorial/upgrade-to-enterprise-sharded-cluster.md#std-label-upgrade_to_enterprise_sharded_cluster)
