Connecting to remote MongoDB sessions

I’m using Meteor up to deploy my Meteor application to a AWS instance.

I currently use Robomongo to lightly ‘manage’ my local Meteor MongoDB instance. How can I use this tool or one similar to connect to the Meteor MongoDB instance running on AWS from my local development box?

Also, I am able to ‘manage’ the MongoDB instance now by connecting via SSH and using the mongo tool from the command line, but what I’m looking for is a GUI tool.

1 Like

Currently the MongoDB server is only bind to the localhost of the server. So, you can’t connect to it from outside. That’s due to an security issue. But there is a way to connect to that.

First you need to create SSH tunnel to the server’s MongoDB server.

sudo ssh -L 29017:localhost:27017 root@ip

Then use RoboMongo or something to connect to following MongoDB server info

MongoDB server: localhost
MongoDB port: 29017
DB name: your app name in mup

I didn’t test this, but it should work.

2 Likes

Thanks! I’ll give this a try.

I tried to connect via RoboMongo’s Connection settings like so:

Where ‘aws_server_name’ is the same name I use in the mup.json file to deploy. I actually tried using the Public DNS here too, but that did work. I tried the ‘27017’ and ‘29017’ ports too.

on the SSH page I tried the following:

but none of the combinations in terms of port or SSH Address I tried worked.

For the robo mongo tunneling, use port 22 as the port.
and for the connection, use localhost as the host and 27017 as the port.

It should work then.

1 Like

That did the trick! Thank you!

Now, how can I connect to a mongo instance of an application deployed with mup through apollo server. So I have two applications running on different servers. I want application A to connect to the mongo instance of application B running on a different server. Works find if both applications are working on the same server.