DEV Community

Cover image for MongoDB Error: couldn’t connect to server 127.0.0.1:27017 on Windows
Shrikant Dhayje
Shrikant Dhayje

Posted on • Originally published at codewithshriekdj.netlify.app on

MongoDB Error: couldn’t connect to server 127.0.0.1:27017 on Windows

Problem

Error: couldn’t connect to server 127.0.0.1:27017 for MongoDB on Windows

This problem can occur if you install MongoDB without selecting the install as a service option or if you disable its auto start on startup.

MongoDB Error: couldn't connect to server 127.0.0.1:27017 on Windows


Details

MongoDB made multiple projects to install, so it's confusing to install it for Windows users who only like to install programs via Installer. And this issue also occurs if you install the MongoDB server in the wrong manner.

Safest Installer But bigger in file size and app size installer is at MongoDB Community Server Download or


First Solution

For localhost or 127.0.0.1.

Search for Services in start search bar of windows and Start the Service named MongoDB or MongoDB Server (MongoDB) by Right Clicking and Clicking Start.

Trying to Start MongoDB Service in Windows Services App


Second Solution

This is also for `localhosted

Install the appropriate MongoDB Stack or the more sophisticated MongoDB Community Server, the link to which I have given above. Either reinstall the complete software packages, such as MongoDB Compass and Mongosh Shell (MongoDB Shell (Mongosh) is distinct from Atlas Shell).


Third Solution

Use Third Party or Opensource Admin Panel of MongoDB. I am not promoting any software at all and can't list all but these are some which are mostly free software to use.

  • Appsmith ( Opensource Easiest if using docker under Linux Container)
  • Retool ( Proprietary with Free Trial )
  • UI Bakery
  • Budibase
  • Tooljet ( Opensource, but does not automatically adds field name for table columns )

bye 👋.

Top comments (0)