Create a MongoDB Atlas Account

MongoDB Atlas provides a managed MongoDB database service.

Follow these steps:

  1. Open MongoDB Atlas.
  2. Create an account or sign in.
  3. Create a project.
  4. Create a database deployment.
  5. Select an available free deployment option if suitable for your learning project.
  6. Choose a cloud provider and region.
  7. Create the deployment.
  8. Wait for the database deployment to become available.

The exact free-tier availability and deployment options may vary by region and current Atlas plans.

After creating the deployment, configure database access and network access before connecting from Node.js.

Local MongoDB Alternative

You can also use a locally installed MongoDB Community Server. The application code remains the same; only MONGODB_URI changes.

Key Takeaways
  • MongoDB Atlas provides managed database hosting.

  • Create a project and database deployment.

  • Configure database access before connecting.