Website
Community
Developer
Free Trial
Search…
Rocket.Chat Documentation
Getting Support
Development Docs
Quick Start
Deploying Rocket.Chat
Scaling Rocket.Chat
Accessing Your Workspace
Installing Client Apps
Upgrading Rocket.Chat
Environment Configuration
Node Configuration
MongoDB Configuration
MongoDB URI Authentication
Passing extra options to the Mongo driver
Configure a replica set for MongoDB
Migrating database from Meteor built in MongoDB
MongoDB mmap to wiredTiger migration
Supported Mongo Versions
Firewall Configuration
Extras
Configuring SSL Reverse Proxy
Environment Variables
Guides
User Guides
Administration
Omnichannel
Message Auditing Panel
Message Auditing Log
Rocket.Chat Call Center
App Guides
Mobile Guides
Roles in Rocket.Chat
Security and Compliance Guides
Brand and Visual Guidelines
Enterprise Edition Trial
Rocket.Chat SaaS
Cloud Account
Resources
Frequently Asked Questions
Contributors
How can I help?
Contributor Code of Conduct
Google Summer of Code
Google Season of Docs
Github Sponsorship
Legal
Terms of Service
Master Services Agreement for Self Managed Workspaces
Master Service Agreement for Professional Services
Privacy Policy
Privacy Policy Facebook Messenger
Code of Conduct for our services
GDPR
Censorship and Harmful Content
Guidelines for Law Enforcement
Server Lookup
DMCA Policy
Powered By
GitBook
MongoDB URI Authentication
The connection between Rocket.Chat and MongoDB instance is achieved using a
MongoDB Connection String URI
. MongoDB authentication is done with the username and password.
Adding the following snippet in your
env
does the trick.
1
MONGO_URL=mongodb://[username:
[email protected]
]host1[:port1][,...hostN[:portN]][/[defaultauthdb][?options]]
Copied!
In your container, passing in
MONGO_URL
and
MONGO_OPLOG_URL
with the right values for connection.
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/
​
Your
docker-compose.yml
file should look like this
1
environment:
2
- "MONGO_URL=mongodb://rctestuser:
[email protected]
:27017/rocketchat?authSource=admin"
3
- "MONGO_OPLOG_URL=mongodb://rctestuser:
[email protected]
:27017/local?authSource=admin"
Copied!
If using
docker run
, it should look like this:
1
docker run \ -e "MONGO_URL=mongodb://rctestuser:
[email protected]
:27017/rocketchat?authSource=admin" \
2
-e "MONGO_OPLOG_URL=mongodb://rctestuser:
[email protected]
:27017/local?authSource=admin" \
3
rocketchat/rocket.chat:X.X.X
Copied!
​
Previous
MongoDB Configuration
Next
Passing extra options to the Mongo driver
Last modified
2mo ago
Export as PDF
Copy link