user315648 user315648 - 2 months ago 26
Linux Question

Getting MongoDB on Linux to listen to remote connections

I've successfully installed MongoDB on Windows (on a local machine) as a service, but now I want to move MongoDb to a separate server. So I extracted the tarball to a virtual server on network (running linux).

When I connected to the server ("testmongoserver") using PuTTY from my local machine, I started the mongod server and it told me that it was listening to the default 28017 port. The mongo console is also working and allowed me to create a new database (testdb) and add users to it.

However, I could not access the server from remote. When I type "testmongoserver:28017" it doesn't open the HTTP console as "localhost:28017" on my local machine does. I also can't connect using official drivers and providing a connectionstring.

What are the neccesarry steps to install MongoDB on Linux, so that I could access it from a remote machine with a connectionstring and use its HTTP console via testmongoserver:28017


  1. Run netstat -a on mongo server and check a port.
  2. Check DNS settings and check that linux server allows external connections.
  3. Check that mongodb can accept external/remote connection.

Default port for mongo is 27017. 28017 - port for webstats.