*[MongoDB URI Authentication](quick-start/environment-configuration/mongodb-configuration/mongodb-uri-authentication.md)
*[Passing extra options to the Mongo driver](quick-start/installing-and-updating/other-deployment-methods/manual-installation/extras/mongo-options.md)
*[Configure a replica set for MongoDB](quick-start/installing-and-updating/other-deployment-methods/manual-installation/extras/mongo-replicas.md)
*[Migrating database from Meteor built in MongoDB](quick-start/installing-and-updating/other-deployment-methods/manual-installation/extras/migrating-meteor-mongo.md)
The connection between Rocket.Chat and MongoDB instance is achieved using a [MongoDB Connection String URI](https://www.mongodb.com/docs/manual/reference/connection-string/). MongoDB authentication is done with the username and password.
Adding the following snippet in your `env` does the trick.
In your container, passing in `MONGO_URL` and `MONGO_OPLOG_URL` with the right values for connection.
{% hint style="info" %}
Depending on the password you're using, you might need to escape some characters, for example.. Please take a look at MongoDB documentation [https://docs.mongodb.com/manual/reference/connection-string/](https://docs.mongodb.com/manual/reference/connection-string/)
{% endhint %}
Your `docker-compose.yml` file should look like this