Deploy MongoDB


MongoDB is a popular, scalable, NoSQL database used by millions of developers. You can run your own MongoDB instance as a private service on Render backed by SSD disks which have automatic snapshots.

We’ll be deploying MongoDB using the latest official Docker image. Let’s get started.

Deployment

  1. Create a new Private Service on Render and enter in github.com/docker-library/mongo.
  2. Choose Docker for the Environment.
  3. Under Advanced, add a disk with the following values:
Namedb
Mount Path/data/db
Size10 GB or as appropriate
  1. Also under Advanced, enter the following for Docker settings:
Docker Build Context Directory./4.2
Dockerfile Path./4.2/Dockerfile

Note: the 4.2 refers to the MongoDB version. As of writing, version 3.6 and 4.0 are also available.

You’re all set! Save your private service and your MongoDB instance should be up in a few minutes. You should be able to connect to it using the host:port displayed. It should look like mongo-xyz:27017.


You can use the shell in your dashboard to connect to your database.

$ mongo --host mongo-xyz
MongoDB shell version v4.2.5
connecting to: mongodb://mongo:27017/?compressors=disabled&gssapiServiceName=mongodb
Implicit session: session { "id" : UUID("fa107900-87db-4819-907c-99669a1cbec8") }
MongoDB server version: 4.2.5
Welcome to the MongoDB shell.
For interactive help, type "help".
For more comprehensive documentation, see
	http://docs.mongodb.org/
Questions? Try the support group
	http://groups.google.com/group/mongodb-user