How to install mongodb on windows 10

If you want to install MongoDB on Windows 10, it’s quite straightforward. You’ll need to download the installer, run it, and follow a few simple steps to get it up and running. Once installed, you’ll be able to use MongoDB for all your database needs. Easy peasy, right? Let’s dive in!

Installing MongoDB on Windows 10 will set you up with a powerful database system right on your PC. Follow these steps to get it done efficiently.

Step 1: Download the MongoDB Installer

First, go to the MongoDB website and download the Windows installer.

Ensure you’re downloading the correct version compatible with Windows 10. The MongoDB Community Server is recommended for most users.

Step 2: Run the Installer

Once downloaded, double-click the installer file to run it.

This will launch the MongoDB Setup Wizard. Follow the on-screen instructions. Typically, you can stick with the default settings.

Step 3: Complete the Installation Process

Click through the installation prompts, and click «Install» to begin the installation.

You’ll need administrative privileges to install MongoDB, so make sure you have the necessary permissions.

Step 4: Set Up the MongoDB Environment

After installation, you’ll need to set up the MongoDB environment variables.

This involves adding the MongoDB bin folder to your system’s PATH environment variable. This allows you to run MongoDB commands from any Command Prompt window.

Step 5: Start the MongoDB Service

Open Command Prompt and type mongod to start the MongoDB server.

This command initializes the MongoDB server. You’ll need to open another Command Prompt window to access the MongoDB shell, where you can start working with your databases.

After following these steps, you’ll have MongoDB installed on your Windows 10 machine, ready for action.

Tips for Installing MongoDB in Windows 10

  • Download from the Official Site: Always download MongoDB from the official MongoDB website to ensure you get the latest and most secure version.
  • Choose the Correct Version: Make sure you’re downloading the version that matches your system architecture (64-bit or 32-bit).
  • Follow Default Settings: Unless you have specific needs, stick with the default installation settings for simplicity.
  • Set Up the PATH Variable: Don’t skip setting up the PATH variable; it makes running MongoDB commands much easier.
  • Keep Your System Updated: Ensure your Windows 10 is up to date to avoid any compatibility issues.

Frequently Asked Questions

Is MongoDB free to use?

Yes, MongoDB offers a free version called the Community Server, which is suitable for most applications.

Do I need an internet connection to install MongoDB?

You need an internet connection to download the MongoDB installer. However, after installation, you can use MongoDB offline.

Can I install MongoDB on a system other than Windows 10?

Yes, MongoDB can be installed on various operating systems including macOS and Linux.

What is the difference between mongod and mongo in the Command Prompt?

mongod starts the MongoDB server, while mongo opens the MongoDB shell where you can interact with your databases.

Do I need to configure anything after installation?

Basic usage doesn’t require additional configuration, but advanced users might configure settings for specific needs.

Summary of Steps

  1. Download the MongoDB Installer.
  2. Run the Installer.
  3. Complete the Installation Process.
  4. Set Up the MongoDB Environment.
  5. Start the MongoDB Service.

Conclusion

Installing MongoDB on Windows 10 is a straightforward process that opens up a world of database possibilities. With just a few steps—downloading, installing, setting up environment variables, and starting the service—you’ll be up and running. Whether you’re a newbie or a seasoned pro, MongoDB offers the flexibility and power you need for data management. Remember to follow the tips and FAQs to make the process even smoother.

Feel free to explore MongoDB’s extensive documentation and community resources to get the most out of your new setup. Happy coding!

Matt Jacobs has been working as an IT consultant for small businesses since receiving his Master’s degree in 2003. While he still does some consulting work, his primary focus now is on creating technology support content for SupportYourTech.com.

His work can be found on many websites and focuses on topics such as Microsoft Office, Apple devices, Android devices, Photoshop, and more.

Cover image for HOW TO INSTALL AND RUN MONGO DB ON WINDOWS 10

Kolade Chris

Posted on

• Edited on

 

 

 

 

 

This article was initially published on Hashnode

MongoDB is a NoSQL database that has gained popularity in recent times. Unlike SQL databases that are like advanced spreadsheets, MongoDB stores data in JSON-like key-value pair called BSON (Binary JSON) in order to support features JSON does not.

In this article, I will walk you through the step-by-step guide on how to install MongoDB on your Windows 10 operating system, with insights on GUI tools such as Mongo Compass and Robo 3t.

INSTALLING MONGO DB

STEP 1: First of all, you need to download MongoDB from the official website. You can do that here. Make sure you select msi as the package type and not zip.
Follow the installer wizard to install MongoDB.

1 (2).png

2 (2).png

Select Complete as your setup type and keep the next item on default.

3 (2).png

You can choose to install Mongo Compass here; it would just take more time to install everything. My preference is to uncheck the box so I can download and install it separately.

4 (2).png

Click install.

STEP 2: Once it is done installing, navigate to C:/ProgramFiles/MongoDB/Server/4.4/bin. There, you should find Mongo.exe, mongod.exe, and mongos.exe. They are Mongo, MongoDB, and Mongo shell respectively.

5 (2).png

6 (2).png

STEP 3: Click on the address bar and type cmd to launch your windows command prompt. Click on enter and run mongo --version. You will see the version of the MongoDB installed. This means MongoDB has been rightly installed on your machine.

7 (2).png

In my case, it is version 4.4.4.

STEP 4: Next, close the command prompt and launch it in no directory this time. Run mongo --version. The response is “mongo is not recognized as an internal or external command operable program or batch file. Chill. This is because your path variable has not been assigned, meaning you have to set environment variables on your machine.

STEP 5: Search for «environment» on your machine and click “Edit the system environment variables”. You can find this in the control panel too.

8 (2).png

STEP 6: Click on environment variables.

9 (2).png

STEP 7: Under system variables, select path and click on edit.

STEP 8: In the next pop-up, click on New in order to paste your installation path. Go back to the directory where you got a proper installation response and copy the address.

10 (2).png

STEP 9: Click on New again and paste the address you copied. Hit Enter and continue clicking OK until all the boxes are closed.

11 (2).png

12 (2).png

STEP 10: Now, close your command prompt. Relaunch it and run the mongo --version. This time you should get a proper response that MongoDB has been installed correctly. Run mongod --version too to make sure the database is installed.
Forgive me for switching to Git Bash. I like to use it or Windows Subsystem for Linux (WSL).

CONNECTING AND RUNNING MONGO DB

STEP 1: To connect your command line to MongoDB, type mongo and hit enter.
If everything is done correctly so far, the mongo server should be running on port 27017 by now.

13 (2).png

STEP 2: To start using MongoDB, start by checking MongoDB default databases by running show dbs.

STEP 3: To create a database, run use firstDB. You can give it whatever name you want.

STEP 4: To create a collection, run db.<collection-name>.insert({“anything you want”: "anything you want"}). Feel free to add more. To show your collection, run show collections; your collection should show.

STEP 5: Run show dbs again to see the databases on your machine; you should see the database you created in step 3 above.

14 (2).png

USING THE GUIs

To use the Mongo Compass GUI, download it here. Make sure you select the right platform for windows.
Install it, it is straightforward. Launch the Mongo compass and you should see the interface below.

15 (2).png

You might have to make some simple selections in order to see the interface above.
To connect the Mongo Compass to MongoDB, click “Fill in collection fields individually”.

16 (2).png

Leave everything the way it is and click connect and you should see the databases available on your computer.

Here, you can create, insert, read, update and delete without the command line. Once you do it here, it’s done globally, so if you check your collection again in the command line by running db.<collection-name>.find(), you see what you’ve done in the GUI.

18 (2).png

If you have ever used Mongo Atlas (MongoDB in the cloud), the interface is very similar to the one you see above.

As for Robo 3t, a third-party GUI tool, you can download it here.
It’s simple to connect too and easier to work with than Compass, but I prefer Compass because of the Atlas-like interface.

19 (2).png

As you can see above, I have inserted my middle name and nickname with Robo 3t.

20 (2).png

Checking my database with db.person.find() gave me what you see above.

Thank you for reading.

Connect with me via my portfolio site, and Twitter via @koladechris, where I tweet and engage in anything web development.

Skip to content

How to setup or install MongoDB on Windows 10

In this tutorials, we are going to show you how to install MongoDb on Windows 10 operating system.

Install MongoDB on Windows 10 :

Download MongoDB from the offecial website and follow the below steps.

Install MongoDb 1 On windows 10

Select your operating system bit size (32 or 64) and click on Download button. It will ask for your basic information like name and email, then click on the download button, you will see the below screen.

Install MongoDb 2

Click on archive hyperlink, then MongoDB automatically start downloading and you can see the file name like mongodb-win32-x86_64-enterprise-windows-64-3.6.3.zip

Copy the file into your favorite location and extract it and rename it as MongoDB-[Version].

Goto MongoDB bin folder and you can find the below files init.

Install MongoDb bin folder

Setup MongoDB :

MongoDB requires a data directory to store the information, for this we need to create a folder with the name of data and give that folder path to MongoDB as part of the config file. Else we should create a data directory inside C:\ directory.

If we do not provide any configuration information, by default MongoDB searches the data folder in C:\ directory.

Creating mongo.config file :

mongo.config is a plain text file, it contains data folder path, logs path information and etc.

#Data File Path
dbpath=D:\Softwares\MongoDB-3.6.3\data

#Logs path
logpath=D:\Softwares\MongoDB-3.6.3\log\mongodb.log

Run MongoDB :

We can run the MongoDB server by running mongod.exe

D:\Softwares\MongoDB-3.6.3\bin>mongod --config D:\Softwares\MongoDB-3.6.3\mongod.conf

Now MongoDB server in listining mode. To use the databse and create documents, open another cmd prompt and run the mongo.exe

D:\Softwares\MongoDB-3.6.3\bin>mongo
MongoDB shell version v3.6.3
connecting to: mongodb://127.0.0.1:27017
MongoDB server version: 3.6.3
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
        http://docs.mongodb.org/
Questions? Try the support group
        http://groups.google.com/group/mongodb-user
Server has startup warnings:
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten]
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] ** WARNING: Access control is not enabled for the database.
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          Read and write access to data and configuration is unrestricted.
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten]
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] ** WARNING: This server is bound to localhost.
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          Remote systems will be unable to connect to this server.
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          Start the server with --bind_ip <address> to specify which IP
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          addresses it should serve responses from, or with --bind_ip_all to
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          bind to all interfaces. If this behavior is desired, start the
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten] **          server with --bind_ip 127.0.0.1 to disable this warning.
2018-03-07T09:33:41.405-0700 I CONTROL  [initandlisten]
2018-03-07T09:33:41.406-0700 I CONTROL  [initandlisten]
2018-03-07T09:33:41.406-0700 I CONTROL  [initandlisten] ** WARNING: The file system cache of this machine is configured to be greater than 40% of the total memory. This can lead to increased memory pressure and poor performance.
2018-03-07T09:33:41.406-0700 I CONTROL  [initandlisten] See http://dochub.mongodb.org/core/wt-windows-system-file-cache
2018-03-07T09:33:41.406-0700 I CONTROL  [initandlisten]
MongoDB Enterprise >

By executing the above command, you will be enter in to MongoDB’s shell like above.

MongoDB Databases :

Execute simple MongoDB commands to check.

MongoDB Enterprise > show dbs
admin   0.000GB
config  0.000GB
local   0.000GB

MongoDB gives us above 3 databases (admin,config,local) by default.

Reference :

Download MongoDB

MongoDB Installation Official

Happy Learning 🙂

Share a word.

Related Posts

Page load link

Don’t let AI Agents fail in production

Restack backend framework provides long-running workflows and infrastructure for reliable & accurate AI agents.

Get started with example agents

Research Paper

Agent accuracy benchmark

Many enterprises are exploring AI agents, but one issue blocks their adoption: keeping them accurate and on brand. General-purpose LLMs hit only 51% accuracy, while fine-tuned small agents reach 99.7%.

Agent accuracy benchmark

The trust in AI is eroding due to unreliable, poorly designed agents. For AI to reach its full potential, we need better ones. Restack helps you build agents that are reliable, scalable, and ready for real-world use.

Features

The Restack framework

Build reliable and accurate AI agents with Restack.

Simulate, time travel and replay AI agents

Developer UI

Simulate, time travel and replay AI agents

The Restack developer toolkit provides a UI to visualize and replay workflows or individual steps. Open a favourite IDE like VS Code or Cursor on one side and view workflows on the other to improve debugging and local development.

Get started in seconds

Start building with Restack AI framework and deploy with Restack Cloud.

Nowadays we can find that the popularity of Structured Query Language(SQL) is getting decreased and the NoSQL database programs are taking place of it. Discussing with NoSQL databases, the popular one MongoDB a cross-platform document-oriented database program. MongoDB stores the data as JSON like documents other than tables in SQL. It is much easier to install MongoDB on Linux/Mac platforms using terminal commands. But Windows is mostly based Graphical User Interface(GUI)  and we need to do most of the tasks using GUI.

1. Download the Installation File

We can download the latest version of the MongoDB community edition from the link below.

https://fastdl.mongodb.org/win32/mongodb-win32-x86_64-2008plus-ssl-4.0.5.zip

Note:-

With the above link, we can download the MongoDB 4.0.5 version. The latest version of MongoDB can be downloaded from the official website URL below.

https://www.mongodb.com/download-center/community

The link below will download a zip file. Just extract the zip file.

2. Paste the MongoDB Folder Inside C drive

Extract this zip file and paste the folder anywhere on your system. ( But Pasting this folder inside C drive will the better choice).

3. Create a Directory to Store Documents

Create a folder named data inside the same path we pasted the MongoDB folder (C drive) and create a folder named db inside it. Because the MongoDB stores the database as documents inside this db folder.

Path to the “db” directory

4. Running MongoDB

Running MongoDB in windows is easier. First, open the MongoDB folder and to /bin. We can see a mongod.exe file inside the directory.

MongoDB folder structure

MongoDB running…

5. Check the MongoDB is Running Fine

We can check that the MongoDB is running fine on our system with a browser tab. Just enter the address below and this will show a message “It looks like you are trying to access MongoDB over HTTP on the native driver port.”

http://localhost:27017

MongoDB running fine

6. Accessing the MongoDB Shell

We can access the MongoDB shell by opening the mongo.exe file inside the MongoDB directory.

MongoDB shell

Have a nice code !

Понравилась статья? Поделить с друзьями:
0 0 голоса
Рейтинг статьи
Подписаться
Уведомить о
guest

0 комментариев
Старые
Новые Популярные
Межтекстовые Отзывы
Посмотреть все комментарии
  • Как записать диска windows mac
  • Как отключить тайм аут экрана на windows 10
  • Windows who uses port
  • Как установить на рабочий стол установить картинку на рабочий стол windows 7
  • Увеличить размер ярлыков на рабочем столе windows