MongoDB Setup - 2
Tags: mongodb, webdev, tutorial, productivity
Published: 2022-06-26 13:47:49

Hello guyz today i am going to show you the second tutorial of the Series of MERN CRUD and in this tutorial i am going to show how to setup mongo db atlas.

## Also check out the first tutorial where i show how to setup the MERN App folder structure and modules, then come back here to continue.
https://dev.to/shubhamtiwari909/mern-crud-setup-148a

Lets get started...

* First download mongo db from the link below
https://www.mongodb.com/try/download/community

Scroll down a little bit and You will see a download option at right side where you can choose version and OS.

* After installing mongo db , open mongo db atlas from link below

https://www.mongodb.com/cloud/atlas/lp/try2-in?utm_source=google&utm_campaign=gs_apac_india_search_core_brand_atlas_desktop&utm_term=mongodb&utm_medium=cpc_paid_search&utm_ad=e&utm_ad_campaign_id=12212624347&adgroup=115749713423&gclid=CjwKCAjwh-CVBhB8EiwAjFEPGTUfIZDiTkCVAbcWgmeWObYmq3E323YrKoARzatNFufKKoQryPn3sBoCtRYQAvD_BwE

* After signing in , you will see an interface like in the image below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pqk5rm30htg2nbflmer8.png)
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/hygxiux6z3mn26uplopr.png)

* Fill all the fields and click finish.

* Then in the next section choose the free server option

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/xbel50uu7s65s60e2m0l.png)

* Then scroll down in next section and click "create cluster".

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ikxs9z0vxhpas2z0ighx.png) 

* Then choose a username and password for your account and click "create user"
NOTE - COPY THIS USERNAME AND PASSWORD SOMEWHERE BECAUSE YOU ARE GOING TO NEED IT LATER.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/3cmrdpli4lly5rdz1r2o.png)

* Then click on left top button named "Project 0" and click new project

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wdak7era07yhiid7400k.jpg)

* Then enter the project name and click "next"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ojymo28czbax9aow8r7k.png)

* Then click "create project"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/bpyj88jbfg78hwd5lew5.png)

* Then click "Build a Database" and choose the free server again and click create

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/srd7zz8rgsasegk2e4g0.png)

* Then wait for few minutes to get your database ready

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/n0i5ktje8046snm3bvsp.png)

* Then Click on "Browse Collections" and click on "Add my own data"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0nwbhac0pn4re2a5o8ra.png)

* Enter database name and collection name , here collection is similar to Table in MySQL.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/u45f6ju63u2amrq2rojr.png)

* Then click on the Project name as shown in the Image below

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/lgzkc9m0gts8182h2oph.jpg)

* Then Click on connect 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jf89y8gz8wrioylbvygm.jpg)

* Then enter your username and password which you have created in the beggining and click "create database user"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/7h4crh1zqzitq1kltfa5.jpg)

* Then click choose a connection method

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/jqij0sxzogpmk9uiybig.jpg)

* Click on second option "Connect your Application"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gyikkquhmaaqdhrz7if3.png)

* Then copy the link , you can see the link in the image highlighted with blue background , copy only that portion


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/9m0o23yfsq7fpb5q6kqb.png)

## NOTE - SAVE THIS LINK SOMEWHERE BECAUSE IT WILL BE USED FOR ESTABLISHING THE CONNECTION IN EXPRESS SERVER IN NODE JS.


* Then click on "Network Security" which is on left side in the navigation links

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/c2qx30s3hmqna208pqdx.jpg)

* Click on "Add IP Address"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/llfzew3sklhy63pmc6jz.png)

* Click on "Allow Access From Everywhere"

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ziglaggk0zguva4a8rbr.png)

That's it , your mongo db atlas is setup and you can use the database by connecting it to the Node js Server using Express which we will cover in the next Blog 

Thats it for this post, i will continue this series in the next blog where i will teach you how to connect the mongo db in Express JS and Also Create a Model/Schema for the "user" Collection.
THANK YOU FOR READING THIS POST AND IF YOU FIND ANY MISTAKE OR WANTS TO GIVE ANY SUGGESTION , PLEASE MENTION IT IN THE COMMENT SECTION.
^^You can help me by some donation at the link below Thank you👇👇 ^^
☕ --> https://www.buymeacoffee.com/waaduheck <--

Also check these posts as well
https://dev.to/shubhamtiwari909/react-hooks-usecontext-1ml2

https://dev.to/shubhamtiwari909/redux-combinereducers-mk0

https://dev.to/shubhamtiwari909/introduction-to-tailwind-best-css-framework-1gdj