How to setup a online Mongo-DB database using mLab.

Database can seem like magic at time in the fact that installing it can be a headache. Especially when most tutorials don’t go in depth at all about database. Most data storage happening in a json file.

So I’ll will demonstrate how to setup a mongodb database instance using mLab.

First go to the homepage.

And sign up

After that verify account, and go to dashboard.

The MongoDB Deployments section is where you can create new databases. Then press the create new button.

Pick the amazon and free option, and pick any area, doesn’t matter as long it is free, and amazon. Next Have your database named anything you like, but I will be naming e-commerce-database, and latest version of mongo.

After that is will say it is order, but it’s free, you shouldn’t have to provide credit card information.

It will show the database created, click the database link, and go to the database page. And click users, and setup your user. Don’t copy and paste the connection string before creating a user.

Then create your user which can manipulate and access to the database.

You can name your user anything you want, and password.

Now you can copy and paste your connection string with your create user and password.

That’s it your mlab mongodb database is setup, now you can paste it to your .env file if working with node.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store