Introduction

MongoDB is a flexiable & sca scalable NoSQL database, which makes it perfect for businesses of all sizes. It works with UNIX-like systems and macOS, and also on Windows systems. Installing MongoDB on Windows application is a little bit tricky task. But, this step-by-step tutorial explains how to install and configure the MongoDB on your PC.

Prerequisites

  • Minimum requirement for the Windows architecture is a 64-bit server, Windows 7 or Windows 8 or later Windows Server version.
  • Free space to accommodate the databases, data collections, and MongoDB server.
  • The MongoDB Server – Download

  • Visit the MongoDB Download Center to download the MongoDB Server

    Gei it here

  • Make sure that you are on the “Server” download page.
  • Under “Select Version” section, please choose the “(current release)” option.
  • Under “OS”section, select “Windows 64-bit x 64”.
  • Next choose the “https:” address which contains “msi” is at the end of the address.
  • Download it
  • Use the Setup Wizard

  • Go to where the download is located and launch the 'msi' installer by double-clicking on it.
  • Follow the steps to finish the setup MongoDB Windows.
  • Choose the kind of installation you need

    you can choose either a Complete installation to install all the features. This is the recommended option. Alternatively, you can choose a Custom installation. It’s the option where you can pick the features you want to install. If you’re unsure, try with the Complete option.

    Configure MongoDB Service

  • To simplify the MongoDB setup, when it comes to the Service Configuration page it will ask you to choose either “Run the service as Network Service user” or “Run service as a local or domain user.”
  • Next, select the directory for the MongoDB databases.
  • Store MongoDB databases

    To store the MongoDB databases, you need a folder in C:\Drive which name should be data and then again create new folder within it name should be db

    Make 'mongod' Alias Shortcuts

    We use Hyper Terminal to Make mongod Alias Shortcuts.
    Git Bash is the default shell application to use to access the Hyper Terminal.
  • Make the directory “home” in Hyper Terminal. Enter cd~ to do that.
    1
    cd ~
  • Check if you see the .bash_profile. If it isn’t there, create one with the command touch.
    1
    touch .bash_profile
  • Go to the .bash_profile again in the Hyper Terminal and right-click and select “Paste” or do a CTRL+P to paste the MongoDB installation’s entire path in an instance of the .bash_profile.
    1
    2
    alias mongod="/c/Program\ files/MongoDB/Server/4.4/bin/mongod.exe"
    alias mongo="/c/Program\ Files/MongoDB/Server/4.4/bin/mongo.exe"
  • Restart the MongoDB Service

    You’ve successfully created the alias path, now it’s time to restart the service. Restart your Gitbash & just type
    1
    mongo --version

    Conclusion

    In this tutorial, you learned about installing MongoDB Windows. You used the Git BASH Hyper Terminal to put MongoDB successfully on your Windows server. During the process, you set up alias shortcuts and verified the correct version of MongoDB on your system. It’s important to configure things the right way, otherwise, it won’t work, not even a little bit.