Why store Mattermost configuration in the database
Storing Mattermost configuration in the database means every server in a deployment reads one shared set of settings from PostgreSQL instead of each node reading its own config.json. Teams need this when several Mattermost nodes or read-only containers must behave identically, and when a SAML signing certificate has to reach every node without copying files by hand. Without it, a settings change made on one node can leave the others running older values, and that drift tends to surface only during a failover or a rolling restart.
The main case is a high availability cluster. Mattermost documents high availability as redundant application servers, redundant database servers and redundant load balancers, and the pricing page places high availability clustering in the Enterprise plan, not Professional. Confirm your plan level with Mattermost sales before designing a cluster, since the database-backed configuration only matters once the cluster itself is licensed. Read-only containers have a similar need: if the image cannot write config.json, settings must come from somewhere else, and the database is the shared store the cluster already depends on.
The database-backed option adds no new infrastructure, because every Mattermost deployment already runs on PostgreSQL. What it adds is a dependency on that database for configuration reads and a new operational task: the configuration becomes part of your backup, restore and change-control process. Before you switch, ask your Mattermost contact and your DBA which settings will be stored in the database, who may change them through the System Console, and how a bad change will be rolled back. Test that rollback on a non-production cluster first.
Config file, database and environment variable options compared
This table compares three places Mattermost settings can live: config.json on each node, the database, and MM_ environment variables. Read each row to see how a setting is changed, who can change it, and how it behaves across cluster nodes and read-only containers. The main takeaway is that database storage gives every node one shared configuration, while file and environment settings stay per node or per container.
| Aspect | config.json on each node | Configuration in the database | MM_ environment variables |
|---|---|---|---|
| Where the setting lives | A file on each server, usually in the config directory of the installation | One shared copy in the Mattermost database that every node reads | Process or container environment, set in systemd, Compose, Kubernetes or Helm |
| Who can change it | Administrators with file access on each server | Administrators through the System Console or mmctl, subject to role permissions | Whoever edits the deployment manifest, unit file or Helm values |
| Behavior across cluster nodes | Each node must hold an identical copy, and drift between nodes is possible | All nodes read the same values, so a single change applies cluster-wide | Each node or pod reads its own variables, so they must be kept in step |
| Behavior in read-only containers | Config must be mounted or baked into the image, and changes need a rebuild or remount | Works without writing to the container filesystem, which suits read-only root filesystems | Works without file writes, but values are fixed at process start |
| Effect on System Console edits | Editable in the console unless the file is read-only | Editable in the console, subject to any environment locks | Locks the matching setting in the System Console, so the console cannot change it |
| SAML certificate handling | Certificate files must be copied to every node by hand or by automation | Certificate content can be stored once and read by all nodes, confirm the exact steps for your version | Certificate content can be passed in, but long values are harder to manage and rotate |
| When it fits | Single small server with one administrator and no cluster | Clustered high availability deployments and teams that want one source of truth | Containers, Helm charts and infrastructure-as-code where settings are versioned with the deployment |
How to move Mattermost configuration into the database
This sequence moves Mattermost settings out of a file on each server and into the shared database, so every cluster node reads one configuration. It ends with a verified restart across nodes and a tested SAML login.
Confirm the current server version and support window
Check the version currently running on every node against the Mattermost server releases page, and note whether it is a monthly release or an Extended Support Release and when its support ends. Plan the move on a version that is still supported, and if the current version is near end of support, confirm the target version with your vendor contact before you change anything. Done when you have a written record of the running version on each node and its support end date.
Back up config.json and the database
Copy config.json from every node to a secure location, and take a full backup of the Mattermost database using your PostgreSQL backup method. Store the copies off the cluster, record their checksums, and confirm you can restore them to a separate test host. Done when a restore of the database and config file has been proven on a non-production system and the backup files are verified.
Confirm the database backend and PostgreSQL version
Verify that Mattermost is using PostgreSQL and not another database, then record the PostgreSQL major version and whether it is self-managed or a managed service. Check the version against the PostgreSQL versioning policy, since unsupported major versions should be upgraded before or separately from this change. Done when the database engine, version and hosting model are written down and the version is within its support window.
Choose the configuration source and migration method
Review the configuration source setting and the migration method documented for your target Mattermost version, and confirm the exact config keys and commands in the official docs for that version, since they are not reproduced here. Decide which node will perform the one-time migration and whether the settings should be migrated before any other node restarts. Done when the chosen method, key names and the migrating node are documented in your change record and reviewed by the platform owner.
Run the migration on one node
Stop writes to the configuration by following the documented procedure, run the migration on the designated node, and confirm that the settings now appear in the database. Keep the original config.json unchanged until the verification steps pass. Done when the System Console shows the expected settings and the database holds the configuration values, and the migration log contains no errors.
Verify all nodes read the same configuration
Restart the remaining nodes one at a time and confirm each one loads the configuration from the database. Compare key settings such as site URL, file storage, email and cluster options across all nodes in the System Console and, where your version allows, in the server logs. Done when every node reports the same values and a test change made on one node appears on the others.
Test SAML login and certificate handling
Sign in through SAML from a test account on each node path, including the load balancer, and confirm the identity provider certificate and signing settings are read correctly from the shared configuration. Check that the certificate is distributed to every node and that a rotated certificate can be applied once and used everywhere. Done when test logins succeed on all nodes and a documented certificate rotation has been rehearsed in a non-production environment.
Record the final state and remove old file copies
Document the configuration source setting, the backup locations, the verification results and the owners of future configuration changes. Only after the cluster has run stably for a period your change process approves should you retire the old config.json copies on each node. Done when the change record is signed off and the remaining file-based settings are listed with their owners.
How cluster nodes read one shared configuration
In a high availability cluster, each Mattermost application server normally loads its own copy of config.json at startup. That means an edit made through the System Console or on the file of one node does not reach the others, and the nodes can drift apart in settings such as SSO, file storage or email. Storing configuration in the database removes that drift. Every node reads the same settings from one place, so a change made once applies to the whole cluster. Before you migrate, list which settings your team edits by hand in the file today and confirm with Mattermost's current high availability documentation how the cluster handles configuration reloads.
The database approach also matters for read-only containers. A container whose root filesystem is read-only, or one that cannot mount a writable config volume, cannot save changes to config.json at all. With the configuration held in PostgreSQL, the container only needs network access to the database, and administrators make changes through the System Console or the API. Data flows in one direction for settings: an administrator saves a change, the application server writes it to the database, and the other nodes pick it up from the same tables. Mattermost high availability depends on redundant application servers, redundant database servers and redundant load balancers, and writes from every node still go to the primary database. Read replicas can serve read traffic, so the database design you choose affects both configuration and everyday performance. Confirm which read paths your version sends to replicas before you rely on that behavior.
How database-stored settings help SAML certificate distribution
When every node reads one configuration, a SAML change made once reaches the whole cluster instead of drifting node by node. The cards below cover the parts of that change that most often break login: the certificate and key on each node, the timing of rotation, metadata agreement with the identity provider, partial rollouts, key storage, and testing.
Certificate and key handling per node
Confirm which SAML settings the database store holds in the Mattermost version you run, since the set of keys moved out of config.json has changed between releases. Settings that remain in the file must still match on every node. Record which certificate and private key each node uses, and check that the signing certificate Mattermost presents is the one the identity provider was given.
Rotation timing
Plan rotation as a single change window. Publish the new certificate to the identity provider and to Mattermost in an order that keeps the old certificate valid until every user path has moved over. Because the database holds the active setting, the cutover happens for all nodes at once, not as each node restarts. Ask the identity provider vendor how long it keeps the previous signing certificate trusted.
Metadata consistency with the identity provider
The identity provider holds its own copy of the service provider details, including the entity ID, the assertion consumer URL and the certificate. Compare these values field by field after each change, because a mismatch in the entity ID or the ACS URL fails sign-in even when the certificate is correct. Keep the metadata file under change control so the identity provider and Mattermost settings are updated from the same source.
Partial update risk
A node that misses an update keeps serving the old state. With a shared database store, the node reads the new value on its next load, so the risk is a node that has not reloaded or that runs a different binary. After each change, confirm every node reports the same configuration and restart any node that has not picked it up. Watch authentication errors on each node separately, since a load balancer can hide a failing node behind healthy ones.
Where private keys should live
Keep the SAML private key out of plain text in shared administration views and backups that many staff can read. Restrict who can change SAML settings in the System Console, and log those changes. Confirm with your security team whether the key should sit in a managed secrets store and how the deployment injects it, since the database copy of a key is only as protected as the database backups that hold it.
Testing login after a change
Test with a named test account that is not an administrator, from a clean browser session on each network path your users take, including the load balancer and any VPN. Sign in, check the attributes Mattermost receives, and sign out. Keep a rollback plan that restores the previous certificate and metadata, and record the result of each test before closing the change.
How nodes, containers and PostgreSQL share one configuration
The diagram starts at the load balancer, which sends requests to several Mattermost nodes, including a read-only container whose settings cannot be edited on disk. Every node reads its configuration from the primary PostgreSQL database, so a change made once applies to all of them. Reads that do not need the latest data can be served from read replicas. Uploaded files travel a separate path to shared file storage, which is not part of the configuration. Check that every node reads the same database and that all nodes mount the same storage.
Nodes read settings from one database while files go to separate shared storage.
Questions buyers ask before storing Mattermost config in the database
What does moving Mattermost config into the database cost, and what drives the effort?
Most of the cost is the time of the people doing the work, and it rises with how many nodes, settings and approval steps are involved. Effort grows with the number of cluster nodes that must be checked after the move, the number of settings you have changed from defaults (each one needs a review of where its value comes from), whether SAML and other identity settings are involved, and how formal your change control is. Written rollback plans, separate test and production environments and sign-off meetings add work on both sides. The migration does not remove recurring costs such as your Mattermost subscription, which is sold as a prepaid annual subscription based on seat licenses, or your own platform operations. Ask any partner for a written quote that lists each stage, who performs it, the environments covered and what is excluded.
How long does a Mattermost configuration migration take?
The duration depends on cluster size, the number of settings to review, the number of testing rounds and how many approvals your change process requires, so no single figure applies to every site. A small installation with a test copy can move quickly, while a multi-node cluster with SAML, a staging rehearsal and a formal change window takes longer because each stage waits for the one before it. Calendar time is often set by change windows and sign-off, more than by the technical steps. Ask for a schedule in the written quote with dated milestones, the number of rehearsals assumed and the number of change windows. Confirm that the schedule includes a rollback path and a post-change observation period before your team relies on the new setup.
What does the migration need from our team?
Your team needs to provide database access, identity provider admin time and production change windows. Database access means an account with rights to the Mattermost PostgreSQL database and a verified backup taken before any change. Identity provider admin time is needed to confirm SAML settings, certificates and metadata for every node. Your team also controls the change approval process and should provide a staging environment that mirrors production as closely as practical. Name a contact who can answer questions during working sessions, and someone who can confirm user sign-in after each change. Write these responsibilities into the scope so gaps surface before the change window opens.
Can our own team run this migration without a partner?
Yes, a team that already runs Mattermost and PostgreSQL can do the migration itself if it has the access, the time and a rehearsal environment. The work is mainly careful configuration handling, verification on every node and a tested rollback. Teams that understand their identity provider and have made controlled database changes usually have the skills needed. A partner is more useful where the team lacks SAML experience, has no staging copy, or will carry the work during a busy period. DeployOpen plans, implements and documents this kind of work in infrastructure you control, under a fixed scope agreed in writing. Decide early which parts stay internal and which parts you want to hand over, such as planning, execution or the verification step.
Does high availability require an Enterprise plan?
Yes, high availability is available only on the Enterprise and Enterprise Advanced plans, according to Mattermost's high availability documentation. An HA design needs redundant application servers, redundant database servers and redundant load balancers, along with shared file storage on each node. A shared configuration is one part of that design, but moving settings into the database does not by itself make a deployment highly available or enable HA on a lower plan. Confirm the plan that fits your seat count and required features with Mattermost, because its pricing page lists no public prices and directs buyers to sales. Note that SSO and AD/LDAP user sync are included from the Professional plan, so a Professional deployment can still use SAML without HA.
Does SAML use make the configuration migration harder?
Yes, SAML is the part of the migration most likely to need extra testing. Each node must end up with the same identity provider settings and certificate material, and a mismatch can break sign-in on some nodes but not others. Before the change, record the current SAML settings, certificate expiry dates and identity provider metadata. After the change, test sign-in on every node, including sign-out and a user provisioned recently. Agree with your identity team how certificate renewal will work once the configuration is held in one place, so the next renewal does not catch anyone by surprise. Mattermost's SAML single sign-on documentation is the reference to check against during testing.
What goes wrong if we skip change control and test windows?
Skipping change control and test windows usually causes the most damage, because one wrong setting can affect every node at once. Typical failures include a setting that works on a test copy but not in production, a node that keeps reading old values, and sign-in breaking after a certificate change. Protect the work with a verified PostgreSQL backup, a written rollback plan and a freeze on other Mattermost changes during the window. PostgreSQL's continuous archiving and point-in-time recovery documentation describes recovery options your database team should confirm before the change. Set an observation period after the change and name the person who can decide to roll back.
What should we request in a written quote for this work?
Ask for a quote that lists scope, deliverables, assumptions and exclusions in writing. The scope should name the Mattermost version, the number of nodes, the settings in scope, the identity provider and the environments covered, including staging and production. Deliverables should include the migration runbook, per-node verification steps, the rollback plan and a handover document. The quote should also state what you provide, such as database access, identity provider admin time and change windows, along with the milestones and the support options after the change. DeployOpen's engagements are typically fixed-scope, with scope, deliverables and timelines agreed in writing before work starts. Confirm how work outside the agreed scope is priced and approved.
How DeployOpen works on this
DeployOpen starts with a written scope that names the Mattermost version, the PostgreSQL instance, the nodes and the settings to move out of config.json. We then build the migration in a staging copy, verify every cluster node reads the same configuration, and hand over documentation your team can run. Engagements are fixed-scope and agreed in writing before work starts.
How we scope
- Inventory every setting in the current config.json and decide which stay in files and which move to the database.
- Confirm the Mattermost server version, the PostgreSQL version and whether high availability nodes need a shared configuration.
- Agree in writing who handles the SAML certificate distribution, the rollback point and the change window before work starts.
How we build
- Rehearse the configuration move in a staging environment that mirrors your cluster nodes, proxy and database settings.
- Verify that a setting changed on one node appears on every other node, and that read-only containers start cleanly.
- Test SAML login and certificate rotation against your identity provider before the production cutover.
How we hand over
- Deliver a runbook covering the migration steps, rollback steps and the settings that remain in config.json or environment variables.
- Document the configuration ownership model: who edits settings in the System Console and who approves changes.
- Walk your platform and identity teams through the checks they will repeat after each Mattermost upgrade.
How we support
- Retest configuration handling after each Mattermost server upgrade, including the monthly releases and Extended Support Releases you run.
- Ongoing support, upgrades and continuous testing are available as a retainer, scoped in writing.
- Confirm with DeployOpen during scoping which upgrade and retest responsibilities sit with your team and which sit with us.

