Follow the below instructions to set up a MongoDB server in your system.
- Go to mongodb.com/try/download/community
- Download the MongoDB Community Server as per your system's OS.
- Install the MongoDB Community Server using the downloaded setup using the default configurations.
- It should have been installed in the path:
C:\Program Files\MongoDB
- Now, visit mongodb.com/try/download/shell
- Download the MongoDB Shell.
- Install it. I must be installed in the path:
C:\Users\<username>\AppData\Local\Programs\mongosh
- In the above path, there are 2 files:
mongosh.exe
andmongocryptd-mongosh.exe
. Copy these 2 insideC:\Program Files\MongoDB\Server\5.0\bin
- Open command prompt as an administrator.
- To make sure that the MongoDB server is running, enter the command
net start MongoDB
. It'll start the MongoDB server, if not running already. - Then enter the command
mongosh
. A shell to open MongoDB commands will open.
If the mongosh
command is successful, you've set up MongoDB in your system successfully.