This tutorial provides step-by-step instructions for installing MongoDB 6.0 Community Edition on Windows using the default installation wizard. Follow these steps to get started:
- Consider using MongoDB Atlas, a hosted MongoDB service option in the cloud that requires no installation overhead and offers a free tier to get started.
- Check the MongoDB version and platform support. MongoDB 6.0 Community Edition only supports 64-bit versions of Windows on x86_64 architecture.
- Download the MongoDB Community .msi installer from the MongoDB Download Center, selecting the version of MongoDB to download, the Windows platform, and the msi package.
- Run the MongoDB installer and follow the installation wizard to install MongoDB and MongoDB Compass. You can choose either the Complete or Custom setup type.
- Select the option to Install MongoD as a Service if you want to configure and start MongoDB as a Windows service during installation. Specify the service name, data directory, and log directory.
- After installation, add the path to your mongosh.exe binary to your PATH environment variable during installation. Follow the mongosh installation instructions to download and install the shell separately.
- If you installed MongoDB as a Windows service, the service starts automatically upon successful installation. Configure the MongoDB instance with the configuration file
<install directory>\bin\mongod.cfg
.
- If you did not install MongoDB as a Windows service, you must manually start the MongoDB instance from the Windows command prompt/interpreter as an Administrator.
- To connect to MongoDB using mongosh.exe, open a new Command Interpreter and enter mongosh.exe.
- Follow the instructions for additional considerations, such as configuring bindIp and upgrading MongoDB releases.
By following these steps, you should be able to install MongoDB Community Edition on Windows and connect to your MongoDB instance using mongosh.exe.