Back to Mattermost

Environment configuration settings

docs/main/administration-guide/configure/environment-configuration-settings.mdx

11.10.0191.5 KB
Original Source

import Tabs from '@theme/Tabs'; import TabItem from '@theme/TabItem';

import Inc0_push_notification_server_configuration_settings from './push-notification-server-configuration-settings.mdx'; import Inc1_rate_limiting_configuration_settings from './rate-limiting-configuration-settings.mdx';

<PlanAvailability slug="all-commercial" />

Review and manage the following environmental configuration options in the System Console by selecting the Product menu, selecting System Console, and then selecting Environment:

<Tip>

System admins managing a self-hosted Mattermost deployment can edit the config.json file as described in the following tables. Each configuration value below includes a JSON path to access the value programmatically in the config.json file using a JSON-aware tool. For example, the SiteURL value is under ServiceSettings.

  • If using a tool such as jq, you'd enter: cat config/config.json | jq '.ServiceSettings.SiteURL'
  • When working with the config.json file manually, look for an object such as ServiceSettings, then within that object, find the key SiteURL.
</Tip>

Web server

With self-hosted deployments, you can configure the network environment in which Mattermost is deployed by going to System Console > Environment > Web Server, or by updating the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Site URL

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>The URL that users use to access Mattermost. The port number is required if it’s not a standard port, such as 80 or 443. This field is required.</p><p>Select the <strong>Test Live URL</strong> button in the System Console to validate the Site URL.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SiteURL</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SITEURL</code></li></ul></td> </tr> </tbody> </table> <Note>
  • The URL may contain a subpath, such as https://example.com/company/mattermost.
  • If you change the Site URL value, log out of the Desktop App, and sign back in using the new domain.
  • If Site URL is not set:
    • Email notifications will contain broken links, and email batching will not work.
    • Authentication via OAuth 2.0, including GitLab, Google, and Entra ID, will fail.
    • Plugins may not work as expected.
</Note>

Maximum URL length

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>The longest URL, in characters, including query parameters, accepted by the Mattermost server. Longer URLs are rejected, and API calls fail with an error.</p><p>Numeric value. Default is <strong>2048</strong> characters.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>MaximumURLLength</code> &gt; <code>2048</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_MAXIMUMURLLENGTH</code></li></ul></td> </tr> </tbody> </table>

Web server listen address

<table> <colgroup> <col style={{width: '48%'}} /> <col style={{width: '51%'}} /> </colgroup> <tbody> <tr> <td><p>The address and port to which to bind and listen. Specifying <code>:8065</code> will bind to all network interfaces. Specifying <code>127.0.0.1:8065</code> will only bind to the network interface having that IP address.</p><p>If you choose a port of a lower level (called “system ports” or “well-known ports”, in the range of 0-1023), you must have permissions to bind to that port.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ListenAddress</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_LISTENADDRESS</code></li></ul></td> </tr> </tbody> </table> <Note>

Web server uses address:port (e.g., ":8065"), while Metrics uses a port number only (e.g., 8067).

</Note>

Forward port 80 to 443

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>Forward insecure traffic from port 80 to port 443.</p><ul><li><strong>true</strong>: Forwards all insecure traffic from port 80 to secure port 443.</li><li><strong>false</strong>: <strong>(Default)</strong> When using a proxy such as NGINX in front of Mattermost this setting is unnecessary and should be set to false.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>Forward80To443</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_FORWARD80TO443</code></li></ul></td> </tr> </tbody> </table>

Web server connection security

<table> <colgroup> <col style={{width: '49%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>Connection security between Mattermost clients and the server.</p><ul><li><strong>Not specified</strong>: Mattermost will connect over an unsecure connection.</li><li><strong>TLS</strong>: Encrypts the communication between Mattermost clients and your server.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ConnectionSecurity</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_CONNECTIONSECURITY</code></li></ul></td> </tr> </tbody> </table>

See the setting up TLS for Mattermost for details.

TLS certificate file

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>The path to the certificate file to use for TLS connection security.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSCertFile</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSCERTFILE</code></li></ul></td> </tr> </tbody> </table>

TLS key file

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The path to the TLS key file to use for TLS connection security.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSKeyFile</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSKEYFILE</code></li></ul></td> </tr> </tbody> </table>

Use Let's Encrypt

<table> <colgroup> <col style={{width: '48%'}} /> <col style={{width: '51%'}} /> </colgroup> <tbody> <tr> <td><p>Enable the automatic retrieval of certificates from Let’s Encrypt.</p><ul><li><strong>true</strong>: The certificate will be retrieved when a client attempts to connect from a new domain. This will work with multiple domains.</li><li><strong>false</strong>: <strong>(Default)</strong> Manual certificate specification based on the TLS Certificate File and TLS Key File specified above.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>UseLetsEncrypt</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_USELETSENCRYPT</code></li></ul></td> </tr> </tbody> </table>

See the setting up TLS for Mattermost for details on setting up Let's Encrypt.

Let's Encrypt certificate cache file

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>The path to the file where certificates and other data about the Let’s Encrypt service will be stored.</p><p>File path input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>LetsEncryptCertificateCacheFile</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_LETSENCRYPTCERTIFICATECACHEFILE</code></li></ul></td> </tr> </tbody> </table>

Read timeout

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Maximum time allowed from when the connection is accepted to when the request body is fully read.</p><p>Numerical input in seconds. Default is <strong>300</strong> seconds.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ReadTimeout</code> &gt; <code>300</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_READTIMEOUT</code></li></ul></td> </tr> </tbody> </table>

Write timeout

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><ul><li>If using HTTP (insecure), this is the maximum time allowed from the end of reading the request headers until the response is written.</li><li>If using HTTPS, it's the total time from when the connection is accepted until the response is written.</li></ul><p>Numerical input in seconds. Default is <strong>300</strong> seconds.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>WriteTimeout</code> &gt; <code>300</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_WRITETIMEOUT</code></li></ul></td> </tr> </tbody> </table>

Idle timeout

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Set an explicit idle timeout in the HTTP server. This is the maximum time allowed before an idle connection is disconnected.</p><p>Numerical input in seconds. Default is <strong>300</strong> seconds.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>IdleTimeout</code> &gt; <code>300</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_IDLETIMEOUT</code></li></ul></td> </tr> </tbody> </table>

Webserver mode

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>We recommend gzip to improve performance unless your environment has specific restrictions, such as a web proxy that distributes gzip files poorly.</p><ul><li><strong>gzip</strong>: <strong>(Default)</strong> The Mattermost server will serve static files compressed with gzip to improve performance. gzip compression applies to the HTML, CSS, Javascript, and other static content files that make up the Mattermost web client.</li><li><strong>Uncompressed</strong>: The Mattermost server will serve static files uncompressed.</li><li><strong>Disabled</strong>: The Mattermost server will not serve static files.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>WebserverMode</code> &gt; <code>"gzip"</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_WEBSERVERMODE</code></li></ul></td> </tr> </tbody> </table>

Enable insecure outgoing connections

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to allow insecure outgoing connections.</p><ul><li><strong>true</strong>: Outgoing HTTPS requests, including S3 clients, can accept unverified, self-signed certificates. For example, outgoing webhooks to a server with a self-signed TLS certificate, using any domain, will be allowed, and will skip TLS verification.</li><li><strong>false</strong>: <strong>(Default)</strong> Only secure HTTPS requests are allowed.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableInsecureOutgoingConnections</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLEINSECUREOUTGOINGCONNECTIONS</code></li></ul></td> </tr> </tbody> </table> <Warning>

Enabling this feature makes these connections susceptible to man-in-the-middle attacks.

</Warning>

Managed resource paths

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>A comma-separated list of paths within the Mattermost domain that are managed by a third party service instead of Mattermost itself.</p><p>Links to these paths will be opened in a new tab/window by Mattermost apps.</p><p>For example, if Mattermost is running on <code>https://mymattermost.com</code>, setting this to conference will cause links such as <code>https://mymattermost.com/conference</code> to open in a new window.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ManagedResourcePaths</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_MANAGEDRESOURCEPATHS</code></li></ul></td> </tr> </tbody> </table> <Note>

When using the Mattermost Desktop App, additional configuration is required to open the link within the Desktop App instead of in a browser. See the desktop managed resources documentation for details.

</Note>

Reload configuration from disk

<PlanAvailability slug="ent-plus" /> <table> <colgroup> <col style={{width: '47%'}} /> <col style={{width: '52%'}} /> </colgroup> <tbody> <tr> <td><p>You must change the database line in the <code>config.json</code> file, and then reload configuration to fail over without taking the server down.</p><p>Select the <strong>Reload configuration from disk</strong> button in the System Console after changing your database configuration. Then, go to <strong>Environment &gt; Database</strong> and select <strong>Recycle Database Connections</strong> to complete the reload.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table>

Purge all caches

<table> <colgroup> <col style={{width: '47%'}} /> <col style={{width: '52%'}} /> </colgroup> <tbody> <tr> <td><p>Purge all in-memory caches for sessions, accounts, and channels.</p><p>Select the <strong>Purge All Caches</strong> button in the System Console to purge all caches.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Web Server</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <Note>

Purging the caches may adversely impact performance. high availability cluster-based deployments will attempt to purge all the servers in the cluster.

</Note>

Websocket URL

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>You can configure the server to instruct clients on where they should try to connect websockets to.</p><p>String input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>WebsocketURL</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_WEBSOCKETURL</code></li></ul></td> </tr> </tbody> </table> <Note>

We strongly recommend configuring a single websocket URL that matches the Site URL configuration setting.

</Note>

License file location

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>The path and filename of the license file on disk. On startup, if Mattermost can't find a valid license in the database from a previous upload, it looks in this path for the license file.</p><p>String input. Can be an absolute path or a path relative to the <code>mattermost</code> directory.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>LicenseFileLocation</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_LICENSEFILELOCATION</code></li></ul></td> </tr> </tbody> </table>

TLS minimum version

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The minimum TLS version used by the Mattermost server.</p><p>String input. Default is <strong>1.2</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSMinVer</code> &gt; <code>1.2</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSMINVER</code></li></ul></td> </tr> </tbody> </table> <Note>

This setting only takes effect if you are using the built-in server binary directly, and not using a reverse proxy layer, such as NGINX.

</Note>

Trusted proxy IP header

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Specified headers that will be checked, one by one, for IP addresses (order is important). All other headers are ignored.</p><p>String array input consisting of header names, such as <code>["X-Forwarded-For", "X-Real-Ip"]</code>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TrustedProxyIPHeader</code> &gt; <code>[]</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TRUSTEDPROXYIPHEADER</code></li></ul></td> </tr> </tbody> </table> <Note>
  • The default value of [] means that no header will be trusted.
  • We recommend keeping the default setting when Mattermost is running without a proxy to avoid the client sending the headers and bypassing rate limiting and/or the audit log.
  • For environments that use a reverse proxy, this issue does not exist, provided that the headers are set by the reverse proxy. In those environments, only explicitly whitelist the header set by the reverse proxy and no additional values.
</Note>

Enable Strict Transport Security (HSTS)

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><ul><li><strong>true</strong>: Adds the Strict Transport Security (HSTS) header to all responses, forcing the browser to request all resources via HTTPS.</li><li><strong>false</strong>: <strong>(Default)</strong> No restrictions on TLS transport. Strict Transport Security (HSTS) header isn't added to responses.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSStrictTransport</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSSTRICTTRANSPORT</code></li></ul></td> </tr> </tbody> </table>

See the Strict-Transport-Security documentation for details.

Secure TLS transport expiry

<table> <colgroup> <col style={{width: '37%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><p>The time, in seconds, that the browser remembers a site is only to be accessed using HTTPS. After this period, a site can't be accessed using HTTP unless <code>TLSStrictTransport</code> is set to <code>true</code>.</p><p>Numerical input. Default is <strong>63072000</strong> (2 years).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSStrictTransportMaxAge</code> &gt; <code>63072000</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSSTRICTTRANSPORTMAXAGE</code></li></ul></td> </tr> </tbody> </table>

See the Strict-Transport-Security documentation for details.

TLS cipher overwrites

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>Set TLS ciphers overwrites to meet requirements from legacy clients which don't support modern ciphers, or to limit the types of accepted ciphers.</p><p>If none specified, the Mattermost server assumes a set of currently considered secure ciphers, and allows overwrites in the edge case.</p><p>String array input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TLSOverwriteCiphers</code> &gt; <code>[]</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TLSOVERWRITECIPHERS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • This setting only takes effect if you are using the built-in server binary directly and not using a reverse proxy layer, such as NGINX.
  • See the ServerTLSSupportedCiphers variable in /model/config.go for a list of ciphers considered secure.
</Note>

Goroutine health threshold

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Set a threshold on the number of goroutines when the Mattermost system is considered to be in a healthy state.</p><p>When goroutines exceed this limit, a warning is returned in the server logs.</p><p>Numeric input. Default is <strong>-1</strong> which turns off checking for the threshold.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>GoroutineHealthThreshold</code> &gt; <code>-1</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_GOROUTINEHEALTHTHRESHOLD</code></li></ul></td> </tr> </tbody> </table>

Allow cookies for subdomains

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><ul><li><strong>true</strong>: <strong>(Default)</strong> Allows cookies for subdomains by setting the domain parameter on Mattermost cookies.</li><li><strong>false</strong>: Cookies aren't allowed for subdomains.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>AllowCookiesForSubdomains</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ALLOWCOOKIESFORSUBDOMAINS</code></li></ul></td> </tr> </tbody> </table>

Cluster log timeout

<PlanAvailability slug="ent-plus" /> <table> <colgroup> <col style={{width: '37%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><p>Define the frequency, in milliseconds, of cluster request time logging for performance monitoring.</p><p>Numerical input. Default is <strong>2000</strong> milliseconds (2 seconds).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ClusterLogTimeoutMilliseconds</code> &gt; <code>2000</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_CLUSTERLOGTIMEOUTMILLISECONDS</code></li></ul></td> </tr> </tbody> </table>

See the performance monitoring documentation for details.

Maximum payload size

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>The maximum payload size in bytes for all APIs except APIs that receive a file as an input.</p><p>For example, the upload attachment API or the API to upload a custom emoji.</p><p>Numerical value. Default is <strong>300000</strong> (300 kB).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>MaximumPayloadSizeBytes</code> &gt; <code>300000</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_MAXIMUMPAYLOADSIZEBYTES</code></li></ul></td> </tr> </tbody> </table>

Database

With self-hosted deployments, you can configure the database environment in which Mattermost is deployed by going to System Console > Environment > Database, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Driver name

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The type of database. Can be either:</p><ul><li><strong>mysql</strong>: <strong>(Default)</strong> Enables driver to MySQL database.</li><li><strong>postgres</strong>: Enables driver to PostgreSQL database.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>DriverName</code></li><li>Environment variable: <code>MM_SQLSETTINGS_DRIVERNAME</code></li></ul></td> </tr> </tbody> </table>

Data source

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The connection string to the master database.</p><p>String input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>DataSource</code></li><li>Environment variable: <code>MM_SQLSETTINGS_DATASOURCE</code></li></ul></td> </tr> </tbody> </table>

PostgreSQL databases

When Driver Name is set to postgres, use a connection string in the form of: postgres://mmuser:password@hostname_or_IP:5432/mattermost_test?sslmode=disable&connect_timeout=10

To use TLS with PostgreSQL databases

The parameter to encrypt connection against a PostgreSQL server is sslmode. The library used to interact with PostgreSQL server is pq. Currently, it's not possible to use all the values that you could pass to a standard PostgreSQL Client psql "sslmode=value" See the SSL Mode Descriptions documentation for details.

Your database admin must configure the functionality according to the supported values described below.

<table style={{width: '99%'}}> <colgroup> <col style={{width: '30%'}} /> <col style={{width: '13%'}} /> <col style={{width: '55%'}} /> </colgroup> <thead> <tr> <th>Short description of the <code>sslmode</code> parameter</th> <th>Value</th> <th>Example of a data source name</th> </tr> </thead> <tbody> <tr> <td><p>Don't use TLS / SSL encryption against the PostgreSQL server.</p><p>Default value in file <code>config.json</code></p></td> <td><code>disable</code></td> <td><code>postgres://mmuser:password@hostname_or_IP:5432/mattermost_test ?sslmode=disable&amp;connect_timeout=10</code></td> </tr> <tr> <td><p>The data is encrypted and the network is trusted.</p><p>Default value is <code>sslmode</code> when omitted.</p></td> <td><code>require</code></td> <td><code>postgres://mmuser:password@hostname_or_IP:5432/mattermost_test ?sslmode=require&amp;connect_timeout=10</code></td> </tr> <tr> <td>The data is encrypted when connecting to a trusted server.</td> <td><code>verify-ca</code></td> <td><code>postgres://mmuser:password@hostname_or_IP:5432/mattermost_test ?sslmode=verify-ca&amp;connect_timeout=10</code></td> </tr> <tr> <td>The data is encrypted when connecting to a trusted server.</td> <td><code>verify-full</code></td> <td><code>postgres://mmuser:password@hostname_or_IP:5432/mattermost_test ?sslmode=verify-full&amp;connect_timeout=10</code></td> </tr> </tbody> </table>

MySQL Databases

When Driver Name is set to mysql, we recommend using collation over using charset.

To specify collation:

text
"SqlSettings": {
    "DataSource": "<mmuser:password>@tcp(hostname or IP:3306)/mattermost?charset=utf8mb4,utf8&collation=utf8mb4_general_ci",
    [...]
}

If collation is omitted, the default collation, utf8mb4_general_ci is used:

text
"SqlSettings": {
  "DataSource": "<mmuser:password>@tcp(hostname or IP:3306)/mattermost?charset=utf8mb4,utf8",
  [...]
}
<Note>

If you’re using MySQL 8.0 or later, the default collation has changed to utf8mb4_0900_ai_ci. See our Database Software Requirements documentation for details on MySQL 8.0 support.

</Note>

To use TLS with MySQL Databases

The parameter to encrypt connection against a MySQL server is tls.

The library used to interact with MySQL is Go-MySQL-Driver.

For the moment, it's not possible to use all the values that you could pass to a standard MySQL Client mysql --ssl-mode=value. See Connection-Encryption Option Summary documentation for a version 8.0 example.

Your database admin must configure the functionality according to supported values described below.

<table style={{width: '99%'}}> <colgroup> <col style={{width: '32%'}} /> <col style={{width: '14%'}} /> <col style={{width: '52%'}} /> </colgroup> <thead> <tr> <th>Short description of the <code>tls</code> parameter</th> <th>Value</th> <th>Example of a data source name</th> </tr> </thead> <tbody> <tr> <td>Don't use TLS / SSL encryption against MySQL server.</td> <td><code>false</code></td> <td><code>"&lt;mmuser:password&gt;@tcp(hostname or IP:3306)/mattermost_test ?charset=utf8mb4,utf8&amp;writeTimeout=30s&amp;tls=false"</code></td> </tr> <tr> <td>Use TLS / SSL encryption against MySQL server.</td> <td><code>true</code></td> <td><code>"&lt;mmuser:password&gt;@tcp(hostname or IP:3306)/mattermost_test ?charset=utf8mb4,utf8&amp;writeTimeout=30s&amp;tls=true"</code></td> </tr> <tr> <td>Use TLS / SSL encryption with a self-signed certificate against MySQL server.</td> <td><code>skip-verify</code></td> <td><code>"&lt;mmuser:password&gt;@tcp(hostname or IP:3306)/mattermost_test ?charset=utf8mb4,utf8&amp;writeTimeout=30s&amp;tls=skip-verify"</code></td> </tr> <tr> <td>Use TLS / SSL encryption if server advertises a possible fallback; unencrypted if it's not advertised.</td> <td><code>preferred</code></td> <td><code>"&lt;mmuser:password&gt;@tcp(hostname or IP:3306)/mattermost_test ?charset=utf8mb4,utf8&amp;writeTimeout=30s&amp;tls=preferred"</code></td> </tr> </tbody> </table>

AWS High Availablity RDS cluster deployments

For an AWS High Availability RDS cluster deployment, point this configuration setting to the write/read endpoint at the cluster level to benefit from the AWS failover handling. AWS takes care of promoting different database nodes to be the writer node. Mattermost doesn't need to manage this. See the high availablility database configuration documentation for details.

Maximum open connections

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>The maximum number of open connections to the database.</p><p>Numerical input. Default is <strong>100</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>MaxOpenConns</code> &gt; <code>100</code></li><li>Environment variable: <code>MM_SQLSETTINGS_MAXOPENCONNS</code></li></ul></td> </tr> </tbody> </table>

Maximum idle connections

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>The maximum number of idle connections held open to the database.</p><p>Numerical input. Default is <strong>50</strong>. A 2:1 ratio with MaxOpenConns is recommended.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>MaxIdleConns</code> &gt; <code>50</code></li><li>Environment variable: <code>MM_SQLSETTINGS_MAXIDLECONNS</code></li></ul></td> </tr> </tbody> </table>

Query timeout

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>The amount of time to wait, in seconds, for a response from the database after opening a connection and sending the query.</p><p>Numerical input in seconds. Default is <strong>30</strong> seconds.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>QueryTimeout</code> &gt; <code>30</code></li><li>Environment variable: <code>MM_SQLSETTINGS_QUERYTIMEOUT</code></li></ul></td> </tr> </tbody> </table>

Maximum connection lifetime

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><p>Maximum lifetime for a connection to the database, in milliseconds. Use this setting to configure the maximum amount of time a connection to the database may be reused</p><p>Numerical input in milliseconds. Default is <strong>3600000</strong> milliseconds (1 hour).</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>ConnMaxLifetimeMilliseconds</code> &gt; <code>3600000</code></li><li>Environment variable: <code>MM_SQLSETTINGS_CONNMAXLIFETIMEMILLISECONDS</code></li></ul></td> </tr> </tbody> </table>

Maximum connection idle timeout

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><p>Maximum time a database connection can remain idle, in milliseconds.</p><p>Numerical input in milliseconds. Default is <strong>300000</strong> (5 minutes).</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>ConnMaxIdleTimeMilliseconds</code> &gt; <code>300000</code></li><li>Environment variable: <code>MM_SQLSETTINGS_CONNMAXIDLETIMEMILLISECONDS</code></li></ul></td> </tr> </tbody> </table>

Minimum hashtag length

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td>Minimum number of characters in a hashtag. This value must be greater than or equal to <strong>2</strong>.</td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>MinimumHashtagLength</code> &gt; <code>3</code></li><li>Environment variable: <code>MM_SQLSETTINGS_MINIMUMHASHTAGLENGTH</code></li></ul></td> </tr> </tbody> </table> <Note>

MySQL databases must be configured to support searching strings shorter than three characters. See the MySQL documentation for details.

</Note>

SQL statement logging

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>Executed SQL statements can be written to the log for development.</p><ul><li><strong>true</strong>: Executing SQL statements are written to the log.</li><li><strong>false</strong>: <strong>(Default)</strong> SQL statements aren't written to the log.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>Trace</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SQLSETTINGS_TRACE</code></li></ul></td> </tr> </tbody> </table>

Recycle database connections

<PlanAvailability slug="ent-plus" /> <table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>Select the <strong>Recycle Database Connections</strong> button to manually recycle the connection pool by closing the current set of open connections to the database within 20 seconds, and then creating a new set of connections.</p><p>To fail over without stopping the server, change the database line in the <code>config.json</code> file, select <strong>Reload Configuration from Disk</strong> via <strong>Environment &gt; Web Server</strong>, then select <strong>Recycle Database Connections</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Database</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <table> <colgroup> <col style={{width: '100%'}} /> </colgroup> <tbody> <tr> <td>When <a href="mm-doc:%2Fadministration-guide%2Fscale%2Fenterprise-search">enterprise-scale search</a>, | - System Config path: <strong>Environment &gt; Database</strong> database search can be disabled from performing searches. | - <code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>DisableDatabaseSearch</code> &gt; <code>false</code> | | - Environment variable: <code>MM_SQLSETTINGS_DISABLEDATABASESEARCH</code> | - <strong>true</strong>: Disables the use of the database to perform | | searches. If another search engine isn't configured, | | setting this value to <code>true</code> will result in empty search | | results. | | - <strong>false</strong>: <strong>(Default)</strong> Database search isn't disabled. | |</td> </tr> </tbody> </table>

Search behavior in Mattermost depends on which search engines are enabled:

  • When Elasticsearch or AWS OpenSearch is enabled, Mattermost will try to use it first.
  • If Elasticsearch fails or is disabled, Mattermost will attempt to use Bleve search, if enabled. Bleve search has been deprecated in Mattermost v11.0. We recommend using Elasticsearch or OpenSearch for enterprise search capabilities.
  • If these fail or are disabled, Mattermost tries to search the database directly, if this is enabled.
  • If all of the above methods fail or are disabled, the search results will be empty.
<Note>

Disabling this configuration setting in larger deployments may improve server performance in the following areas:

  • Reduced Database Load: When database search is enabled, every search query executed by users needs to interact with the database, leading to additional load on the database server. By disabling database search, you can avoid these queries, thereby reducing the database load.
  • Improved Response Time: Database searches can be time-consuming, especially with large datasets. Disabling database search can result in faster response times because the system no longer spends time fetching and processing search results from the database.
  • Offloading Search to Indexing Services: Disabling database search often means that searches are offloaded to specialized indexing services like Elasticsearch, which are optimized for search operations. These services can provide faster and more efficient search capabilities compared to traditional database searches.
  • Lower Resource Consumption: Running search queries directly against the database can be resource-intensive (using CPU and memory). With database search disabled, these resources can be allocated to other critical functions, improving overall system performance.
  • Enhanced Scalability: As the number of users and data volume grow, database search can become less efficient. Specialized search services are designed to scale more effectively, enhancing overall system scalability and performance.

However, the ability to perform database searches in Mattermost is a critical feature for many users, particularly when other search engines aren't enabled. Disabling this feature will result in users seeing an error if they attempt to use the Mattermost Search box. It’s important to balance performance improvements with the needs of your organization and users.

</Note>

Applied schema migrations

A list of all migrations that have been applied to the data store based on the version information available in the db_migrations table. Select About Mattermost from the Product menu to review the current database schema version applied to your deployment.

Active search backend

Read-only display of the currently active backend used for search. Values can include none, database, elasticsearch, or bleve.

Read replicas

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td>Specifies the connection strings for the read replica databases.</td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>DataSourceReplicas</code> &gt; <code>[]</code></li><li>Environment variable: <code>MM_SQLSETTINGS_DATASOURCEREPLICAS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Each database connection string in the array must be in the same form used for the Data source setting.
  • Space separate multiple read replicas in the array to allow Mattermost to load balance read queries across multiple database instances. For example, MM_SQLSETTINGS_DATASOURCEREPLICAS=dc-1 dc-2
</Note>

AWS High Availability RDS cluster deployments

For an AWS High Availability RDS cluster deployment, point this configuration setting directly to the underlying read-only node endpoint within the RDS cluster to circumvent the failover/load balancing that AWS/RDS takes care of (except for the write traffic). Mattermost has its own method of balancing the read-only connections and can also balance those queries to the data source/write+read connection should those nodes fail. See the high availablility database configuration documentation for details.

Search replicas

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td>Specifies the connection strings for the search replica databases. A search replica is similar to a read replica, but is used only for handling search queries.</td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>DataSourceSearchReplicas</code> &gt; <code>[]</code></li><li>Environment variable: <code>MM_SQLSETTINGS_DATASOURCESEARCHREPLICAS</code></li></ul></td> </tr> </tbody> </table> <Note>

Each database connection string in the array must be in the same form used for the Data source setting.

</Note>

AWS High Availability RDS cluster deployments

For an AWS High Availability RDS cluster deployment, point this configuration setting directly to the underlying read-only node endpoint within the RDS cluster to circumvent the failover/load balancing that AWS/RDS takes care of (except for the write traffic). Mattermost has its own method of balancing the read-only connections and can also balance those queries to the data source/write+read connection should those nodes fail. See the high availablility database configuration documentation for details.

Replica lag settings

<PlanAvailability slug="ent-plus" /> <table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>String array input specifies a connection string and user-defined SQL queries on the database to measure replica lag for a single replica instance.</p><p>These settings monitor absolute lag based on binlog distance/transaction queue length, and the time taken for the replica to catch up.</p><p>String array input consists of:</p><ul><li><code>DataSource</code>: The database credentials to connect to the database instance.</li><li><code>QueryAbsoluteLag</code>: A plain SQL query that must return a single row. The first column must be the node value of the Prometheus metric, and the second column must be the value of the lag used to measure absolute lag.</li><li><code>QueryTimeLag</code>: A plain SQL query that must return a single row. The first column must be the node value of the Prometheus metric, and the second column must be the value of the lag used to measure the time lag.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>ReplicaLagSettings</code> &gt; <code>[]</code></li><li>Environment variable: <code>MM_SQLSETTINGS_REPLICALAGSETTINGS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • The QueryAbsoluteLag and QueryTimeLag queries must return a single row.
  • To properly monitor this, you must set up performance monitoring for Mattermost.
</Note>
  1. Configure the replica lag metric based on your database type. See the following tabs for details on configuring this for each database type.
<Tabs> <TabItem value="aws-aurora" label="AWS Aurora">

Add the configuration highlighted below to your SqlSettings.ReplicaLagSettings array. You only need to add this once because replication statistics for AWS Aurora nodes are visible across all server instances that are members of the cluster. Be sure to change the DataSource to point to a single node in the group.

For more information on Aurora replication stats, see the AWS Aurora documentaion.

Example

json
&#123;
  "SqlSettings": &#123;
      "ReplicaLagSettings": [
        &#123;
            "DataSource": "replica-1",
            "QueryAbsoluteLag": "select server_id, highest_lsn_rcvd-durable_lsn as bindiff from aurora_global_db_instance_status() where server_id=<>",
            "QueryTimeLag": "select server_id, visibility_lag_in_msec from aurora_global_db_instance_status() where server_id=<>"
        &#125;
      ]
  &#125;
&#125;
</TabItem> <TabItem value="mysql-group-replication" label="MySQL Group Replication">

Add the configuration highlighted below to your SqlSettings.ReplicaLagSettings array. You only need to add this once because replication statistics for all nodes are shared across all server instances that are members of the MySQL replication group. Be sure to change the DataSource to point to a single node in the group.

For more information on group replication stats, see the MySQL documentation.

Example

json
&#123;
  "SqlSettings": &#123;
      "ReplicaLagSettings": [
        &#123;
            "DataSource": "replica-1",
            "QueryAbsoluteLag": "select member_id, count_transactions_remote_in_applier_queue FROM performance_schema.replication_group_member_stats where member_id=<>",
            "QueryTimeLag": ""
        &#125;
      ]
  &#125;
&#125;
</TabItem> <TabItem value="postgresql-replication-slots" label="PostgreSQL replication slots">
  1. Add the configuration highlighted below to your SqlSettings.ReplicaLagSettings array. This query should run against the primary node in your cluster, to do this change the DataSource to match the SqlSettings.DataSource setting you have configured.

For more information on pg_stat_replication, see the PostgreSQL documentation.

Example:

json
&#123;
  "SqlSettings": &#123;
      "ReplicaLagSettings": [
        &#123;
            "DataSource": "postgres://mmuser:password@localhost:5432/mattermost_test?sslmode=disable&connect_timeout=10.",
            "QueryAbsoluteLag": "select usename, pg_wal_lsn_diff(pg_current_wal_lsn(),replay_lsn) as metric from pg_stat_replication;",
            "QueryTimeLag": ""
        &#125;
      ]
  &#125;
&#125;
  1. Grant permissions to the database user for pg_monitor. This user should be the same user configured above in the DataSource string.

For more information on roles, see the PostgreSQL documentation.

sh
sudo -u postgres psql
postgres=# GRANT pg_monitor TO mmuser;
</TabItem> </Tabs>
  1. Save the config and restart all Mattermost nodes.
  2. Navigate to your Grafana instance monitoring Mattermost and open the Mattermost Performance Monitoring v2 dashboard.
  3. The QueryTimeLag chart is already setup for you utilizing the existing Replica Lag chart. If using QueryAbsoluteLag metric clone the Replica Lag chart and edit the query to use the below absolute lag metrics and modify the title to be Replica Lag Absolute.
text
mattermost_db_replica_lag_abs&#123;instance=~"$server"&#125;

Replica monitor interval (seconds)

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Specifies how frequently unhealthy replicas will be monitored for liveness check. Mattermost will dynamically choose a replica if it's alive.</p><p>Numerical input. Default is 5 seconds.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>SqlSettings</code> &gt; <code>ReplicaMonitorIntervalSeconds</code> &gt; <code>5</code></li><li>Environment variable: <code>MM_SQLSETTINGS_REPLICAMONITORINTERVALSECONDS</code></li></ul></td> </tr> </tbody> </table> <Note>

This configuration setting is applicable to self-hosted deployments only.

</Note>
<PlanAvailability slug="ent-plus" />

Core database search happens in a relational database and is intended for deployments under about 2–3 million posts and file entries. Beyond that scale, enabling enterprise search with Elasticsearch or AWS OpenSearch is highly recommended for optimum search performance before reaching 3 million posts.

For self-hosted deployments with over 3 million posts, Elasticsearch or AWS OpenSearch is required to avoid significant performance issues, such as timeouts, with message searches and @mentions.

You can configure Mattermost enterprise search by going to System Console > Environment > Elasticsearch. The following configuration settings apply to both Elasticsearch and AWS OpenSearch. You can also edit the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Enable Elasticsearch indexing

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to index new posts automatically.</p><ul><li><strong>true</strong>: Indexing of new messages occurs automatically.</li><li><strong>false</strong>: <strong>(Default)</strong> Indexing of new messages is disabled, and new messages aren't indexed.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>EnableIndexing</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_ENABLEINDEXING</code></li></ul></td> </tr> </tbody> </table> <Note>

If indexing is disabled and then re-enabled after an index is created, purge and rebuild the index to ensure complete search results.

</Note>

Backend type

Both Elasticsearch and AWS OpenSearch provide enterprise-scale deployments with optimized search performance and prevents performance degradation and timeouts. Learn more about enterprise search in our product documentation.

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>The type of search backend.</p><ul><li><code>elasticsearch</code> - (<strong>Default</strong>)</li><li><code>opensearch</code> - Required for AWS OpenSearch.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>Backend</code> &gt; <code>"elasticsearch"</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_BACKEND</code></li></ul></td> </tr> </tbody> </table>

Learn more about enterprise search version support.

Server connection address

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td>The address of the Elasticsearch or AWS OpenSearch server.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>ConnectionUrl</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CONNECTIONURL</code></li></ul></td> </tr> </tbody> </table>

CA path

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td>Optional path to the Custom Certificate Authority certificates for the Elasticsearch or AWS OpenSearch server.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>CA</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CA</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Available from Mattermost v7.8. The certificate path should be /opt/mattermost/data/elasticsearch/ or /opt/mattermost/data/opensearch and configured in the System Console as ./elasticsearch/cert.pem or ./opensearch/cert.pem.
  • Can be used in conjunction with basic authentication credentials or can replace them. Leave this setting blank to use the default Certificate Authority certificates for the operating system.
</Note>

Client certificate path

Available from Mattermost v7.8. Can be used in conjunction with basic auth credentials or to replace them.

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td>Optional client certificate for the connection to the Elasticsearch or AWS OpenSearch server in the PEM format.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>ClientCert</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CLIENTCERT</code></li></ul></td> </tr> </tbody> </table>

Client certificate key path

Available from Mattermost v7.8. Can be used in conjunction with basic auth credentials or to replace them.

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td>Optional key for the client certificate in the PEM format.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>ClientKey</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CLIENTKEY</code></li></ul></td> </tr> </tbody> </table>

Skip TLS verification

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>The certificate step for TLS connections can be skipped.</p><ul><li><strong>true</strong>: Skips the certificate verification step for TLS connections.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost requires certificate verification.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>SkipTLSVerification</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_SKIPTLSVERIFICATION</code></li></ul></td> </tr> </tbody> </table>

Server username

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>(Optional) The username to authenticate to the Elasticsearch or AWS OpenSearch server.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>UserName</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_USERNAME</code></li></ul></td> </tr> </tbody> </table>

Server password

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>(Optional) The password to authenticate to the Elasticsearch or AWS OpenSearch server.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>Password</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_PASSWORD</code></li></ul></td> </tr> </tbody> </table>

Enable cluster sniffing

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to automatically find and connect to all data nodes in a cluster.</p><ul><li><strong>true</strong>: Sniffing finds and connects to all data nodes in your cluster automatically.</li><li><strong>false</strong>: <strong>(Default)</strong> Cluster sniffing is disabled.</li></ul><p>Do not enable cluster sniffing when using cloud-hosted search providers such as Amazon OpenSearch Service.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>Sniff</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_SNIFF</code></li></ul></td> </tr> </tbody> </table>

Select the Test Connection button in the System Console to validate the connection between Mattermost and the Elasticsearch or AWS OpenSearch server.

Bulk indexing

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td>Configure Mattermost to start a bulk index of all existing posts in the database, from oldest to newest.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <Note>
  • Always purge indexes before bulk indexing.
  • Select the Index Now button in the System Console to start a bulk index of all posts, and review all index jobs in progress.
  • Elasticsearch or AWS OpenSearch is available during indexing, but search results may be incomplete until the indexing job is complete.
  • If an in-progress indexing job is canceled, the index and search results will be incomplete.
</Note>

Rebuild channels index

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td>Purge the channels index adn re-index all channels in the database, from oldest to newest.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table>

Select the Rebuild Channels Index button in the System Console to purge the channels index. Ensure no other indexing jobs are in progress via the Bulk Indexing table before starting this process. During indexing, channel auto-complete is available, but search results may be incomplete until the indexing job is complete.

Purge indexes

<table style={{width: '88%'}}> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '51%'}} /> </colgroup> <tbody> <tr> <td>Purge the entire Elasticsearch index.</td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: N/A</li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table>

Select the Purge Indexes button in the System Console to purge the index. After purging the index, create a new index by selecting the Index Now button.

Indexes to skip while purging

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>Specify index names to ignore while purging indexes. Separate multiple index names with commas.</p><p>Use an asterisk (*) to match a sequence of index name characters.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>IgnoredPurgeIndexes</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_IGNOREDPURGEINDEXES</code></li></ul></td> </tr> </tbody> </table>

Enable Elasticsearch for search queries

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to use Elasticsearch or AWS OpenSearch for all search queries using the latest index.</p><ul><li><strong>true</strong>: Elasticsearch or AWS OpenSearch is used for all search queries using the latest index. Search results may be incomplete until a bulk index of the existing message database is completed.</li><li><strong>false</strong>: <strong>(Default)</strong> Database search is used for search queries.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>EnableSearching</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_ENABLESEARCHING</code></li></ul></td> </tr> </tbody> </table>

If indexing is disabled and then re-enabled after an index is created, purge and rebuild the index to ensure complete search results.

Enable Elasticsearch for autocomplete queries

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to use Elasticsearch or AWS OpenSearch for all autocompletion queries on users and channels using the latest index.</p><ul><li><strong>true</strong>: Elasticsearch or AWS OpenSearch will be used for all autocompletion queries on users and channels using the latest index.</li><li><strong>false</strong>: <strong>(Default)</strong> Database autocomplete is used.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>EnableAutocomplete</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_ENABLEAUTOCOMPLETE</code></li></ul></td> </tr> </tbody> </table>

Autocompletion results may be incomplete until a bulk index of the existing users and channels database is finished.

Allow searching public channels without membership

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Allow users to search for messages in public channels they have not joined.</p><p>When enabled for the first time, existing posts are updated in the background with channel type information. This backfill process is throttled to ~10,000 posts per second to avoid impacting search performance.</p><ul><li><strong>true</strong>: Users can find messages in public channels they haven't joined, scoped to teams they belong to.</li><li><strong>false</strong>: <strong>(Default)</strong> Users can only search messages in channels they are a member of.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Elasticsearch</strong></li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>EnableSearchPublicChannelsWithoutMembership</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_ENABLESEARCHPUBLICCHANNELSWITHOUTMEMBERSHIP</code></li></ul></td> </tr> </tbody> </table> <Note>

This setting has no effect when Compliance Mode is enabled. When Compliance Mode is active, search results are always restricted to channels the user is a member of.

</Note>

Post index replicas

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The number of replicas to use for each post index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>PostIndexReplicas</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_POSTINDEXREPLICAS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • If this setting is changed, the changed configuration only applies to newly-created indexes. To apply the change to existing indexes, purge and rebuild the index after changing this setting.
  • If there are n data nodes, the number of replicas per shard for each index should be n-1.
  • If the number of nodes in an Elasticsearch or AWS OpenSearch cluster changes, this configuration setting, as well as Channel Index Replicas and User Index Replicas must also be updated accordingly.
</Note>

Post index shards

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The number of shards to use for each post index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>PostIndexShards</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_POSTINDEXSHARDS</code></li></ul></td> </tr> </tbody> </table> <Note>

If this configuration setting is changed, the changed configuration only applies to newly-created indexes. To apply the change to existing indexes, purge and rebuild the index after changing this setting.

</Note>

Channel index replicas

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The number of replicas to use for each channel index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>ChannelIndexReplicas</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CHANNELINDEXREPLICAS</code></li></ul></td> </tr> </tbody> </table> <Note>

If there are n data nodes, the number of replicas per shard for each index should be n-1. If the number of nodes in an Elasticsearch or AWS OpenSearch cluster changes, this configuration setting, as well as Post Index Replicas and User Index Replicas must also be updated accordingly.

</Note>

Channel index shards

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The number of shards to use for each channel index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>ChannelIndexShards</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_CHANNELINDEXSHARDS</code></li></ul></td> </tr> </tbody> </table>

User index replicas

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The number of replicas to use for each user index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>UserIndexReplicas</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_USERINDEXREPLICAS</code></li></ul></td> </tr> </tbody> </table> <Note>

If there are n data nodes, the number of replicas per shard for each index should be n-1. If the number of nodes in an Elasticsearch or AWS OpenSearch cluster changes, this configuration setting, as well as Post Index Replicas and User Index Replicas must also be updated accordingly.

</Note>

User index shards

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The number of shards to use for each user index.</p><p>Numerical input. Default is <strong>1</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>UserIndexShards</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_USERINDEXSHARDS</code></li></ul></td> </tr> </tbody> </table>

Aggregate search indexes

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Elasticsearch or AWS OpenSearch indexes older than the age specified by this setting, in days, will be aggregated during the daily scheduled job.</p><p>Numerical input. Default is <strong>365</strong> days.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>AggregatePostsAfterDays</code> &gt; <code>365</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_AGGREGATEPOSTSAFTERDAYS</code></li></ul></td> </tr> </tbody> </table> <Note>

If you’re using data retention and enterprise search, configure this with a value greater than your data retention policy.

</Note>

Post aggregator start time

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The start time of the daily scheduled aggregator job.</p><p>Must be a 24-hour time stamp in the form <code>HH:MM</code> based on the local time of the server.</p><p>Default is <strong>03:00</strong> (3 AM)</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>PostsAggregatorJobStartTime</code> &gt; <code>"03:00"</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_POSTSAGGREGATORJOBSTARTTIME</code></li></ul></td> </tr> </tbody> </table>

Index prefix

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td>The prefix added to the Elasticsearch or AWS OpenSearch index name.</td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>IndexPrefix</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_INDEXPREFIX</code></li></ul></td> </tr> </tbody> </table> <Note>

When this setting is used, all Elasticsearch or AWS OpenSearch indexes created by Mattermost are given this prefix. You can set different prefixes so that multiple Mattermost deployments can share an Elasticsearch or AWS OpenSearch cluster without the index names colliding.

</Note>

Global search prefix

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>Enable global search across multiple Elasticsearch indices with the same <a href="#index-prefix">index prefix</a>.</p><p>This is helpful for setups with multiple data centers where Elasticsearch instances share data using cross-cluster replication. It allows for easier and unified searching across distributed indices.</p><p>Value must be a prefix of <code>IndexPrefix</code>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>GlobalSearchPrefix</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_GLOBALSEARCHPREFIX</code></li></ul></td> </tr> </tbody> </table>

Live indexing batch size

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The number of new posts needed before those posts are added to the Elasticsearch or AWS OpenSearch index. Once added to the index, the post becomes searchable.</p><p>On servers with more than 1 post per second, we suggest setting this value to the average number of posts over a 20 second period of time.</p><p>Numerical input. Default is <strong>1</strong>. Every post is indexed synchronously as they are created.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>LiveIndexingBatchSize</code> &gt; <code>1</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_LIVEINDEXINGBATCHSIZE</code></li></ul></td> </tr> </tbody> </table> <Note>

It may be necessary to increase this value to avoid hitting the rate limit or resource limit of your Elasticsearch or AWS OpenSearch cluster on installs handling more than 1 post per second.

</Note>

What exactly happens when I increase this value?

The primary impact is that a post will be indexed into Elasticsearch or AWS OpenSearch after the threshold of posts is met, which then makes the posts searchable within Mattermost. So, if you set this based on recommendations for larger servers, and you make a post, you cannot find it via search for ~10–20 seconds, on average. Realistically, no users should see or feel this impact due to the limited number of users who are actively searching for a post this quickly. You can set this value to a lower or higher average depending on your Elasticsearch or AWS OpenSearch server specifications.

During busy periods, this delay will be faster as more traffic is occurring, causing more posts and a quicker time to hit the index number. During slower periods, expect the reverse.

How to find the right number for your server

  1. You must understand how many posts your server makes every minute. Run the query below to calculate your server's average posts per minute.

    Note that this query can be heavy, so we recommend that you run it during non-peak hours. Additionally, you can adjust the WHERE clause to see the posts per minute over a different time period. Right now 31536000000 represents the number of milliseconds in a year.

    SQL
    SELECT
      AVG(postsPerMinute) as averagePostsPerMinute
    FROM (
      SELECT
        count(*) as postsPerMinute,
        date_trunc('minute', to_timestamp(createat/1000))
      FROM posts
      WHERE createAt > ( (extract(epoch from now()) * 1000 )  - 31536000000)
      GROUP BY date_trunc('minute', to_timestamp(createat/1000))
    ) as ppm;
    
  2. Decide the acceptable index window for your environment, and divide your average posts per minute by that. We suggest 10-20 seconds. Assuming you have 600 posts per minute on average, and you want to index every 20 seconds (60 seconds / 20 seconds = 3<code>) you would calculate </code><code>600 / 3</code><code> to come to the number </code><code>200</code>`. After 200 posts, Mattermost will index the posts into Elasticsearch or AWS OpenSearch. So, on average, there would be a 20-second delay in searchability.

  3. Edit the config.json or run mmctl to modify the LiveIndexingBatchSize setting

    In the ``config.json``

    JSON
    &#123;
      "ElasticsearchSettings": &#123;
        "LiveIndexingBatchSize": 200
      &#125;
    &#125;
    

    Via mmctl

    sh
    mmctl config set ElasticsearchSettings.LiveIndexingBatchSize 200
    

    Via an environment variable

    sh
    MM_ELASTICSEARCHSETTINGS_LIVEINDEXINGBATCHSIZE = 200
    
  4. Restart the Mattermost server.

Batch size

<table> <colgroup> <col style={{width: '34%'}} /> <col style={{width: '65%'}} /> </colgroup> <tbody> <tr> <td><p>The number of posts for a single batch during a bulk indexing job.</p><p>Numerical input. Default is <strong>10000</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>BatchSize</code> &gt; <code>10000</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_BATCHSIZE</code></li></ul></td> </tr> </tbody> </table>

Request timeout

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The timeout, in seconds, for Elasticsearch or AWS OpenSearch calls.</p><p>Numerical input in seconds. Default is <strong>30</strong> seconds.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>RequestTimeoutSeconds</code> &gt; <code>30</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_REQUESTTIMEOUTSECONDS</code></li></ul></td> </tr> </tbody> </table>

Trace

<table> <colgroup> <col style={{width: '48%'}} /> <col style={{width: '51%'}} /> </colgroup> <tbody> <tr> <td><p>Options for printing Elasticsearch or AWS OpenSearch trace errors.</p><ul><li><strong>error</strong>: Creates the error trace when initializing the Elasticsearch or AWS OpenSearch client and prints any template creation or search query that returns an error as part of the error message.</li><li><strong>all</strong>: Creates the three traces (error, trace and info) for the driver and doesn’t print the queries because they will be part of the trace log level of the driver.</li><li><strong>not specified</strong>: <strong>(Default)</strong> No error trace is created.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>Trace</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_TRACE</code></li></ul></td> </tr> </tbody> </table>

Enable CJK analyzers

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>When enabled, Mattermost uses language-specific analyzer plugins to improve search results for Korean, Japanese, and Chinese content. The required analyzer plugins must be installed on the Elasticsearch or AWS OpenSearch server before enabling this setting.</p><p>Supported plugins:</p><ul><li><code>analysis-nori</code> (Korean)</li><li><code>analysis-kuromoji</code> (Japanese)</li><li><code>analysis-smartcn</code> (Chinese)</li><li><strong>true</strong>: CJK language-specific analyzers are enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Standard analyzers are used.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ElasticsearchSettings</code> &gt; <code>EnableCJKAnalyzers</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_ELASTICSEARCHSETTINGS_ENABLECJKANALYZERS</code></li></ul></td> </tr> </tbody> </table> <Note>

Available from Mattermost v11.6. The required analyzer plugins should be installed on the Elasticsearch or AWS OpenSearch server before enabling this setting for full analysis support. If no plugin is detected, a warning will be logged. See the Elasticsearch setup and AWS OpenSearch setup documentation for plugin installation instructions.

If you enable this setting on a server that was previously running Elasticsearch or AWS OpenSearch, you must purge and rebuild the search indexes for existing content to be properly searchable with the new analyzers. See the Elasticsearch setup documentation for instructions on purging and rebuilding indexes.

</Note>

File storage

With self-hosted deployments, you can configure file storage settings by going to System Console > Environment > File Storage, or by editing the config.json file as described in the following tables.

<Note>

Mattermost currently supports storing files on the local filesystem and Amazon S3 or S3-compatible containers. We have tested Mattermost with Digital Ocean Spaces, but not all S3-compatible containers on the market. If you are looking to use other S3-compatible containers, we recommend completing your own testing. You can also use local storage or a network drive using NFS.

</Note>

File storage system

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>The type of file storage system used. Can be either Local File System or Amazon S3.</p><ul><li><strong>local</strong>: <strong>(Default)</strong> Files and images are stored in the specified local file directory.</li><li><strong>amazons3</strong>: Files and images are stored on Amazon S3 based on the access key, bucket, and region fields provided. The driver is compatible with other S3-compatible services, such as Digital Ocean Spaces.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>DriverName</code> &gt; <code>"local"</code></li><li>Environment variable: <code>MM_FILESETTINGS_DRIVERNAME</code></li></ul></td> </tr> </tbody> </table>

Local storage directory

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The local directory to which files are written when the <strong>File storage system</strong> is set to <strong>local</strong>. Can be any directory writable by the user Mattermost is running as, and is relative to the directory where Mattermost is installed.</p><p>Defaults to <strong>./data/</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>Directory</code></li><li>Environment variable: <code>MM_FILESETTINGS_DIRECTORY</code></li></ul></td> </tr> </tbody> </table>

When File storage system is set to amazons3, this setting has no effect.

Maximum file size

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>The maximum file size for message attachments and plugin uploads. This value must be specified in mebibytes in the System Console, and in bytes in the <code>config.json</code> file.</p><p>The default is <code>104857600</code> bytes (<strong>100</strong> mebibytes).</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>MaxFileSize</code> &gt; <code>104857600</code></li><li>Environment variable: <code>MM_FILESETTINGS_MAXFILESIZE</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Verify server memory can support your setting choice. Large file sizes increase the risk of server crashes and failed uploads due to network disruptions.
  • When uploading plugin files, a Received invalid response from the server error typically indicates that MaxFileSize isn't large enough to support the plugin file upload, and/or that proxy settings may not be sufficient.
  • If you use a proxy or load balancer in front of Mattermost, the following proxy settings must be adjusted accordingly:
    • For NGINX, use client_max_body_size.
    • For Apache, use LimitRequestBody.
</Note>

Enable document search by content

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Enable users to search the contents of documents attached to messages.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Documents are searchable by their content.</li><li><strong>false</strong>: Documents aren’t searchable by their content. When document content search is disabled, users can search for files by file name only.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>ExtractContent</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_FILESETTINGS_EXTRACTCONTENT</code></li></ul></td> </tr> </tbody> </table> <Note>

Enabling document search by content is required when extracting content from files. Both Mattermost file search and Mattermost Agents can access files and their content, when enabled with the necessary dependencies. Document content search results for files shared before upgrading to Mattermost Server v5.35 may be incomplete until an extraction command is executed using the mmctl. If this command is not run, users can search older files based on file name only.

You can optionally install the following dependencies to extend content searching support in Mattermost to include file formats beyond PDF, DOCX, and ODT, such as DOC, RTF, XML, and HTML:

  • tidy: Used to search the contents of HTML documents.
  • wv: Used to search the contents of DOC documents.
  • poppler-utils: Used to significantly improve server performance when extracting the contents of PDF documents.
  • unrtf: Used to search the contents of RTF documents.
  • JusText: Used to search HTML documents. See the JusText Python package for deployment information.

If you choose not to install these dependencies, you’ll see log entries for documents that couldn’t be extracted. Any documents that can’t be extracted are skipped and logged so that content extraction can proceed.

</Note>

Enable searching content of documents within ZIP files

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Enables users to search the contents of compressed ZIP files attached to messages.</p><ul><li><strong>true</strong>: Contents of documents within ZIP files are returned in search results. This may have an impact on server performance for large files. the specified local file directory.</li><li><strong>false</strong>: <strong>(Default)</strong> The contents of documents within ZIP files aren’t returned in search results.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>ArchiveRecursion</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_FILESETTINGS_ARCHIVERECURSION</code></li></ul></td> </tr> </tbody> </table> <Note>
  • You can search for document content within ZIP files when using Mattermost in a web browser or the desktop app.
  • Searching document contents adds load to your server.
  • This setting applies only to standard ZIP files. 7zip (.7z) files are blocked for security reasons and are not searchable.
  • For large deployments, or teams that share many large, text-heavy documents, we recommend you review our hardware requirements, and test enabling this feature in a staging environment before enabling it in a production environment.
</Note>

Amazon S3 bucket

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The name of the bucket for your S3-compatible object storage instance.</p><p>A string with the S3-compatible bucket name.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3Bucket</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3BUCKET</code></li></ul></td> </tr> </tbody> </table>

Amazon S3 path prefix

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The prefix you selected for your <strong>Amazon S3 bucket</strong> in AWS.</p><p>A string containing the path prefix.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3PathPrefix</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3PATHPREFIX</code></li></ul></td> </tr> </tbody> </table>

Amazon S3 region

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The AWS region you selected when creating your <strong>Amazon S3 bucket</strong> in AWS.</p><p>A string with the AWS region containing the bucket. If no region is set, Mattermost attempts to get the appropriate region from AWS, and sets it to <strong>us-east-1</strong> if none found.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>`".FileSettings.AmazonS3Region",</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3REGION</code></li></ul></td> </tr> </tbody> </table>

For Digital Ocean Spaces or other S3-compatible services, leave this setting empty.

Amazon S3 access key ID

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td>A string with the access key for the S3-compatible storage instance. Your EC2 administrator can supply you with the Access Key ID.</td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3AccessKeyId</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3ACCESSKEYID</code></li></ul></td> </tr> </tbody> </table> <Note>

This is required for access unless you are using an Amazon S3 IAM Role with Amazon S3.

</Note>

Amazon S3 endpoint

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>The hostname of your S3-compatible instance.</p><p>A string with the hostname of the S3-compatible storage instance. Defaults to <strong>s3.amazonaws.com</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3Endpoint</code> &gt; <code>"s3.amazonaws.com"</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3ENDPOINT</code></li></ul></td> </tr> </tbody> </table> <Note>

For Digital Ocean Spaces, the hostname should be set to <region>.digitaloceanspaces.com, where <region> is the abbreviation for the region you selected when setting up the Space. It can be nyc3, ams3, or sgp1.

</Note>

Amazon S3 secret access key

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>The secret access key associated with your Amazon S3 Access Key ID.</p><p>A string with the secret access key for the S3-compatible storage instance.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3SecretAccessKey</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3SECRETACCESSKEY</code></li></ul></td> </tr> </tbody> </table>

Enable secure Amazon S3 connections

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable secure Amazon S3 connections.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Enables only secure Amazon S3 connections.</li><li><strong>false</strong>: Allows insecure connections to Amazon S3.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3SSL</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3SSL</code></li></ul></td> </tr> </tbody> </table>

Amazon S3 signature v2

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>By default, Mattermost uses Signature v4 to sign API calls to AWS, but under some circumstances, v2 is required.</p><ul><li><strong>true</strong>: Use Signature v2 signing process.</li><li><strong>false</strong>: <strong>(Default)</strong> Use Signature v4 signing process.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3SignV2</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3SIGNV2</code></li></ul></td> </tr> </tbody> </table>

See the AWS documentation for information about when to use the Signature v2 signing process.

Enable server-side encryption for Amazon S3

<PlanAvailability slug="ent-plus" /> <table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>Enable server-side encryption for Amazon S3.</p><ul><li><strong>true</strong>: Encrypts files in Amazon S3 using server-side encryption with Amazon S3-managed keys.</li><li><strong>false</strong>: <strong>(Default)</strong> Doesn’t encrypt files in Amazon S3.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3SSE</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3SSE</code></li></ul></td> </tr> </tbody> </table> <Note>

This configuration setting is available for self-hosted deployments only.

</Note>

Enable Amazon S3 debugging

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable Amazon S3 debugging to capture additional debugging information in system logs.</p><ul><li><strong>true</strong>: Log additional debugging information is logged to the system logs.</li><li><strong>false</strong>: <strong>(Default)</strong> No Amazon S3 debugging information is included in the system logs. Typically set to <strong>false</strong> in production.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3Trace</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3TRACE</code></li></ul></td> </tr> </tbody> </table>

Select the Test Connection button in the System Console to validate the settings and ensure the user can access the server.

Amazon S3 storage class

Some Amazon S3-compatible storage solutions require the storage class parameter to be present in upload requests, otherwise they will be rejected. Configure this storage class as the storage class required by your S3-compatible solution.

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The storage class to use for uploads to S3-compatible storage solutions.</p><p>String input. Default is an empty string <code>""</code>. Select <strong>Test Connection</strong> to test the configured connection.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; File Storage</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3StorageClass</code> &gt; <code>""</code>,</li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3STORAGECLASS</code></li></ul></td> </tr> </tbody> </table> <Note>

Most Amazon S3-compatible storage solutions assign a default storage class of STANDARD when no storage class is provided. See the Amazon S3 storage class documentation for details about supported storage classes.

</Note>

Export Amazon S3 storage class

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The storage class to use for exports to S3-compatible storage solutions.</p><p>String input. Default is an empty string <code>""</code>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>ExportAmazonS3StorageClass</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_FILESETTINGS_EXPORTAMAZONS3STORAGECLASS</code></li></ul></td> </tr> </tbody> </table> <Note>

Most Amazon S3-compatible storage solutions assign a default storage class of STANDARD when no storage class is provided. See the Amazon S3 storage class documentation for details about supported storage classes.

</Note>

Amazon S3 request timeout

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>The amount of time, in milliseconds, before requests to Amazon S3 storage time out.</p><p>Default is 30000 (30 seconds).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3RequestTimeoutMilliseconds</code> &gt; <code>30000</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3REQUESTTIMEOUTMILLISECONDS</code></li></ul></td> </tr> </tbody> </table>

Amazon S3 upload part size

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>The size, in bytes, of each part in a multi-part upload to Amazon S3.</p><p>Numeric value. Default is 5242880 (5MB).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3UploadPartSizeBytes</code> &gt; <code>5242880</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3UPLOADPARTSIZEBYTES</code></li></ul></td> </tr> </tbody> </table> <Note>

A smaller part size can result in more requests and an increase in latency, while a larger part size can result in more memory being allocated.

</Note>

Amazon S3 exported upload part size

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The size, in bytes, of each part in a multi-part exported to Amazon S3.</p><p>Numeric value. Default is 104857600 (100MB).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>ExportAmazonS3UploadPartSizeBytes</code> &gt; <code>104857600</code></li><li>Environment variable: <code>MM_FILESETTINGS_EXPORTAMAZONS3UPLOADPARTSIZEBYTES</code></li></ul></td> </tr> </tbody> </table> <Note>

A smaller part size can result in more requests and an increase in latency, while a larger part size can result in more memory being allocated.

</Note>

Amazon S3 request timeout

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>The amount of time, in milliseconds, before requests to Amazon S3 storage time out.</p><p>Default is 30000 (30 seconds).</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>AmazonS3RequestTimeoutMilliseconds</code> &gt; <code>30000</code></li><li>Environment variable: <code>MM_FILESETTINGS_AMAZONS3REQUESTTIMEOUTMILLISECONDS</code></li></ul></td> </tr> </tbody> </table>

Initial font

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>The font used in auto-generated profile pictures with colored backgrounds and username initials.</p><p>A string with the font file name. Default is <strong>nunito-bold.ttf</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>InitialFont</code> &gt; <code>"nunito-bold.ttf"</code></li><li>Environment variable: <code>MM_FILESETTINGS_INITIALFONT</code></li></ul></td> </tr> </tbody> </table>

Image proxy

With self-hosted deployments, an image proxy can be used by Mattermost apps to prevent them from connecting directly to remote self-hosted servers. Configure an image proxy by going to System Console > Environment > Image Proxy, or by editing the config.json file as described in the following tables.

Enable image proxy

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td><p>An image proxy anonymizes Mattermost app connections and prevents them from accessing insecure content.</p><ul><li><strong>true</strong>: Enables an image proxy for loading external images.</li><li><strong>false</strong>: <strong>(Default)</strong> Disables the image proxy.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Image Proxy</strong></li><li><code>config.json</code> setting: <code>ImageProxySettings</code> &gt; <code>Enable</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_IMAGEPROXYSETTINGS_ENABLE</code></li></ul></td> </tr> </tbody> </table>

See the image proxy documentation to learn more.

Image proxy type

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>The type of image proxy used by Mattermost.</p><ul><li><strong>local</strong>: <strong>(Default)</strong> The Mattermost server itself acts as the image proxy.</li><li><strong>atmos/camo</strong>: An external atmos/camo image proxy is used.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Image Proxy</strong></li><li><code>config.json</code> setting: <code>ImageProxySettings</code> &gt; <code>ImageProxyType</code> &gt; <code>"local"</code></li><li>Environment variable: <code>MM_IMAGEPROXYSETTINGS_IMAGEPROXYTYPE</code></li></ul></td> </tr> </tbody> </table>

See the image proxy documentation to learn more.

Remote image proxy URL

<table> <colgroup> <col style={{width: '45%'}} /> <col style={{width: '54%'}} /> </colgroup> <tbody> <tr> <td>The URL of the atmos/camo proxy. This setting isn't needed when using the <strong>local</strong> image proxy.</td> <td><ul><li>System Config path: <strong>Environment &gt; Image Proxy</strong></li><li><code>config.json</code> setting: <code>ImageProxySettings</code> &gt; <code>RemoteImageProxyURL</code></li><li>Environment variable: <code>MM_IMAGEPROXYSETTINGS_REMOTEIMAGEPROXYURL</code></li></ul></td> </tr> </tbody> </table>

Remote image proxy options

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td>The URL signing key passed to an atmos/camo image proxy. This setting isn't needed when using the <strong>local</strong> image proxy type.</td> <td><ul><li>System Config path: <strong>Environment &gt; Image Proxy</strong></li><li><code>config.json</code> setting: <code>ImageProxySettings</code> &gt; <code>RemoteImageProxyOptions</code></li><li>Environment variable: <code>MM_IMAGEPROXYSETTINGS_REMOTEIMAGEPROXYOPTIONS</code></li></ul></td> </tr> </tbody> </table>

See the image proxy documentation to learn more.


SMTP

With self-hosted deployments, you can configure SMTP email server settings by going to System Console > Environment > SMTP, or by editing the config.json file as described in the following tables.

SMTP server

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td>The location of the SMTP email server used for email notifications.</td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>SMTPServer</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SMTPSERVER</code></li></ul></td> </tr> </tbody> </table>

SMTP server port

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>The port of SMTP email server.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>"SMTPPort"</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SMTPPORT</code></li></ul></td> </tr> </tbody> </table>

Enable SMTP authentication

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable SMTP authentication.</p><ul><li><strong>true</strong>: SMTP username and password are used for authenticating to the SMTP server.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost doesn’t attempt to authenticate to the SMTP server.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>EnableSMTPAuth</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_ENABLESMTPAUTH</code></li></ul></td> </tr> </tbody> </table>

SMTP server username

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>The username for authenticating to the SMTP server.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>SMTPUsername</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SMTPUSERNAME</code></li></ul></td> </tr> </tbody> </table>

SMTP server password

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>The password associated with the SMTP username.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>SMTPPassword</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SMTPPASSWORD</code></li></ul></td> </tr> </tbody> </table>

SMTP connection security

<table> <colgroup> <col style={{width: '47%'}} /> <col style={{width: '52%'}} /> </colgroup> <tbody> <tr> <td><p>Specify connection security for emails sent using SMTP.</p><ul><li><strong>Not specified</strong>: <strong>(Default)</strong> Send email over an unsecure connection.</li><li><strong>TLS</strong>: Communication between Mattermost and your email server is encrypted.</li><li><strong>STARTTLS</strong>: Attempts to upgrade an existing insecure connection to a secure connection using TLS.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>ConnectionSecurity</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_CONNECTIONSECURITY</code></li></ul></td> </tr> </tbody> </table>

Skip server certificate verification

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to skip the verification of the email server certificate.</p><ul><li><strong>true</strong>: Mattermost won't verify the email server certificate.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost verifies the email server certificate.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>SkipServerCertificateVerification</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SKIPSERVERCERTIFICATEVERIFICATION</code></li></ul></td> </tr> </tbody> </table>

Enable security alerts

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable security alerts.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> System admins are notified by email if a relevant security fix alert is announced. Requires email to be enabled.</li><li><strong>false</strong>: Security alerts are disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableSecurityFixAlert</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLESECURITYFIXALERT</code></li></ul></td> </tr> </tbody> </table>

See the Telemetry documentation to learn more.

SMTP server timeout

<table> <colgroup> <col style={{width: '48%'}} /> <col style={{width: '51%'}} /> </colgroup> <tbody> <tr> <td><p>The maximum amount of time, in seconds, allowed for establishing a TCP connection between Mattermost and the SMTP server.</p><p>Numerical value in seconds.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; SMTP</strong></li><li><code>config.json</code> setting: <code>EmailSettings</code> &gt; <code>SMTPServerTimeout</code></li><li>Environment variable: <code>MM_EMAILSETTINGS_SMTPSERVERTIMEOUT</code></li></ul></td> </tr> </tbody> </table>

Push notification server

<Inc0_push_notification_server_configuration_settings />


High availability

<PlanAvailability slug="ent-plus" />

With self-hosted deployments, you can configure Mattermost as a high availability cluster-based deployment by going to System Console > Environment > High Availability, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

In a Mattermost high availability cluster-based deployment, the System Console is set to read-only, and settings can only be changed by editing the config.json file directly. However, to test a high availability cluster-based environment, you can disable ClusterSettings.ReadOnlyConfig in the config.json file by setting it to false. This allows changes applied using the System Console to be saved back to the configuration file.

Enable high availability mode

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>You can enable high availability mode.</p><ul><li><strong>true</strong>: The Mattermost server will attempt inter-node communication with the other servers in the cluster that have the same cluster name. This sets the System Console to read-only mode to keep the servers' <code>config.json</code> files in sync.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost high availability mode is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>Enable</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_ENABLE</code></li></ul></td> </tr> </tbody> </table>

Cluster name

<table> <colgroup> <col style={{width: '51%'}} /> <col style={{width: '48%'}} /> </colgroup> <tbody> <tr> <td><p>The cluster to join by name in a high availability cluster-based deployment.</p><p>Only nodes with the same cluster name will join together. This is to support blue-green deployments or staging pointing to the same database.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>ClusterName</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_CLUSTERNAME</code></li></ul></td> </tr> </tbody> </table>

Override hostname

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>You can override the hostname of this server.</p><ul><li>This property can be set to a specific IP address if needed; however, we don’t recommend overriding the hostname unless it's necessary.</li><li>If left blank, Mattermost attempts to get the hostname from the operating system or uses the IP address.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>OverrideHostname</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_OVERRIDEHOSTNAME</code></li></ul></td> </tr> </tbody> </table>

See the high availability cluster-based deployment documentation for details.

Use IP address

<table> <colgroup> <col style={{width: '49%'}} /> <col style={{width: '50%'}} /> </colgroup> <tbody> <tr> <td><p>You can configure your high availability cluster-based deployment to communicate using the hostname instead of the IP address.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> The cluster attempts to communicate using the IP address specified.</li><li><strong>false</strong>: The cluster attempts to communicate using the hostname.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>UseIPAddress</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_USEIPADDRESS</code></li></ul></td> </tr> </tbody> </table>

Enable gossip encryption

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Gossip encryption uses AES-256 by default, and this value isn't configurable by design.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> The server attempts to communicate via the gossip protocol over the gossip port specified.</li><li><strong>false</strong>: The server attempts to communicate over the streaming port.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>EnableGossipEncryption</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_ENABLEGOSSIPENCRYPTION</code></li></ul></td> </tr> </tbody> </table> <Note>
  • The Gossip protocol is based on principles outlined in the SWIM protocol developed by researchers at Cornell University. The gossip protocol is a communication mechanism in distributed systems where nodes randomly exchange information to ensure data consistency across the network. It is decentralized, scalable, and fault-tolerant, making it ideal for systems with numerous nodes. Information is spread in a manner similar to social gossip, with nodes periodically "gossiping" updates to random peers until the network converges to a consistent state. Widely used in distributed databases, blockchain networks, and peer-to-peer systems, the protocol is simple to implement and resilient to node failures. However, it can suffer from redundancy and propagation delays in large networks.
  • Alternatively, you can manually set the ClusterEncryptionKey row value in the Systems table. A key is a byte array converted to base64. Set this value to either 16, 24, or 32 bytes to select AES-128, AES-192, or AES-256 respectively.
  • From Mattermost v10.11, gossip encryption is enabled by default for all new deployments. For existing deployments, all communication using the gossip protocol remains unencrypted unless you manually enable encryption. Prior to v10.11, gossip encryption is enabled by default for Cloud deployments and disabled by default for self-hosted deployments.
</Note>

Enable gossip compression

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>We recommend that you disable this configuration setting for better performance.</p><ul><li><strong>true</strong>: <strong>(Default for self-hosted deployments)</strong> All communication through the cluster uses gossip compression. This setting is enabled by default to maintain compatibility with older servers.</li><li><strong>false</strong>: <strong>(Default for Cloud deployments)</strong> All communication using the gossip protocol remains uncompressed.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>EnableGossipCompression</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_ENABLEGOSSIPCOMPRESSION</code></li></ul></td> </tr> </tbody> </table>

Gossip port

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>The port used for the gossip protocol. Both UDP and TCP should be allowed on this port.</p><p>Numerical input. Default is <strong>8074</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; High Availability</strong></li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>GossipPort</code> &gt; <code>8074</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_GOSSIPPORT</code></li></ul></td> </tr> </tbody> </table>

Read only config

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><ul><li><strong>true</strong>: <strong>(Default)</strong> Changes made to settings in the System Console are ignored.</li><li><strong>false</strong>: Changes made to settings in the System Console are written to <code>config.json</code>.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>ReadOnlyConfig</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_READONLYCONFIG</code></li></ul></td> </tr> </tbody> </table>

Network interface

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>An IP address used to identify the device that does automatic IP detection in high availability cluster-based deployments.</p><p>String input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>NetworkInterface</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_NETWORKINTERFACE</code></li></ul></td> </tr> </tbody> </table>

Bind address

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>An IP address used to bind cluster traffic to a specific network device.</p><p>This setting is used primarily for servers with multiple network devices or different Bind Address and Advertise Address like in deployments that involve NAT (Network Address Translation).</p><p>String input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>BindAddress</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_BINDADDRESS</code></li></ul></td> </tr> </tbody> </table> <table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>The IP address used to access the server from other nodes. This settings is used primary when cluster nodes are not in the same network and involve NAT (Network Address Translation).</p><p>String input.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ClusterSettings</code> &gt; <code>AdvertiseAddress</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_CLUSTERSETTINGS_ADVERTISEADDRESS</code></li></ul></td> </tr> </tbody> </table>

Rate limiting

<Inc1_rate_limiting_configuration_settings />


Logging

Mattermost provides 3 independent logging systems for self-hosted deployments that can be configured separately with separate log files and rotation policies to meet different operational and compliance needs:

By default, all Mattermost editions write logs to both the console and to the mattermost.log file in a machine-readable JSON format. Mattermost Enterprise and Professional customers can additionally log directly to syslog and TCP socket destination targets.

Log settings

Configure general logging by going to System Console > Environment > Logging, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Output logs to console

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output general logs to the console.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Output log messages are written to the console based on the <a href="#console-log-level">console log level</a> configuration. The server writes messages to the standard output stream (stdout).</li><li><strong>false</strong>: Output log messages aren’t written to the console.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableConsole</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLECONSOLE</code></li></ul></td> </tr> </tbody> </table> <Note>

From Mattermost v11.0, notification logs are automatically included in the main console logs.

</Note>

Console log level

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The level of detail in general log events written when Mattermost outputs log messages to the console.</p><ul><li><strong>DEBUG</strong>: <strong>(Default)</strong> Outputs verbose detail for developers debugging issues.</li><li><strong>ERROR</strong>: Outputs only error messages.</li><li><strong>INFO</strong>: Outputs error messages and information around startup and initialization.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>ConsoleLevel</code> &gt; <code>"DEBUG"</code></li><li>Environment variable: <code>MM_LOGSETTINGS_CONSOLELEVEL</code></li></ul></td> </tr> </tbody> </table>

Output console logs as JSON

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output general console logs as JSON.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written in a machine-readable JSON format.</li><li><strong>false</strong>: Logged events are written in plain text.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>ConsoleJson</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_CONSOLEJSON</code></li></ul></td> </tr> </tbody> </table>

Typically set to true in a production environment.

Colorize plain text console logs

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Enables system admins to display plain text general log level details in color.</p><ul><li><strong>true</strong>: When logged events are output to the console as plain text, colorize log levels details.</li><li><strong>false</strong>: <strong>(Default)</strong> Plain text log details aren't colorized in the console.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableColor</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLECOLOR</code></li></ul></td> </tr> </tbody> </table>

Output logs to file

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output general console logs to a file.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written based on the <a href="#file-log-level">file log level</a> configuration to a <code>mattermost.log</code> file located in the directory configured via <code>file location</code>.</li><li><strong>false</strong>: Logged events aren’t written to a file.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableFile</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLEFILE</code></li></ul></td> </tr> </tbody> </table> <Note>
  • From Mattermost v11.0, notification logs are automatically included in the main file logs.
  • This setting is typically set to true in a production environment. When enabled, you can download the mattermost.log file locally by going to System Console > Reporting > Server Logs, and selecting Download Logs.
</Note>

File log directory

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The location of the general log files.</p><p>String input. If left blank, log files are stored in the <code>./logs</code> directory.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>FileLocation</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_LOGSETTINGS_FILELOCATION</code></li></ul></td> </tr> </tbody> </table> <Note>
  • The path you configure must exist, and Mattermost must have write permissions for this directory.
  • From Mattermost v11.4, you can use the MM_LOG_PATH environment variable to restrict log file locations to a designated root directory. This security enhancement ensures that all log files configured via LogSettings.FileLocation or LogSettings.AdvancedLoggingJSON remain within an authorized logging directory.
    • If MM_LOG_PATH isn't set, the default logs directory is used. Paths outside the root directory generate error logs and are excluded from support packet downloads. See the log path restrictions documentation for details.
</Note>

File log level

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>The level of detail in general log events when when Mattermost outputs log messages to a file.</p><ul><li><strong>DEBUG</strong>: Outputs verbose detail for developers debugging issues.</li><li><strong>ERROR</strong>: Outputs only error messages.</li><li><strong>INFO</strong>: <strong>(Default)</strong> Outputs error messages and information around startup and initialization.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>FileLevel</code> &gt; <code>"INFO"</code></li><li>Environment variable: <code>MM_LOGSETTINGS_FILELEVEL</code></li></ul></td> </tr> </tbody> </table>

Output file logs as JSON

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output general file logs as JSON.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written in a machine-readable JSON format.</li><li><strong>false</strong>: Logged events are written in plain text.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>FileJson</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_FILEJSON</code></li></ul></td> </tr> </tbody> </table>

Typically set to true in a production environment.

Enable webhook debugging

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to capture the contents of general incoming webhooks to console and/or file logs for debugging.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> The contents of incoming webhooks are printed to log files for debugging.</li><li><strong>false</strong>: The contents of incoming webhooks aren’t printed to log files.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableWebhookDebugging</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLEWEBHOOKDEBUGGING</code></li></ul></td> </tr> </tbody> </table> <Note>

Enable debug logs by changing the file log level to DEBUG to include the request body of incoming webhooks in logs.

</Note>

Output logs to multiple targets

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to allow any combination of console, local file, syslog, and TCP socket targets, and send general log records to multiple targets.</p><p>String input can contain a filespec to another configuration file, a database DSN, or JSON.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>AdvancedLoggingJSON</code> &gt; <code>": ""</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ADVANCEDLOGGINGJSON</code></li></ul></td> </tr> </tbody> </table> <Note>
  • See the Mattermost logging documentation for details. These targets have been chosen as they support the vast majority of log aggregators, and other log analysis tools, without needing additional software installed.
  • Logs are recorded asynchronously to reduce latency to the caller.
  • Advanced logging supports hot-reloading of logger configuration.
  • From Mattermost v11.4, file paths specified in AdvancedLoggingJSON configurations should be within the directory specified by the MM_LOG_PATH environment variable. See log path restrictions for details.
</Note>

Maximum field size

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Enables system admins to limit the size of general log fields during logging.</p><p>Numerical value. Default is <strong>2048</strong>.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>MaxFieldSize</code> &gt; <code>2048</code></li><li>Environment variable: <code>MM_LOGSETTINGS_MAXFIELDSIZE</code></li></ul></td> </tr> </tbody> </table>

Enable diagnostics and error reporting

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Controls whether server errors and crashes are reported to Mattermost via Sentry.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Error and crash reports are sent to Mattermost's Sentry endpoint.</li><li><strong>false</strong>: No error or crash data is sent.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Logging</strong></li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableDiagnostics</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLEDIAGNOSTICS</code></li></ul></td> </tr> </tbody> </table> <Note>

See the telemetry documentation for details on the information Mattermost collects.

</Note>

Enable Sentry reporting

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Whether or not general error reports are sent to Sentry.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Send error reports to Sentry. Default matches the EnableDiagnostics setting.</li><li><strong>false</strong>: Error reports are not sent to Sentry.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>LogSettings</code> &gt; <code>EnableSentry</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_LOGSETTINGS_ENABLESENTRY</code></li></ul></td> </tr> </tbody> </table>

Notification logging

From Mattermost v11, notification log settings have been consolidated into the standard console logs and mattermost.log file. You can no longer disable notification logging without using advanced logging settings, as the main log level setting now controls both server and notification logs.

You can use the AdvancedLoggingJSON configuration with discrete notification log levels: NotificationError, NotificationWarn, NotificationInfo, NotificationDebug, and NotificationTrace to split notification logs into separate files and reduce troubleshooting noise. See Advanced Logging for details.

The following configuration settings apply only to Mattermost server versions prior to v11.0.

You can configure logging specifically for Mattermost notifications by editing the config.json file as described in the following tables. These settings operate independently from the main LogSettings and allow you to customize logging behavior specifically for the notification subsystem. Changes to these configuration settings require a server restart before taking effect.

Output logs to console

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output notification logs to the console.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Output log messages are written to the console based on the <a href="#console-log-level">console log level</a> configuration. The server writes messages to the standard output stream (stdout).</li><li><strong>false</strong>: Output log messages aren't written to the console.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>EnableConsole</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_ENABLECONSOLE</code></li></ul></td> </tr> </tbody> </table>

Console log level

<table> <colgroup> <col style={{width: '34%'}} /> <col style={{width: '65%'}} /> </colgroup> <tbody> <tr> <td><p>The level of detail in notification log events written when Mattermost outputs log messages to the console.</p><ul><li><strong>DEBUG</strong>: <strong>(Default)</strong> Outputs verbose detail for developers debugging issues.</li><li><strong>ERROR</strong>: Outputs only error messages.</li><li><strong>INFO</strong>: Outputs error messages and information around startup and initialization.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>ConsoleLevel</code> &gt; <code>"DEBUG"</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_CONSOLELEVEL</code></li></ul></td> </tr> </tbody> </table>

Output console logs as JSON

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output notification console logs as JSON.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written in a machine-readable JSON format.</li><li><strong>false</strong>: Logged events are written in plain text.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>ConsoleJson</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_CONSOLEJSON</code></li></ul></td> </tr> </tbody> </table>

Typically set to true in a production environment.

Colorize plain text console logs

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Enables system admins to display plain text notification log level details in color.</p><ul><li><strong>true</strong>: When logged events are output to the console as plain text, colorize log levels details.</li><li><strong>false</strong>: <strong>(Default)</strong> Plain text log details aren't colorized in the console.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>EnableColor</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_ENABLECOLOR</code></li></ul></td> </tr> </tbody> </table>

Output logs to file

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output notification console logs to a file.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written based on the <a href="#file-log-level">file log level</a> configuration to a <code>notifications.log</code> file located in the directory configured via <code>file location</code>.</li><li><strong>false</strong>: Logged events aren't written to a file.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>EnableFile</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_ENABLEFILE</code></li></ul></td> </tr> </tbody> </table>

File log directory

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>The location of the notification log files.</p><p>String input. If left blank, log files are stored in the <code>./logs</code> directory.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>FileLocation</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_FILELOCATION</code></li></ul></td> </tr> </tbody> </table> <Note>

The path you configure must exist, and Mattermost must have write permissions for this directory.

</Note>

File log level

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>The level of detail in notification log events when Mattermost outputs log messages to a file.</p><ul><li><strong>DEBUG</strong>: Outputs verbose detail for developers debugging issues.</li><li><strong>ERROR</strong>: Outputs only error messages.</li><li><strong>INFO</strong>: <strong>(Default)</strong> Outputs error messages and information around startup and initialization.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>FileLevel</code> &gt; <code>"INFO"</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_FILELEVEL</code></li></ul></td> </tr> </tbody> </table>

Output file logs as JSON

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to output notification file logs as JSON.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Logged events are written in a machine-readable JSON format.</li><li><strong>false</strong>: Logged events are written in plain text.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>FileJson</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_FILEJSON</code></li></ul></td> </tr> </tbody> </table>

Output logs to multiple targets

<table> <colgroup> <col style={{width: '33%'}} /> <col style={{width: '66%'}} /> </colgroup> <tbody> <tr> <td><p>Configure Mattermost to allow any combination of console, local file, syslog, and TCP socket targets, and send notification log records to multiple targets.</p><p>String input can contain a filespec to another configuration file, a database DSN, or JSON.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>NotificationLogSettings</code> &gt; <code>AdvancedLoggingJSON</code> &gt; <code>": ""</code></li><li>Environment variable: <code>MM_NOTIFICATIONLOGSETTINGS_ADVANCEDLOGGINGJSON</code></li></ul></td> </tr> </tbody> </table>

Audit logging

<PlanAvailability slug="ent-plus" />

Configure audit logging by going to System Console > Compliance > Audit Logging, or by editing the config.json file as described in the following tables. These settings operate independently from the main LogSettings and allow you to customize logging behavior specifically for the audit subsystem. Changes to these configuration settings require a server restart before taking effect.

Output audit logs to file

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Whether to write audit log files to disk.</p><ul><li><strong>true</strong>: Logged events are written to the file specified by the audit file name configuration setting.</li><li><strong>false</strong>: <strong>(Default)</strong> Audit log files aren't written.</li></ul></td> <td><ul><li>System Config path: <strong>Compliance &gt; Audit Logging</strong></li><li><code>config.json</code> setting: <code>ExperimentalAuditSettings</code> &gt; <code>FileEnabled</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_EXPERIMENTALAUDITSETTINGS_FILEENABLED</code></li></ul></td> </tr> </tbody> </table> <Note>

When FileEnabled is set to true, then the audit file name must be set.

</Note>

Audit file name

<table> <colgroup> <col style={{width: '37%'}} /> <col style={{width: '62%'}} /> </colgroup> <tbody> <tr> <td><p>The name of the audit log files.</p><p>The path that you set to the audit file must exist and Mattermost must have write permissions in it.</p><p><strong>Example:</strong> <code>/var/log/mattermost_audit.log</code></p></td> <td><ul><li>System Config path: <strong>Compliance &gt; Audit Logging</strong></li><li><code>config.json</code> setting: <code>ExperimentalAuditSettings</code> &gt; <code>FileName</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_EXPERIMENTALAUDITSETTINGS_FILENAME</code></li></ul></td> </tr> </tbody> </table> <Note>

When output audit logs to file is enabled, the file name must be set. To configure file rotation and advanced audit log output, use the AdvancedLoggingJSON setting.

</Note>

Audit log certificate

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Certificate configuration for audit logging.</p><p>String input. Default is blank.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ExperimentalAuditSettings</code> &gt; <code>Certificate</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_EXPERIMENTALAUDITSETTINGS_CERTIFICATE</code></li></ul></td> </tr> </tbody> </table>

Output audit logs to multiple targets

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td>Configures Mattermost to output audit log records to multiple targets.</td> <td><ul><li>System Config path: <strong>Compliance &gt; Audit Logging</strong></li><li><code>config.json</code> setting: <code>ExperimentalAuditSettings</code> &gt; <code>AdvancedLoggingJSON</code> &gt; <code>&#123;&#125;</code></li><li>Environment variable: <code>MM_EXPERIMENTALAUDITSETTINGS_ADVANCEDLOGGINGJSON</code></li></ul></td> </tr> </tbody> </table> <Note>
  • See the Mattermost logging documentation for details on advanced logging configuration. These targets have been chosen as they support the vast majority of log aggregators, and other log analysis tools, without needing additional software installed.
  • Audit logs are recorded asynchronously to reduce latency to the caller.
  • Advanced audit logging supports hot-reloading of logger configuration.
</Note>

Session lengths

With self-hosted deployments, user sessions are cleared when a user tries to log in, and sessions are cleared every 24 hours from the sessions database table. Configure session lengths by going to System Console > Environment > Session Lengths, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Extend session length with activity

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Improves the user experience by extending sessions and keeping users logged in if they are active in their Mattermost apps.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Sessions are automatically extended when users are active in their Mattermost client. User sessions only expire when users aren’t active in their Mattermost client for the entire duration of the session lengths defined.</li><li><strong>false</strong>: Sessions won't extend with activity in Mattermost. User sessions immediately expire at the end of the session length or based on the <a href="#session-idle-timeout">session idle timeout</a> configured.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>ExtendSessionLengthWithActivity</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_EXTENDSESSIONLENGTHWITHACTIVITY</code></li></ul></td> </tr> </tbody> </table>

Terminate sessions on password change

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable session revocation when a user's password changes.</p><ul><li><strong>true</strong>: <strong>(Default for new deployments)</strong> Session revocation is enabled. All sessions of a user expire if their password is changed (by themselves or by a system admin). If the password change is initiated by the user, their current session isn't terminated.</li><li><strong>false</strong>: <strong>(Default for existing deployments)</strong> Session revocation is disabled. When users change their password, only the user's current session is revoked. When a system admin changes the user's password, none of the user's sessions are revoked.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>TerminateSessionsOnPasswordChange</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_TERMINATESESSIONSONPASSWORDCHANGE</code></li></ul></td> </tr> </tbody> </table>

Session length for AD/LDAP and email

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Set the number of hours counted from the last time a user entered their credentials into the web app or the desktop app to the expiry of the user’s session on email and AD/LDAP authentication.</p><p>Numerical input in hours. Default is <strong>720</strong> hours.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SessionLengthWebInHours</code> &gt; <code>720</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SESSIONLENGTHWEBINHOURS</code></li></ul></td> </tr> </tbody> </table> <Note>

After changing this setting, the new session length takes effect after the next time the user enters their credentials.

</Note>

Session length for mobile

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Set the number of hours counted from the last time a user entered their credential into the mobile app to the expiry of the user’s session.</p><p>Numerical input in hours. Default is <strong>720</strong> hours.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SessionLengthMobileInHours</code> &gt; <code>720</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SESSIONLENGTHMOBILEINHOURS</code></li></ul></td> </tr> </tbody> </table> <Note>

After changing this setting, the new session length takes effect after the next time the user enters their credentials.

</Note>

Session length for SSO

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Set the number of hours from the last time a user entered their SSO credentials to the expiry of the user’s session. This setting defines the session length for SSO authentication, such as SAML, GitLab, and OAuth 2.0.</p><p>Numerical input in hours. Default is <strong>720</strong> hours. Numbers as decimals are also valid values for this configuration setting.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SessionLengthSSOInHours</code> &gt; <code>720</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SESSIONLENGTHSSOINHOURS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • After changing this setting, the new session length takes effect after the next time the user enters their credentials.
  • If the authentication method is SAML, GitLab, or OAuth 2.0, users may automatically be logged back in to Mattermost if they are already logged in to SAML, GitLab, or with OAuth 2.0.
</Note>

Session cache

<table> <colgroup> <col style={{width: '43%'}} /> <col style={{width: '56%'}} /> </colgroup> <tbody> <tr> <td><p>Set the number of minutes to cache a session in memory.</p><p>Numerical input in minutes. Default is <strong>10</strong> minutes.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Session Lengths</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SessionCacheInMinutes</code> &gt; <code>10</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SESSIONCACHEINMINUTES</code></li></ul></td> </tr> </tbody> </table>

Session idle timeout

<table> <colgroup> <col style={{width: '40%'}} /> <col style={{width: '59%'}} /> </colgroup> <tbody> <tr> <td><p>The number of minutes from the last time a user was active on the system to the expiry of the user’s session. Once expired, the user will need to log in to continue.</p><p>Numerical input in minutes. Default is <strong>43200</strong> (30 days). Minimum value is <strong>5</strong> minutes, and a value of <strong>0</strong> sets the time as unlimited.</p></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>SessionIdleTimeoutInMinutes</code> &gt; <code>43200</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_SESSIONIDLETIMEOUTINMINUTES</code></li></ul></td> </tr> </tbody> </table> <Note> </Note>

Performance monitoring

<PlanAvailability slug="entry-ent" />

With self-hosted deployments, you can configure performance monitoring by going to System Console > Environment > Performance Monitoring, or by editing the config.json file as described in the following tables.

json
{
  "MetricsSettings": {
    "Enable": false,
    "BlockProfileRate": 0,
    "ListenAddress": :8067,
    "EnableClientMetrics": false,
    "EnableNotificationMetrics": true,
    "ClientSideUserIds": ""
  }
}

Changes to configuration settings in this section require a server restart before taking effect.

See the performance monitoring documentation to learn more about setting up performance monitoring with Prometheus and Grafana. See the collect performance metrics documentation to learn more about using the Mattermost Metrics plugin.

Enable performance monitoring

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable performance monitoring.</p><ul><li><strong>true</strong>: Performance monitoring data collection and profiling is enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost performance monitoring is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Performance Monitoring</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>Enable</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_ENABLE</code></li></ul></td> </tr> </tbody> </table>

See the performance monitoring documentation to learn more.

Enable client performance monitoring

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable client performance monitoring.</p><ul><li><strong>true</strong>: Client performance monitoring data collection and profiling is enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Mattermost client performance monitoring is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Performance Monitoring</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>EnableClientMetrics</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_ENABLECLIENTMETRICS</code></li></ul></td> </tr> </tbody> </table>

Client side user ids

<table> <colgroup> <col style={{width: '46%'}} /> <col style={{width: '53%'}} /> </colgroup> <tbody> <tr> <td><p>A list of comma-separated user IDs you want to track for client-side webapp metrics.</p><p>Limited to 5 user IDs. Blank by default.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Performance Monitoring</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>ClientSideUserIds</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_CLIENTSIDEUSERIDS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • This setting only applies when EnableClientMetrics is set to true.
  • Each user ID should correspond to a valid user in the Mattermost system. For example, MM_METRICSSETTINGS_CLIENTSIDEUSERIDS="user1,user2,user3".
  • The total number of user IDs is limited to 5 to ensure performance. Adding more IDs can overwhelm Prometheus due to high label cardinality. To avoid performance issues, we recommend minimizing changes to this list.
</Note>

Listen address

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>The port the Mattermost server will listen on to expose performance metrics, when enabled.</p><p>Numerical input. Default is <strong>8067</strong>.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Performance Monitoring</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>ListenAddress</code> &gt; <code>8067</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_LISTENADDRESS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • ListenAddress accepts a port only. It doesn’t take an IP/host. If you need to restrict interfaces, do so via your OS firewall or reverse proxy.
  • The address uses a host:port format. Use :8067 to listen on all interfaces on port 8067, or use localhost:8067 to restrict to localhost only.
</Note>

Block profile rate

<table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><p>Control how often Mattermost collects data about delays caused by blocking operations within Mattermost (such as when one part of the program has to wait for another). Default is <strong>0</strong> (profiling is disabled).</p><p>The profiler aims to sample an average of one blocking event per rate nanoseconds spent blocked.</p><p>Default is <strong>0</strong>.</p></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>BlockProfileRate</code> &gt; <code>0</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_BLOCKPROFILERATE</code></li></ul></td> </tr> </tbody> </table> <Note>
  • This setting isn't available in the System Console and can only be set in config.json.
  • Only adjust this if you’re diagnosing performance issues and know how to analyze profiling data. The value represents how frequently Mattermost records blocking events in its performance profile:
    • Set to 0 to record no blocking events (profiling is disabled).
    • Set to 1 to record every blocking event (profiling is fully enabled).
    • Set to a higher number to record only a fraction of events (useful for sampling instead of full profiling).
</Note>

Enable notification monitoring

<table> <colgroup> <col style={{width: '32%'}} /> <col style={{width: '67%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable notification metrics data collection.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Mattermost notification data collection is enabled for client-side web and desktop app users.</li><li><strong>false</strong>: Mattermost notification data collection is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Site Configuration &gt; Notifications</strong></li><li><code>config.json</code> setting: <code>MetricsSettings</code> &gt; <code>EnableNotificationMetrics</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_METRICSSETTINGS_ENABLENOTIFICATIONMETRICS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • MetricsSettings.Enable must be set to true
  • MetricsSettings.EnableNotificationMetrics must be set to true
</Note>

See the performance monitoring documentation to learn more about Mattermost Notification Health metrics.


Developer

With self-hosted deployments, you can configure developer mode by going to System Console > Environment > Developer, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Enable testing commands

<table> <colgroup> <col style={{width: '39%'}} /> <col style={{width: '60%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable the <code>/test</code> slash command.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> The <code>/test</code> slash command is enabled to load test accounts and test data. Use this setting only in isolated non-production environments and never in production.</li><li><strong>false</strong>: The <code>/test</code> slash command is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Developer</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableTesting</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLETESTING</code></li></ul></td> </tr> </tbody> </table>

Enable developer mode

<table> <colgroup> <col style={{width: '36%'}} /> <col style={{width: '63%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable developer mode.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Javascript errors are shown in a banner at the top of Mattermost the user interface. Not recommended for use in production.</li><li><strong>false</strong>: Users are not alerted to Javascript errors.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Developer</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableDeveloper</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLEDEVELOPER</code></li></ul></td> </tr> </tbody> </table>

Enable client debugging

<table> <colgroup> <col style={{width: '34%'}} /> <col style={{width: '65%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable client-side debugging settings found in <strong>Settings &gt; Advanced &gt; Debugging</strong> for individual users.</p><ul><li><strong>true</strong>: Those settings are visible and can be enabled by users.</li><li><strong>false</strong>: <strong>(Default)</strong> Those settings are hidden and disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Developer</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableClientPerformanceDebugging</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLECLIENTPERFORMANCEDEBUGGING</code></li></ul></td> </tr> </tbody> </table>

See the client debugging documentation to learn more.

Allow untrusted internal connections

<Warning>

This setting is intended to prevent users located outside your local network from using the Mattermost server to request confidential data from inside your network. Care should be used when configuring this setting to prevent unintended access to your local network.

</Warning> <table> <colgroup> <col style={{width: '32%'}} /> <col style={{width: '67%'}} /> </colgroup> <tbody> <tr> <td>Limit the ability for the Mattermost server to make untrusted requests within its local network. A request is considered “untrusted” when it’s made on behalf of a client.</td> <td><ul><li>System Config path: <strong>Environment &gt; Developer</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>AllowedUntrustedInternalConnections</code> &gt; <code>""</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ALLOWEDUNTRUSTEDINTERNALCONNECTIONS</code></li></ul></td> </tr> </tbody> </table>

This setting is a whitelist of local network addresses that can be requested by the Mattermost server. It’s configured as a whitespace-separated list of hostnames, IP addresses, and CIDR ranges that can be accessed.

Requests that can only be configured by system admins are considered trusted and won't be affected by this setting. Trusted URLs include ones used for OAuth login or for sending push notifications.

The following features make untrusted requests and are affected by this setting:

  • Integrations using webhooks, slash commands, or message actions. This prevents them from requesting endpoints within the local network.
  • Link previews. When a link to a local network address is posted in a chat message, this prevents a link preview from being displayed.
  • The local image proxy. If the local image proxy is enabled, images located on the local network cannot be used by integrations or posted in chat messages.

Some examples of when you may want to modify this setting include:

  • When installing a plugin that includes its own images, such as Matterpoll, you'll need to add the Mattermost server’s domain name to this list.
  • When running a bot or webhook-based integration on your local network, you’ll need to add the hostname of the bot/integration to this list.
  • If your network is configured in such a way that publicly-accessible web pages or images are accessed by the Mattermost server using their internal IP address, the hostnames for those servers must be added to this list.
<Note>
  • The public IP of the Mattermost application server itself is also considered a reserved IP.
  • Use whitespaces instead of commas to list the hostnames, IP addresses, or CIDR ranges. For example: webhooks.internal.example.com, 127.0.0.1, or 10.0.16.0/28.
  • IP address and domain name rules are applied before host resolution.
  • CIDR rules are applied after host resolution, and only CIDR rules require DNS resolution.
  • Mattermost attempts to match IP addresses and hostnames without even resolving. If that fails, Mattermost resolve using the local resolver (by reading the /etc/hosts file first), then checking for matching CIDR rules. For example, if the domain “webhooks.internal.example.com” resolves to the IP address 10.0.16.20, a webhook with the URL https://webhooks.internal.example.com/webhook can be whitelisted using webhooks.internal.example.com, or 10.0.16.16/28, but not 10.0.16.20.
</Note>

Mobile security

<PlanAvailability slug="ent-adv" />

From Mattermost v10.7 and mobile app v2.27, you can configure biometric authentication, prevent Mattermost use on jailbroken or rooted devices, and can block screen captures without relying on an EMM Provider. Configure these options by going to System Console > Environment > Mobile Security, or by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart and require users to restart their mobile app or log out and back in before taking effect.

Enable biometric authentication

<table> <colgroup> <col style={{width: '34%'}} /> <col style={{width: '65%'}} /> </colgroup> <tbody> <tr> <td><p>Enforce biometric authentication, with PIN/passcode fallback, before accessing the app. Users will be prompted based on session activity and server switching rules.</p><ul><li><strong>true</strong>: Biometric authentication is enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Biometric authentication is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileEnableBiometrics</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEENABLEBIOMETRICS</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Changing this configuration setting takes effect when mobile users restart their Mattermost mobile app or log out and log back in.
  • Users must authenticate in the following situations:
    • Adding a new server: When a new server is added to the mobile app and biometric authentication is enabled.
    • Opening the mobile app: At app launch when the active server requires authentication.
    • Returning after background use: After the app has been in the background for 5 minutes or more and the active server requires authentication.
    • Using multiple servers: When accessing a server for the first time, after 5 minutes of inactivity on a server, and when the last authentication attempt fails.
</Note>

Enable jailbreak/root protection

<table> <colgroup> <col style={{width: '33%'}} /> <col style={{width: '66%'}} /> </colgroup> <tbody> <tr> <td><p>Prevent access to the app on devices detected as jailbroken or rooted. If a device fails the security check, users will be denied access or prompted to switch to a compliant server.</p><ul><li><strong>true</strong>: Jailbreak/Root protection is enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Jailbreak/Root protection is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileJailbreakProtection</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEJAILBREAKPROTECTION</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Changing this configuration setting takes effect when mobile users restart their Mattermost mobile app or log out and log back in.
  • See the Expo SDK documentation to learn more about how checks are performed for this functionality.
</Note>

Prevent screen capture

<table> <colgroup> <col style={{width: '33%'}} /> <col style={{width: '66%'}} /> </colgroup> <tbody> <tr> <td><p>Block screenshots and screen recordings when using the mobile app. Screenshots will appear blank, and screen recordings will blur (iOS) or show a black screen (Android). Also applies when switching apps.</p><ul><li><strong>true</strong>: Screen capture blocking is enabled.</li><li><strong>false</strong>: <strong>(Default)</strong> Screen capture blocking is disabled.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobilePreventScreenCapture</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEPREVENTSCREENCAPTURE</code></li></ul></td> </tr> </tbody> </table> <Note>

Changing this configuration setting takes effect when mobile users restart their Mattermost mobile app or log out and log back in.

</Note>

Mobile ephemeral mode

<PlanAvailability slug="ent-adv" />

See mobile security features for a full description of how the timers and operations interact.

These settings apply globally to all mobile users. Changes are delivered to connected devices in real time; offline devices continue operating under their last-known configuration until they reconnect. Timer state persists across app and device restarts.

When a timer expires, active cached content such as posts and file previews is purged, and the app notifies the user that data was removed due to policy enforcement. After a purge, users re-sync from the server on reconnection — server URLs are recoverable from keychain entries so server access is not lost.

Enable Mobile Ephemeral Mode

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '49%'}} /> </colgroup> <tbody> <tr> <td><p>Controls whether mobile clients enforce the server-configured ephemeral data policies.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Ephemeral data policies are enforced.</li><li><strong>false</strong>: Ephemeral data policies are not enforced on mobile clients.</li></ul></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileEnableEphemeralMode</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEENABLEEPHEMERALMODE</code></li></ul></td> </tr> </tbody> </table>

Disconnection timeout

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '49%'}} /> </colgroup> <tbody> <tr> <td><p>Grace period in seconds after the WebSocket drops before the device is considered offline. Once elapsed, the Offline Persistence Timer begins counting down.</p><p>Numerical input in seconds. Default is <strong>60</strong>. Values below 5 are not recommended.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileDisconnectionTimeoutSeconds</code> &gt; <code>60</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEDISCONNECTIONTIMEOUTSECONDS</code></li></ul></td> </tr> </tbody> </table>

Offline persistence timer

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '49%'}} /> </colgroup> <tbody> <tr> <td><p>How long cached content is retained after the device is considered offline, in hours.</p><p>Numerical input in hours. Default is <strong>2</strong>. Set to <strong>0</strong> for immediate purge on disconnect.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileOfflinePersistenceTimerHours</code> &gt; <code>2</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEOFFLINEPERSISTENCETIMERHOURS</code></li></ul></td> </tr> </tbody> </table>

Auto cache cleanup

<table> <colgroup> <col style={{width: '50%'}} /> <col style={{width: '49%'}} /> </colgroup> <tbody> <tr> <td><p>Maximum age in days for content cached on the device, regardless of connection status.</p><p>Numerical input in days. Default is <strong>7</strong>. Set to <strong>0</strong> for zero-persistence mode.</p></td> <td><ul><li>System Config path: <strong>Environment &gt; Mobile Security</strong></li><li><code>config.json</code> setting: <code>NativeAppSettings</code> &gt; <code>MobileAutoCacheCleanupDays</code> &gt; <code>7</code></li><li>Environment variable: <code>MM_NATIVEAPPSETTINGS_MOBILEAUTOCACHECLEANUPDAYS</code></li></ul></td> </tr> </tbody> </table>

Enable secure file preview on mobile

This setting improves an organization's mobile security posture by restricting file access while still allowing essential file viewing capabilities.

<table> <colgroup> <col style={{width: '100%'}} /> </colgroup> <tbody> <tr> <td><ul><li><strong>true</strong>: Prevents file downloads, previews, and sharing for most file types, | - System Config path: <strong>Site Configuration &gt; File sharing and downloads</strong> | even when the | - <code>config.json</code> setting: <code>FileSettings</code> &gt; <code>MobileEnableSecureFilePreview</code> &gt; <code>false</code> | <a href="mm-ref:administration-guide%2Fconfigure%2Fsite-configuration-settings%3Aallow%20file%20downloads%20on%20mobile">Allow file downloads on mobile</a> | - Environment variable: <code>MM_FILESETTINGS_MOBILEENABLESECUREFILEPREVIEW</code> configuration setting is enabled. Allows in-app previews for PDFs, | | videos, and images only. Files are stored temporarily in the app's cache and cannot be exported or shared. | |</li><li><strong>false</strong>: <strong>(Default)</strong> Secure file preview mode is disabled. | |</li></ul></td> </tr> </tbody> </table> <Note>

Changing this configuration setting takes effect when mobile users restart their Mattermost mobile app or log out and log back in.

</Note> <table> <colgroup> <col style={{width: '44%'}} /> <col style={{width: '55%'}} /> </colgroup> <tbody> <tr> <td><ul><li><strong>true</strong>: <strong>(Default)</strong> Enables tapping links inside PDFs on mobile when Secure File Preview Mode is active. Links will open in the device browser or supported app.</li><li><strong>false</strong>: Disables link navigation in PDFs when Secure File Preview Mode is active.</li></ul></td> <td><ul><li>System Config path: <strong>Site Configuration &gt; File sharing and downloads</strong></li><li><code>config.json</code> setting: <code>FileSettings</code> &gt; <code>MobileAllowPdfLinkNavigation</code> &gt; <code>true</code></li><li>Environment variable: <code>MM_FILESETTINGS_MOBILEALLOWPDFLINKNAVIGATION</code></li></ul></td> </tr> </tbody> </table> <Note>
  • Changing this configuration setting takes effect when mobile users restart their Mattermost mobile app or log out and log back in.
  • This setting has no effect when the Secure file preview on mobile configuration setting is disabled.
</Note>

config.json-only settings

The following self-hosted deployment settings are only configurable in the config.json file and are not available in the System Console.

Disable Customer Portal requests

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Enable or disable customer portal requests.</p><ul><li><strong>true</strong>: <strong>(Default)</strong> Server-side requests made to the customer portal are disabled.</li><li><strong>false</strong>: Server-side requests made to the Mattermost Customer Portal are enabled, but will always fail in air-gapped and restricted deployment environments.</li></ul></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CloudSettings</code> &gt; <code>Disable</code> &gt; <code>true,</code></li><li>Environment variable: <code>MM_CLOUDSETTINGS_DISABLE</code></li></ul></td> </tr> </tbody> </table> <Note>

Cloud admins can’t modify this configuration setting.

</Note>

Enable API team deletion

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Allow permanent team deletion via API.</p><ul><li><strong>true</strong>: Team and system admins (or users with appropriate permissions) can call <code>api/v4/teams/&#123;teamid&#125;?permanent=true</code> or use <code>mmctl team delete</code> to permanently delete a team.</li><li><strong>false</strong>: <strong>(Default)</strong> Endpoint not available; <code>api/v4/teams/&#123;teamid&#125;</code> still soft deletes a team.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableAPITeamDeletion</code> &gt; <code>false</code></li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <Note>

This setting isn’t available in the System Console and can only be set in config.json.

</Note>

Enable API user deletion

<table> <colgroup> <col style={{width: '42%'}} /> <col style={{width: '57%'}} /> </colgroup> <tbody> <tr> <td><p>Allow permanent user deletion via API.</p><ul><li><strong>true</strong>: System admins (or users with appropriate permissions) can call <code>api/v4/users/&#123;userid&#125;?permanent=true</code> or use <code>mmctl user delete</code> to permanently delete a user.</li><li><strong>false</strong>: <strong>(Default)</strong> Endpoint not available; <code>api/v4/users/&#123;userid&#125;</code> still soft deletes a user.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableAPIUserDeletion</code> &gt; <code>false</code></li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <Note>

This setting isn’t available in the System Console and can only be set in config.json.

</Note>

Enable API channel deletion

<table> <colgroup> <col style={{width: '41%'}} /> <col style={{width: '58%'}} /> </colgroup> <tbody> <tr> <td><p>Allow permanent channel deletion via API.</p><ul><li><strong>true</strong>: System admins (or users with appropriate permissions) can call <code>api/v4/channels/&#123;channelid&#125;?permanent=true</code> or use <code>mmctl channel delete</code> to permanently delete a channel.</li><li><strong>false</strong>: <strong>(Default)</strong> Endpoint not available; <code>api/v4/channels/&#123;channelid&#125;</code> still soft deletes a channel.</li></ul></td> <td><ul><li>System Config path: N/A</li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableAPIChannelDeletion</code> &gt; <code>false</code></li><li>Environment variable: N/A</li></ul></td> </tr> </tbody> </table> <Note>

This setting isn’t available in the System Console and can only be set in config.json.

</Note>

Enable desktop app developer mode

From Desktop App v5.10, this setting enables developer debugging options available by going to the View > Developer Tools menu in the Mattermost desktop app.

This setting isn't available in the System Console and can only be enabled in config.json by setting the environment variable MM_DESKTOP_DEVELOPER_MODE to true. This setting is disabled by default.

  • True: Unlocks the following options in the Desktop App for the purposes of troubleshooting and debugging. You should only enable this setting if instructed to by a Mattermost developer:
    • Browser Mode Only: Completely disables the preload script and stops web app components from knowing they're in the desktop app. This option should be the best indicator of whether a web app component is causing performance and/or memory retention issues. This option disables notifications, cross-tab navigation, unread/mentions badges, the calls widget, and breaks resizing on macOS.
    • Disable Notification Storage: Turns off maps that hold references to unread notifications until they've been selected & read. This option is good for debugging in cases where Mattermost is holding onto too many references to unused notifications.
    • Disable User Activity Monitor: Turns off the interval that checks whether the user is away or not. This option is good for debugging whether a user's availability status is causing unexpected desktop app behavior.
    • Disable Context Menu: Turns off the context menu attached to the BrowserViews. This option is good as a library santity check.
    • Force Legacy Messaging API: Forces the app to revert back to the old messaging API instead of the newer contextBridge API. This option is a good santity check to confirm whether the new API is responsible for holding onto memory.
    • Force New Messaging API: Forces the app to use the contextBridge API and completely disables the legacy one. This option forces off listeners for the legacy API.
  • False: (Default) Developer debugging options are locked and unavailable in the Desktop App.

Redis cache backend

<PlanAvailability slug="ent-adv" />

From Mattermost v10.4, Mattermost Enterprise customers with self-hosted deployments can configure Redis (Remote Dictionary Server) as an alternative cache backend. Redis is an open-source, in-memory data structure store that can be used as a database, cache, and message broker. It supports various data structures and is a top choice for its performance because its able to store data in memory and provide very quick data access.

Using Redis as a caching solution can help ensure that Mattermost for enterprise-level deployments with high concurrency and large user bases remains performant and efficient, even under heavy usage.

Configure a Redis cache by editing the config.json file as described in the following tables. Changes to configuration settings in this section require a server restart before taking effect.

Cache type

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>Define the cache type.</p><ul><li><strong>lru</strong>: <strong>(Default)</strong> Mattermost uses the in-memory cache store.</li><li><strong>redis</strong>: Mattermost uses the configured Redis cache store.</li></ul></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>CacheType,</code> &gt; <code>lru</code></li><li>Environment variable: <code>MM_CACHESETTINGS_CACHETYPE</code></li></ul></td> </tr> </tbody> </table>

Redis address

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The hostname of the Redis host.</p><p>String input.</p></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>RedisAddress,</code></li><li>Environment variable: <code>MM_CACHESETTINGS_REDISADDRESS</code></li></ul></td> </tr> </tbody> </table>

Redis password

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The password of the Redis host.</p><p>String input. Leave blank if there is no password.</p></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>RedisPassword,</code></li><li>Environment variable: <code>MM_CACHESETTINGS_REDISPASSWORD</code></li></ul></td> </tr> </tbody> </table>

Redis database

<table> <colgroup> <col style={{width: '38%'}} /> <col style={{width: '61%'}} /> </colgroup> <tbody> <tr> <td><p>The database of the Redis host.</p><p>Zero-indexed number up to 15. Typically set to <code>0</code>. Redis allows a maximum of 16 databases.</p></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>RedisDB,</code></li><li>Environment variable: <code>MM_CACHESETTINGS_REDISDB</code></li></ul></td> </tr> </tbody> </table>

Disable client cache

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Disables the client-side cache of Redis.</p><ul><li><strong>true</strong>: Client-side cache of Redis is disabled. Typically used as a test option, and not in production environments.</li><li><strong>false</strong>: <strong>(Default)</strong> Client-side cache of Redis is enabled.</li></ul></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>DisableClientCache,</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_CACHESETTINGS_REDISDB</code></li></ul></td> </tr> </tbody> </table>

Redis cache prefix

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td>Adds a prefix to all Redis cache keys.</td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>CacheSettings</code> &gt; <code>RedisCachePrefix</code></li><li>Environment variable: <code>MM_CACHESETTINGS_REDISCACHEPREFIX</code></li></ul></td> </tr> </tbody> </table> <Tip>

Adding a prefix to all Redis cache keys reduces key collisions, simplifies debugging, isolates data, and provides a clear structure for managing and scaling Redis-based systems. In environments where multiple systems or tenants use the same Redis instance, prefixes become critical for maintaining data integrity and operational efficiency.

</Tip>

Enable webhub channel iteration

<table> <colgroup> <col style={{width: '35%'}} /> <col style={{width: '64%'}} /> </colgroup> <tbody> <tr> <td><p>Control the performance of websocket broadcasting in channels.</p><p>When enabled, improves websocket broadcasting performance; however, performance may decrease when users join or leave a channel.</p><p>Not recommended unless you have at least 200,000 concurrent users actively using Mattermost.</p><p>Disabled by default.</p></td> <td><ul><li>System Config path: <strong>N/A</strong></li><li><code>config.json</code> setting: <code>ServiceSettings</code> &gt; <code>EnableWebHubChannelIteration,</code> &gt; <code>false</code></li><li>Environment variable: <code>MM_SERVICESETTINGS_ENABLEWEBHUBCHANNELITERATION</code></li></ul></td> </tr> </tbody> </table>

Enable dedicated export filestore target

<table> <colgroup> <col style={{width: '100%'}} /> </colgroup> <tbody> <tr> <td>Enables the ability to specify an alternate filestore | - System Config path: <strong>N/A</strong> | target for Mattermost | - <code>config.json</code> setting: <code>FileSettings</code> &gt; <code>DedicatedExportStore</code> | <a href="mm-doc:%2Fadministration-guide%2Fmanage%2Fbulk-export-tool">bulk exports</a> and | - Environment variable: <code>MM_FILESETTINGS_DEDICATEDEXPORTSTORE</code> | <a href="mm-doc:%2Fadministration-guide%2Fcomply%2Fcompliance-export">compliance exports</a>. | | | | - <strong>True</strong>: A new <code>ExportFileBackend()</code> is generated | | under <code>FileSettings</code> using new configuration values | | for the following configuration settings: | | | | - <code>ExportDriverName</code> | | - <code>ExportDirectory</code> | | - <code>ExportAmazonS3AccessKeyId</code> | | - <code>ExportAmazonS3SecretAccessKey</code> | | - <code>ExportAmazonS3Bucket</code> | | - <code>ExportAmazonS3PathPrefix</code> | | - <code>ExportAmazonS3Region</code> | | - <code>ExportAmazonS3Endpoint</code> | | - <code>ExportAmazonS3SSL</code> | | - <code>ExportAmazonS3SignV2</code> | | - <code>ExportAmazonS3SSE</code> | | - <code>ExportAmazonS3Trace</code> | | - <code>ExportAmazonS3RequestTimeoutMilliseconds</code> | | - <code>ExportAmazonS3PresignExpiresSeconds</code> | | | | - <strong>False</strong>: (<strong>Default</strong>) Standard | | <a href="mm-ref:administration-guide%2Fconfigure%2Fenvironment-configuration-settings%3Afile%20storage">file storage | |</a> | is used. Standard file storage will also be used when the configuration setting | | or value is omitted. | |</td> </tr> </tbody> </table> <Note>
  • When an alternate filestore target is configured, Mattermost Cloud admins can generate an S3 presigned URL for exports using the /exportlink [job-id|zip file|latest] slash command. See the Mattermost data migration documentation for details. Alternatively, Cloud and self-hosted admins can use the mmctl export generate-presigned-url command to generate a presigned URL directly from mmctl.
  • Generating an S3 presigned URL requires the feature flag EnableExportDirectDownload to be set to true, the storage must be compatible with generating an S3 link, and this experimental configuration setting must be set to true. Presigned URLs for exports aren't supported for systems with shared storage.
</Note>