How To Install MongoDB In Windows?

Download the MongoDB Community Server installer for Windows from the official MongoDB website

Run the downloaded `.msi` installer

Select the setup type

Choose `Complete` or `Custom`

Accept the license agreement

Choose whether to install MongoDB as a Windows service

Select the service account and data directory if prompted

Complete the installation

Install MongoDB Compass if desired

Add MongoDB `bin` folder to the system PATH

Open Command Prompt or PowerShell

Run `mongod –version` to verify installation

Create a data directory, such as `C:datadb`

Start MongoDB with `mongod`

Open a new Command Prompt or PowerShell window

Run `mongosh` to connect to MongoDB

Verify the server is running successfully

Suggested for You

Trending Today