How to setup my one-click mongoDB droplet to accept MONGO_URL connection from local meteor app (in development) with Windows7

I have create a one-click MongoDB Ubuntu 14.04 droplet and I want to be connected with this database from my local meteor application (which is in developing stage) bypassing the build-in mongo meteor db. I use Windows7 system in my local computer.

I need the mongo database to be in seperate droplet than meteor app for (future) flexibility and scalling. I need to build the database docs that meteor application will use from today (parallel with the meteor application development).

So far I have create the mongo droplet, enabled the ufw firewalls, and have make a batch commands file (“startMeteorInRemoteMongoURL.bat”) with the commands:

"SET MONGO_URL = mongodb://**user:password**@**dropletIP**/**database**"

I use the batch file to run my meteor application local and I get as meteor error:

"Error: failed to connect to [**dropletIP**:27017]"

Do someone know to explane me analytic who do I have to setup the mongoDB droplet so to be able to connect from my local meteor app with MONGO_URL string connection? I am nooby with Linux OS’s.

Thank you.

Submit an answer

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!

Sign In or Sign Up to Answer

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.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

By default, MongoDB will listen only on the localhost and not on your public IP. For this reason, applications running on a different server will not be able to connect to your MongoDB instance until you make some configuration changes.

For your meteor application you will likely need to allow a direct connection. This guide includes a section on this process. The key being to set your bind_address to something other than or localhost. Setting this to your droplet’s public IP will allow a connection.

Once you have made this change, any computer on the internet could attempt to connect to your MongoDB service and this could pose potential security issues so it’s strongly recommended that at the same time you set up a firewall like ufw or iptables to restrict access to your database server to just your local application’s IP address.