You can use a configuration file to customize MongoDB Compass settings at startup. You cannot override any settings that have been set with a configuration file on the Compass interface.
Configuration File Location
For macOS and Linux, the configuration file is located at /etc/mongodb-compass.conf.
For Windows, the configuration file is located in the parent folder of your Compass executable. Consider the following examples based on which installer you used:
If you installed Compass as a
.exefile and your Compass installation is located inC:\Users\Administrator\AppData\Local\MongoDBCompass\app-1.47.1\MongoDBCompass, the configuration file is located inC:\Users\Administrator\AppData\Local\MongoDBCompass\app-1.47.1\mongodb-compass.cfg.Note
For installations that use the
.exeinstaller, the MongoDB Compass executable and configuration file paths include the version number.If you installed Compass as a
.msifile and your Compass installation is located inC:\Program Files\MongoDB Compass, the configuration file would be located atC:\Program Files\mongodb-compass.cfg.If you installed Compass as a
.zipfile, the configuration file is located in the parent folder of where you unzipped Compass.
Syntax
You can configure Compass configuration file settings in either EJSON or YAML format.
EJSON
{ "setting": value, "setting": value, ... }
YAML
setting option: value setting option: value ...
Settings
Setting | Definition | ||||
|---|---|---|---|---|---|
autoUpdates | Allow Compass to periodically check for new updates. | ||||
enableAtlasSignIn | Allow users to sign in to their Atlas account and access their clusters and data. Defaults to You can set this setting only in the configuration file. You can't set it from the Compass interface or the command line. | ||||
Allow Compass to use generative AI for natural language querying. | |||||
enableGenAISampleDocumentPassing | Allow MongoDB Compass to send sample field values with query and aggregation generation requests. These values can improve the results from the AI. If | ||||
Enable Chrome DevTools in Compass. To learn more, see Toggle Chrome DevTools. | |||||
enableMaps | Allow Compass to make requests to third-party mapping services. | ||||
Enable or disable the embedded MongoDB Shell on Compass. To learn more, see Disable the Embedded MongoDB Shell. | |||||
Assign connection option values for when you connect to your MongoDB deployment through Compass. These connection options cannot be overridden by connections from the Compass interface or a command line connection string. | |||||
ignoreAdditionalCommandLineFlags | Allow or disallow additional command-line option flags. | ||||
installURLHandlers | Register Compass as a handler for mongodb:// and mongodb+srv:// URLs. If Install Compass as URL Protocol Handler is enabled, you can open Compass by navigating to a mongodb:// or mongodb+srv:// URL in your Internet browser. Available on macOS and Windows. | ||||
maxTimeMS | Specify an upper time limit for all Compass database operations. | ||||
Prevent MongoDB Compass from performing outgoing network operations other than those to the database. | |||||
Sets all connection strings as read-only. Passwords in connection strings display as If | |||||
protectConnectionStringsForNewConnections | Sets connection strings for new connections as read-only by default. Passwords in new connection strings display as If | ||||
proxy | Enables you to specify or enforce the use of a proxy to connect to your deployment. For more information on connecting to your deployment with a proxy, see Proxy / SSH Tunnel Connection Tab. You must pass either a URL or the following format: If you set | ||||
Prevent users from performing write operations to your MongoDB deployment through Compass. To learn more, see Restrict Write Operations to MongoDB. | |||||
Show or hide the Kerberos password field on the Compass connection form. To learn more, see Display the Kerberos Password Field. | |||||
theme | Specify the MongoDB Compass UI theme. The supported themes are | ||||
trackUsageStatistics | Allow Compass to send anonymous usage statistics. To learn more, see Configure Telemetry Options. |
Note
To view all available Compass configuration options, run the following command in the folder containing your MongoDB Compass executable:
<path-to-Compass-executable> --help
Example
To view a sample Compass configuration file, run the following command:
<path-to-Compass-executable> --show-example-config
If you do not already have a configuration file, run the following command to create a configuration file that uses the sample configuration settings:
<path-to-Compass-executable> --show-example-config > /etc/mongodb-compass.conf