How can I connect Robomongo (or any other mongodb client) to the mongodb instance that is created by my local Meteor application?
-
Hi @user3330705 if you think the answer is more than useful and that it actually is complete/best, then you can mark it as the accepted answer so that people reading this post will know that it works. – Serkan Durusoy Feb 25 '14 at 16:58
-
possible duplicate of [How is MongoDb installed by Meteor?](http://stackoverflow.com/questions/14371926/how-is-mongodb-installed-by-meteor) – BuZZ-dEE Apr 13 '15 at 19:50
-
I'm on OS X, used robomongo: I just used `localhost` and port `3001` without any authentication for connecting. – Aditya M P Dec 01 '15 at 10:56
8 Answers
Ensure Meteor is running on localhost. Open a terminal window and run meteor
command. It will start running on localhost:3000 if you have not changed to port.
While it is running, open a separate terminal window and run meteor mongo
command. This will open up a MongoDB shell and tell you what port it is connecting to This is normally 3001 as of version 0.7.1.1 or 3002 if earlier. It will say something like 127.0.0.1:3001/meteor
Go to Robomongo (or your favorite mongodb client software) and create a new connection, making sure to change the connection address to localhost and the given the port number. No need to additionally define /meteor if your client does not insist on a default database.
Also as pointed out in https://stackoverflow.com/a/22023284/1064151 some drivers may need specific line endings, delimeters or other character flow. For example, ObjCMongoDB a C based driver wants the url to be 127.0.0.1:3001/
with that extra /
at the end, or it won't work. So make sure you check the documentation for your driver/client.

- 1
- 1

- 5,447
- 2
- 20
- 39
-
Im trying the same thing. Im using a mongoDB driver to write to my meteor mongoDB. Before I used `127.0.0.1:3002` like you were saying above. Now I understand that the port has shifted to `:3001` but that address is still not working for me. Did the database name also change? To be more clear, once I connected to my local host `127.0.0.1:3002` I also needed my database name, ie `meteor.collection`. Did this also change with the update? – Nate Feb 25 '14 at 18:23
-
1
-
1@Nate I just updated the answer to reflect that information. Thanks for the pointer. – Serkan Durusoy Feb 25 '14 at 18:53
-
It is nice to know about ObjCMongodb and For Robomongo client, It is not necessary to give `/`, I think 3001 is enough , i tested it and it is working fine for me – Sasikanth Feb 25 '14 at 18:57
-
This has not worked for me. I am on Windows using Robomongo. My Hosts file contains 192.168.56.111 my-vm and I can connect to my meteor app using http://my-vm:3000, so I know the app is running. When I try to connect using my-vm:3001 it cannot establish a connection - any ideas? – JoeTidee Aug 24 '14 at 18:27
-
Does your vm grant access on port 3001? A VM situation is certainly more complicated than a typical local installation. – Serkan Durusoy Aug 24 '14 at 18:50
-
If you open RoboMongo on a Mac and don't see anything after connecting, click View => Explorer and then you'll be able to browse connections on the left panel. – Elijah Lofgren Aug 20 '15 at 03:19
Easiest way to get the current configuration details is to use the following command
meteor mongo -U
This will give you the connection string

- 9,683
- 3
- 51
- 41
From terminal run following command
meteor mongo -U
That will show you the local host IP address and in which port you application is running. Now run the Robomongo and configure as following two field as you got by running the previous command

- 30,459
- 8
- 42
- 54
Use SSH tunneling by the following command :
ssh -L 3001:localhost:3001 user-name@host
It forwards connections from your local port 3001 to localhost:3001 on your server. Now we can simply connect to our database.
Create a Robomongo connection on your localhost and hit Test (Out of two checks, Authentication may fail) :

- 1,468
- 2
- 23
- 33
I'm using ObjCMongoDB, a C based mongoDB driver. With the new update instead of using the previous 127.0.0.1:3002
to connect to my localhost running meteor's mongodb, I now need to use 127.0.0.1:3001/
with the collection name still being meteor.collection
. The important change is the port from :3002
to :3001/
. Remember the /
, it is critical for the connection.

- 1,875
- 15
- 27
This worked for me,Before connecting make sure meteor is running. I am using Robomongo to connect. Create new connection and add Address as : localhost; port as: 3001

- 2,591
- 3
- 25
- 29
I'm too using Robomongo and before the latest update V0.7.1,i used port 3002 to connect,as @Serkan Durusoy suggest's for the latest update it is working for 3001 port

- 3,045
- 1
- 22
- 45
@imal365 answer is perfect. Just to add my insight on it:
I realized that the default Meteor Mongo port number is the port number of the application with 1 added to it (as of version 0.7.1.1). In my case, I was running Meteor on port 1337
with the command meteor --port 1337
and my Meteor Mongo port was 1338
.

- 1,582
- 2
- 15
- 17