Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to access a remote mongodb through Compass?

Tags:

mongodb

I'm trying to connect to a mongodb database remotely.

I have the following information:

  1. mongo DB on x.x.xxx.xxx
  2. Username: tempUser
  3. Password: tempPass
  4. Host: localhost
  5. port: 27017
  6. needed port forwarding in order to access the DB as port 27017 is not open.

I've already tried to connect from console but I fail.

Is there a way to connect from Compass while I forward the port?


1 Answers

When you want to connect to your instance from your workstation anywhere , ssh tunnelling is the way to go.

To use SSH Tunnel While creating a connection on MongoDB Compass , you need to choose it from the drop down box for the other text boxes to show up. Image for post The upcoming fields are pretty standard SSH information , nothing specific for MongoDB.

enter image description here

enter image description here

enter image description here

like image 160
Mohiuddin Khan Avatar answered Oct 23 '25 07:10

Mohiuddin Khan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!