--- title: "Rocket Chat Additional MongoDB Driver Options" slug: "additional-mongodb-driver-options" description: "Configure additional MongoDB driver options for Rocket Chat. Enhance secure messaging, reliability, and scalability in your open source communication setup." updated: 2024-06-11T21:35:15Z published: 2024-06-11T21:35:15Z canonical: "docs.rocket.chat/additional-mongodb-driver-options" --- > ## Documentation Index > Fetch the complete documentation index at: https://docs.rocket.chat/llms.txt > Use this file to discover all available pages before exploring further. # Additional MongoDB Driver Options It's possible to provide extra [connection settings](http://mongodb.github.io/node-mongodb-native/3.5/reference/connecting/connection-settings/) to the Mongo driver that are not covered in the URI connection string. Set the the `MONGO_OPTIONS` environment variable to a JSON string. For example: ```plaintext # we need to pass the contents of PEMs, etc in a format compatible with JSON, so add '\n' to the end of each line. export TLS_CRT=$(cat /pems/tls.crt | awk '{printf "%s\\n",$0} END {print ""}') export PEM=$(cat /pems/mongo.pem | awk '{printf "%s\\n",$0} END {print ""}') export KEY=$(cat /pems/mongo.key | awk '{printf "%s\\n",$0} END {print ""}') # now insert all the credentials into the JSON OPTIONS string export MONGO_OPTIONS='{"sslCA":["'${TLS_CRT}'"],"sslCert":"'${PEM}'","sslKey":"'${KEY}'"}' ``` You might want to do this, for example, if you're backing Rocket.Chat with a TLS-secured Mongo [replica set](https://docs.mongodb.com/manual/replication/) and need to pass certificates/PEM files, etc. to connect to it. If you see the following error during startup: ```plaintext MongoTimeoutError: Server selection timed out after 10000 ms ``` You can try increasing server selection time by adding the following property to `MONGO_OPTIONS` to change the default value of `10000` to `20000`: ```plaintext MONGO_OPTIONS='{ "serverSelectionTimeoutMS": 20000 }' ```