Report this

What is the reason for this report?

How do I connect to my droplets database (mongodb) from MongoDB Compass

Posted on February 6, 2019

Hi, I followed this tutorial on how to connect to your remote MongoDB server https://www.youtube.com/watch?v=5hsJE0R9n2E

I have been able to connect with the remote ip on my droplet, but not on mongodb compass.



This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Here’s how I made it work:

  1. In the “Connect to host” page, leave the first section as is (localhost, 28017…) as we will be connecting from “inside” the droplev (via the SSH Tunnel). Only change the port if you also changed it in your DO Mongo.

  2. Leave Authenthentication, Read Preference and SSL as they are, unless you have changed some of them inside your droplet. I believe these apply to the authentication of the databases, not your droplet.

  3. Set up the SSH Tunnel with either: 3a. Use Password (that’s what I did): Use your droplet’s IP as the hostname, port 22, and your command line username and password, or 3b. Use an identity File (I’m assuming this is like the key file setup you might use in Putty)

Connect.

The developer cloud

Scale up as you grow — whether you're running one virtual machine or ten thousand.

Get started for free

Sign up and get $200 in credit for your first 60 days with DigitalOcean.*

*This promotional offer applies to new accounts only.