javascript mongodb next js npm packages

How To Install MongoDB on Windows

MongoDB is an excellent choice for a NoSQL database, with great features MongoDB also gives comfortability hosting like MongoDB atlas which is a cloud service from MongoDB company that we can use to develop our applications. We don’t have to worry about setting up MongoDB ourselves. However, if we want to set it up ourselves Mongodb provides a community edition server for a self-hosted solution with almost all the features of Mongodb atlas.

In this tutorial we’ll see how we can set up MongoDB on our Windows computer, but before starting the instructions you need to know about these tools related to the MongoDB environment.

  1. MongoDB community sever: Server for local setup of MongoDB
  2. MongoDB compass: A graphical user interface ( GUI ) for managing MongoDB visually.
  3. MongoSH: A command line tool for MongoDB

Well, see how to set up and use each of these tools on our Windows computer.

Step 1: Download MongoDB

To install MongoDB we need to download MongoDB from the MongoDB website.

Just search for MongoDB community server on the internet and you will find the download page,

or just navigate to the www.mongodb.com and hover your cursor on products, and in the community edition section you will find the community server option, just click on that link and you will reach to the download page of MongoDB community server.

Or you can click on this link to reach the download page.

Once you have reached the page and scroll a little bit down, you will find something like this.

On the above page, you can see we can select a specific version of MongoDB we want to download and as we are doing it on Windows we have to select Windows in the platform.

We have two options for downloading MongoDB 1. MSI file, 2. Zip file Currently we are going to use MSI installer to install MongoDB.

After everything is selected correctly just click on the Download button and the download will be started, file size will be around 572 MB so you have to wait for some time based on your internet connection.

Step 2: Installing MongoDB

Once the download has been completed we can initiate the installation process by double-clicking on the MSI file,

Step 3: After double-clicking the installer this window will appear just click on the Next.

Step 4: Now accept the terms and conditions by checking the “✅ I accept the terms in the license Agreement” and click on Next to continue the process.

image not found

Step 5: Now here you can choose the setup type either complete or custom.

  1. Complete: All the features will be installed.
  2. You can choose the features to install.

Here I am going with the complete setup as I might need all the features of Mongodb.

Step 6: Here we are setting monodb as service, if you want your database to be available on your network then Select “Run service as Network service user” and click on Next.

If You Installed MongoDB as a Windows Service The MongoDB service starts upon successful installation.

Step 7: Now if you also want to install MongoDB compass ( GUI for MongoDB ) then first check the option “✅ Install MongoDB compass” and click on Next.

Step 8: Now just click on Install to start the installation process.

image not found

Step 9: This may take some time so be patient.

Step 10: After a few minutes this window will appear, which means MongoDB compass is being installed.

Step 11: Shortly after the Mongodb compass is installed this window will appear, which is basically the MongoDB compass application.

Step 12: While in the installation wizard, you will see these windows, and now that everything has been installed just click on Finish to finish the installation process.

Now we have successfully installed MongoDB and MongoDB compass on our Windows computer,

These are the facts that you need to know after this

  1. While installing MongoDB installation wizard should add the MongoDB path in our Environment variables path if it is not then you can manually do it by copying the installation path of Mongodb and pasting it into the path in environment variables.
  2. As we MongoDB as a service in Step 6, it will automatically start the Mongod server when we start our computer.

We have installed mongodb compass to manipulate database visually but mongodb also has a command line tool for managing database ie. MongSH or MongoDB shell.

MongoSH – MongoDB Shell

The MongoDB Shell, mongosh, is a JavaScript and Node.js REPL environment for interacting with MongoDB deployments in Atlas, locally, or on another remote host.

To install MongoSH follow steps on this offical guide.

Conclusion

You have installed MongoDB, MongoSH for command-line and MongoDB compass for GUI access to the mongodb database now you can try to run some mongodb commands to test it out or build applicatons with it.

Happy coding 🙂

Related Posts

How To Install and Use Flowbite in Next js

Flowbite is an open-source library of UI components based on the utility-first Tailwind CSS framework featuring dark mode support, a Figma design system, templates, and more. It provides…

Using Notistack in Nextjs | React js

Showing toast messages in react apps is a common feature to add, as it’s one of the quickest ways to give feedback to users. There are many toast…

Using React Feather Icons in Next js

Feather Icons is a collection of sleek and beautiful icons that you can use in your projects in different ways and integrate seamlessly with React-based applications. To use…

find unused npm packages

Find and Remove Unused NPM Packages from Your Project

While building apps in an NPM environment it’s easy to accumulate lots of NPM packages in our app that we don’t even need, these package slows down our…

Using Bootstrap Icons in Next js | React

Bootstrap Icons is a Free, high-quality, open-source icon library with over 2,000 icons. You can use them as you like SVGs, SVG sprite, or web fonts. We can…

lucide icons

Using Lucide React Icons in Nextjs | React js

Lucide offers a sleek and versatile icon library that seamlessly integrates with your Next.js or React applications. Let’s explore how to leverage Lucide for beautiful, customizable icons: Lucide…

Leave a Reply

Your email address will not be published. Required fields are marked *