Active/passive disaster recovery for Mattermost on AWS

A secondary AWS region for Mattermost needs a database, file storage, search and DNS plan that works together during failover. This page covers the components, the decisions, the setup sequence and what to confirm before you build.

On this page

Active/passive Mattermost DR on AWS: what it covers and when you need it

Active/passive disaster recovery for Mattermost means keeping a standby copy of the platform in a second AWS region, with the data replicated to it continuously, so that the team can switch users to that region if the primary region fails. The standby stays idle until a deliberate failover, which is why this pattern is simpler and cheaper to run than running both regions at once. Consider a team that runs a self-hosted Mattermost server in one AWS region and wants a standby region that can take over when that region is unavailable. The first decision is the recovery objectives the business needs, because they determine how far behind the standby may be and how long users can be offline. Those targets should be written down before any AWS resources are built.

Do not confuse this design with high availability. Mattermost high availability clustering, which runs redundant application servers, database servers and load balancers, is available only on the Enterprise and Enterprise Advanced plans according to Mattermost's documentation. A cluster protects against a failed node inside one deployment. DR protects against losing the whole region, and it needs its own replicated database, file storage, search index and DNS plan even when the primary runs as a cluster. Confirm your Mattermost plan before you assume clustering is available, and confirm with Mattermost which failover steps its documentation describes for your version.

The failover runbook must be checked against the architecture you choose. Mattermost documents its own steps, but the components you add, such as Aurora PostgreSQL global clusters, S3 replication, OpenSearch in both regions and DNS cutover, each change what a failover involves. Ask who owns each step, how the standby is verified without serving real users, and what happens to a Mattermost configuration that points at region-specific endpoints. Plan at least one rehearsal in a test environment before you rely on the design.

How the primary and standby regions fit together

The diagram starts with users reaching Mattermost through a DNS record that points at the active region. In the primary region, application nodes write to the Aurora PostgreSQL writer, store files in S3, and index search in OpenSearch. Arrows show the replicated copies in the standby region: the Aurora global cluster, S3 replication and the OpenSearch domain. The dashed trust boundary marks the account and region separation. Check that the DNS record, replication paths and secondary region's configuration are documented and tested, because the replicas only help if they are current.

Primary region replicates data to the standby region, with DNS directing users to the active one.

Which AWS components replicate what, and why each one matters

Failover for Mattermost is only as good as the weakest replicated component, so the first decision is to map each piece of state to the AWS service that will copy it to the secondary region. The PostgreSQL database holds channels, posts, users and configuration, and it is usually the component that determines your recovery point. Aurora PostgreSQL global clusters can replicate the primary cluster to a secondary region, and you should confirm with AWS the current replication behavior, promotion steps and any limits for your Aurora version. Keep in mind that PostgreSQL itself does not detect a primary failure or notify a standby. Something outside the database, such as a runbook with named approvers or an external failover tool, must decide when to promote the secondary and must be tested before you need it.

Mattermost high availability requires shared file storage on every node, either Amazon S3, an S3-compatible service or a NAS mounted on each node. Local file system storage does not work correctly in a cluster and risks corrupting files, so uploaded attachments and images must live in the shared store. For the secondary region, configure S3 cross-region replication on the file bucket and confirm that the replication rules cover every object Mattermost writes, including objects that are encrypted or tagged. Replicated files without a matching database record are harmless, but database rows without their files produce broken attachments after failover, so the two copies must be verified together during each drill.

If search is in use, OpenSearch must exist in both regions. The secondary domain does not fill itself from the primary, so you need a documented plan for how indexes are rebuilt or restored there and how long that takes at your post volume. Confirm the OpenSearch version and the Mattermost version pairing before you build the second domain, because both must remain supported after failover. Mattermost can also run without search during recovery if your business accepts degraded search, and that trade-off should be decided in advance and written into the runbook rather than discovered during an outage. Ask your team to list every AWS service the deployment touches, including load balancers, secrets and certificates, so nothing is left out of the replication design.

Which DR design fits which recovery requirement

A warm standby keeps a second AWS region running with replicated data and a built application stack that serves no users until someone activates it. The on-call database and platform engineers decide to fail over and carry out each step by hand from a written runbook. This design suits a recovery requirement where the business accepts a longer outage while people work through the cutover, and where a small number of moving parts matters more than speed.

  • Standby build: a Mattermost deployment in the secondary region running the same server version, with a copy of the configuration directory, including SAML certificates, and a database replica that stays idle.
  • Data replication: database replication to the secondary region and S3 replication for file storage, since the Mattermost high availability cluster documentation requires shared file storage on each node.
  • Plan check: high availability clustering is documented for the Enterprise and Enterprise Advanced plans, so confirm your license covers the standby before you build it.
  • Cutover owner: named engineers who promote the database, switch the application configuration and change DNS, with a second person to verify each step.
  • Version drift control: a recurring check that the standby runs the same Mattermost version as production, because monthly releases make drift easy to miss.

Confirm with AWS and Mattermost documentation which replication lag and promotion steps your chosen database and storage services document before you commit to a manual runbook.

Standing up the secondary region, step by step

This sequence builds a passive copy of Mattermost in a second AWS region, with replicated database and file storage, a tested promotion path and a documented DNS cutover. Each step ends with a check that shows the secondary can take over without relying on memory or assumptions.

  1. Confirm edition, entitlement and version parity

    Confirm in writing that your Mattermost plan covers high availability clustering, which the pricing page places in the Enterprise and Enterprise Advanced plans. Ask Mattermost sales or your account contact to confirm the entitlement covers both regions and any air-gapped or compliance requirements. Record the exact server version, check it against the monthly release and support dates on the server releases page, and plan both regions to run the same build. Done when the entitlement is on file and the primary and secondary version records match.

  2. Build the secondary network and application nodes

    Your infrastructure team, or DeployOpen under a written scope, builds the secondary region's network, subnets, security groups, load balancer and application nodes from the same infrastructure code used for the primary. The nodes stay out of public traffic while the region is passive. Confirm that the nodes can reach the secondary database and storage endpoints once those exist, and that each node's health check passes when tested locally. Done when the nodes are provisioned, match the primary's configuration baseline, and receive no user traffic.

  3. Configure the global database replication

    Create the Aurora PostgreSQL global database with the primary region as the writer and the secondary region as a read-only replica, then confirm the engine version is one that PostgreSQL still supports. The PostgreSQL versioning policy lists the end-of-support dates for each major version, so check whether your version is close to end of life before you build. PostgreSQL does not detect a failed primary by itself, so write the failure detection and promotion decision into the runbook. Done when a test row written to the primary appears in the secondary and replication lag is visible in monitoring.

  4. Replicate the S3 file storage bucket

    Mattermost clusters need shared file storage on Amazon S3, so the secondary region needs a current copy of the file bucket. Configure cross-region replication from the primary bucket to the secondary bucket, and confirm with AWS documentation whether existing objects, deletions and object versions are replicated in your setup. Replication is not a backup, so keep separate backups in place. Done when you upload a test file through the primary, retrieve the identical object from the secondary bucket, and the checksums match.

  5. Deploy OpenSearch in the secondary region

    Skip this step if your deployment does not use OpenSearch for search. If it does, build a second OpenSearch deployment in the secondary region using the same major and minor version as the primary, and confirm with Mattermost that this version is supported for your release. Decide whether the secondary index is rebuilt from the database after promotion or restored from a snapshot, and test the approach you choose. OpenSearch is released under the Apache License, Version 2.0, so licensing is not a barrier to the second deployment. Done when cluster health reports green and a test search returns expected results from the secondary.

  6. Align the Mattermost configuration and config directory

    Copy the primary's configuration and config directory to the secondary, including SAML certificates, plugin settings and license material. Parameterize only the values that differ by region, such as the site URL, database endpoint, storage endpoint and search endpoint. Confirm that the at-rest encryption keys and other secrets match across regions, since data encrypted with one key cannot be read with another. Review the high availability cluster documentation for settings that apply to multi-node setups. Done when a comparison of the two config directories shows differences only in the parameterized values, and the secondary starts in a test environment against the replica database.

  7. Test a planned failover in a non-production environment

    Clone the primary environment into a non-production account or cluster, then run a full planned failover on the clone. Promote the secondary database, start the nodes, switch the storage and search endpoints, and run the checks your users depend on: sign-in through your identity provider, posting, file upload and download, search, and client connections. Record each step, the time it took, and anything that required manual intervention. Then test failback to the original primary. Done when a signed-off checklist shows that users can complete the core tasks on the promoted environment and the written runbook matches what happened.

  8. Document the DNS cutover procedure

    Write the DNS cutover as an ordered runbook that names the record, the health checks, the owner of each step and the decision point for declaring a failover. Confirm the time-to-live setting for the record with your DNS team and decide whether it is lowered before any planned cutover. Specify the order of operations: stop writes on the primary if it is reachable, promote the secondary database, start the application nodes, update the record, then verify sign-in and posting before communicating with users. Done when the runbook has been reviewed by the operations and security owners, and the cutover steps from the test failover match the document.

Security controls that must follow the data to the standby region

A standby region holds a full copy of the database, files, search indexes and configuration, so it carries the same sensitivity as production. Each control below has to be rebuilt or verified in the secondary region, not assumed to replicate with the data.

Encryption at rest and in transit

Confirm that the replicated Aurora PostgreSQL global cluster, the S3 replication target, and the OpenSearch domain in the standby region are all encrypted at rest with keys you manage, and that replication traffic between regions uses TLS. Replication copies ciphertext, but the destination resources and their key policies are created separately, so each one needs its own encryption setting. Ask your team to check these settings in the console or infrastructure code, not only in the primary.

IAM and KMS key access in the standby

Keys and roles are regional, so a KMS key in the primary region does not grant access in the secondary region by default. Build a separate key for each standby resource, write key policies that name only the Mattermost service roles and approved administrators, and review cross-account access before the first failover test. Record who can decrypt standby data during a real event, because that list is often longer than the production list.

SAML certificates and config directory copies

Mattermost SAML single sign-on depends on the signing certificate and the config directory, so a standby without them cannot sign users in after cutover. Copy the configuration and certificates through a controlled path, store the copy encrypted, and keep the private key out of general-access buckets. Confirm the identity provider metadata still points to the standby endpoint or an approved alias before failover.

SAML SSO docs

Audit logging in both regions

Enable AWS CloudTrail and the S3 and KMS access logs in the standby region so that reads, key uses and configuration changes are recorded there too. Mattermost audit records and server logs should also ship to a log store that survives a regional outage. Test that the log trail stays intact during a failover exercise, since gaps in the record after cutover are hard to explain to an auditor.

Patch parity with the primary

Run the standby on the same Mattermost server release as the primary, because a database schema or binary mismatch can block a failover. Monthly releases and Extended Support Releases both change the server, so plan a patch window that updates the standby on the same day as production. Ask your vendor or internal team to confirm the upgrade order for your version before the next release cycle.

Mattermost releases

Operating system and dependency patching

The standby also runs Linux, the proxy, PostgreSQL clients, the search service and any monitoring agents, and each of these receives its own security updates. Include the standby hosts in the same vulnerability scanning and patch schedule as production, and record the versions in the runbook. A standby that has been idle for months can fail on first use, so run a short test on it each cycle.

What happens during failover and what to rehearse

What are the main steps when failing over Mattermost to a secondary AWS region?

A failover moves the database role to the secondary region, points the application at that region, and then checks that files and search work before users return. In outline, the sequence is promote the database, point the application at the secondary, verify file access and search, and fail back once the primary region is healthy again. Mattermost's documented failover steps are the baseline for this sequence, but the exact commands, ordering and config changes must be confirmed against the Mattermost version you run, because server releases change configuration and behavior. Write the sequence down as a runbook with an owner for each step before you rehearse it.

How is the PostgreSQL database promoted during a Mattermost failover?

The secondary database must be promoted from standby to primary, and the application must be the only writer afterward. PostgreSQL does not detect a primary failure or notify the standby by itself, so your team needs external detection and a decision process for promotion, and that process must be tested. Confirm with the PostgreSQL version in use how promotion behaves on your database service, and check that replication was caught up before the failure. Record the replication lag you expect in normal operation, because a large lag means some recent writes may be lost. Decide in advance who has authority to promote, since a premature promotion can create split-brain conditions when the primary returns.

How do we point Mattermost at the secondary region without breaking sessions?

Cutover normally combines DNS changes with the Mattermost site URL and any proxy or load balancer configuration in the secondary region. Plan for DNS caching, so users may reach the old region for some time after the record changes, and keep the time-to-live value low enough that your recovery targets are realistic. Confirm which Mattermost settings reference the site URL, and check how SAML and other identity provider callbacks behave when the hostname changes, since those settings often need the same hostname to stay valid. Test sign-in from several networks during rehearsal, not only from your office.

How do we confirm file access works in the secondary region?

Confirm that the secondary region can read every file that the primary wrote, using the same storage design you tested in replication. Mattermost stores uploaded files in the configured file storage, and S3 replication copies objects asynchronously, so the most recent uploads may not have arrived when the primary fails. During rehearsal, upload a test file, confirm it replicates within your expected window, then open it through the secondary application. Also check that the file store credentials, bucket policy and encryption keys work in the secondary region, because a replicated object that cannot be decrypted or read is no recovery at all.

How do we verify search after failing over Mattermost?

Verify search by running known queries against the secondary OpenSearch domain and comparing results with the expected post set. Search indexes are not the same as the database, so a secondary search cluster may be empty, stale or missing recent posts if it was not kept in sync. Confirm how your Mattermost version and search configuration handle a search cluster that is behind, and whether a reindex is required before users can rely on search. Plan for search to degrade during failover if the rehearsal shows that a full reindex is slow, and tell users which features are limited.

What should we rehearse, and how often should the rehearsal run?

Rehearse the full sequence in a non-production copy of the environment, including database promotion, configuration changes, DNS cutover, file checks, search checks, user sign-in tests and the fail back. Record the elapsed time of each step, the problems found and the steps that depended on one person. Repeat the rehearsal after each Mattermost server upgrade, each PostgreSQL minor or major change, each OpenSearch upgrade and each change to identity or networking, since any of these can invalidate a runbook. Ask your team to confirm the rehearsal cadence against your own recovery commitments and audit requirements rather than adopting a fixed schedule from a vendor.

How does failing back to the primary region work, and why is it risky?

Failing back means returning writes to the original region only after it is healthy, synchronized and confirmed to have no competing primary. The risk is that data written in the secondary region during the outage must be carried back, and that the old primary may have unreplicated writes that conflict with new ones. Document the order: stop writes in the secondary, confirm replication direction, re-establish the original region as a standby, verify data and files, and then cut DNS back. Ask your database and storage specialists to confirm how the chosen AWS services handle reversing replication, because the steps differ between managed options and self-managed PostgreSQL. Rehearse fail back as thoroughly as failover.

Can our own team run this failover, or do we need a partner?

A team with experience running Mattermost, PostgreSQL, OpenSearch and AWS networking can usually run the failover itself if the runbook is written, the roles are assigned and the rehearsals have been completed. A partner adds value when the team lacks a member who has run replication and cutover before, or when the controls must be evidenced for an assessment. DeployOpen plans, implements, documents and tests self-hosted platforms in infrastructure you control, under a written scope agreed before work starts. Ask for a quote based on which steps you want DeployOpen to build, which steps you want to run yourselves, and how many rehearsals are included.

Limits to confirm in your environment before you commit

A DR design for Mattermost depends on several platform behaviors that vary by account, region and release. The cards below list the limits to confirm with AWS, Mattermost and your own recovery targets before you sign a scope or commit to a cutover plan.

Aurora and S3 replication behavior

Confirm how your chosen Aurora PostgreSQL global cluster and S3 cross-region replication handle the objects and writes Mattermost produces, including what replicates, what does not, and how long replication takes to apply. Mattermost in a high availability cluster requires shared file storage on Amazon S3 or an S3-compatible service mounted on each node, so file replication must be part of the recovery design, not an afterthought. Check regional availability for every service in both your primary and secondary regions before you choose the target.

HA cluster docs

Mattermost licensing for HA features

Mattermost high availability is available only on the Enterprise and Enterprise Advanced plans, and the pricing page places high availability clustering in Enterprise. Confirm your plan covers every node in the secondary region and any standby capacity you intend to run, because a DR design that depends on clustering features your license does not include will not pass review. Ask Mattermost to confirm in writing how the license treats a passive secondary environment.

Mattermost pricing

OpenSearch version requirements

Confirm the OpenSearch version your Mattermost release requires before you provision search in both regions. Search indices and cluster versions must match what the release supports, and a mismatch can block the secondary cluster from serving queries after cutover. Check the Mattermost release notes for the version in use, then verify the matching OpenSearch version and its maintenance status on the OpenSearch releases page.

OpenSearch releases

Data loss during replication lag

Asynchronous replication means the secondary region can trail the primary, so writes committed in the primary shortly before a failure may be missing after failover. Measure replication lag under your real message volume and decide what recovery point you can accept. PostgreSQL supports both synchronous and asynchronous replication, and synchronous commits add latency that your users will feel. Document the exposure in your recovery plan and test it rather than assuming a figure.

PostgreSQL HA docs

DNS TTL and cutover time

Your users reach Mattermost through a DNS name, and resolvers cache answers for the record's TTL. A high TTL can delay cutover for some clients long after you change the record, so set and test the TTL before the event rather than during it. Confirm how your DNS provider handles health-based failover, whether clients or proxies pin addresses, and how mobile and desktop apps reconnect after the switch.

Failover automation and runbook steps

PostgreSQL does not detect a primary failure or notify the standby on its own, so automatic failover needs external tooling that you must select, operate and test. Confirm which steps Mattermost documents for failover and which ones your team must script, including promoting the database, switching object storage and restarting application nodes. Agree on who makes the failover decision and how you will confirm the secondary is serving traffic correctly.

PostgreSQL failover docs

Questions buyers ask before hiring help with Mattermost DR on AWS

What drives the cost of an active/passive DR build for Mattermost on AWS?

The main cost drivers are how much of the stack must be replicated and how much of the work is one-time versus recurring. The secondary region carries standing infrastructure: Aurora PostgreSQL capacity, S3 replication storage and transfer, OpenSearch in both regions, and the Mattermost application nodes and load balancing you keep ready. Build effort rises with the number of components, the size and change rate of the database and file store, the number of integrations that must reconfigure at cutover, and the number of compliance evidence artifacts you need. Ask any partner for a quote that separates one-time design and build from recurring regional spend and from retesting, and confirm which of those costs your cloud account will bill directly.

How long does a Mattermost DR build on AWS take?

Duration depends on scope, not on a fixed template. A build that only replicates the database and files and documents a manual cutover takes less time than one that also rebuilds search indexes in the second region, automates DNS cutover, and includes a rehearsed failover. Other factors include how many AWS accounts and regions are involved, how quickly your team approves network and IAM changes, and whether your Mattermost deployment is already on a supported high availability design. Mattermost high availability clusters need shared file storage on S3, an S3-compatible service or NAS, so an existing cluster may need less rework than a single server. Request a timeline in the written scope that lists each phase and the client dependencies.

What must our team provide before a DR engagement starts?

Expect to provide access and decisions, not just time. Typical inputs are the AWS accounts and organizational guardrails for the secondary region, network design such as VPC addressing, peering or transit, and firewall approvals, a valid Mattermost license for the plan you run, and the plan level that includes high availability clustering. You also need named owners for DNS, identity and the Mattermost System Console, plus change windows for the first failover rehearsal, which will require a stop or controlled outage of the primary. Confirm with your Mattermost account team which license terms apply to a standby environment, since licensing for a passive node can differ from an active one.

Can an internal platform team build Mattermost DR on AWS alone?

An internal team can build it if it has skills across several disciplines at once. The work touches PostgreSQL replication and failover, S3 replication, OpenSearch administration in two regions, Mattermost cluster configuration, DNS and identity, and cloud networking. The PostgreSQL documentation notes that the database does not detect a primary failure or notify a standby on its own, so automatic failover requires external tooling that your team must select, operate and test. Ask whether your staff have done a live failover before, and whether they can keep the runbook current through Mattermost monthly releases and Extended Support Release transitions. A partner can take on the build and handover, while your team keeps the operational ownership.

How often should we test a Mattermost DR failover?

Test on a schedule you can defend in an audit, and retest after any material change. Good triggers include each Mattermost server upgrade, since Mattermost releases a new server version in binary form on the 16th of each month, each PostgreSQL minor update, changes to OpenSearch versions, and changes to DNS, identity or network paths. A failover test should prove that the secondary region starts, that users can sign in through SSO, that files load from the replicated store, that search returns results, and that DNS cutover works. Record the time each step took and the data loss window observed. Agree the test cadence in writing with your risk and compliance owners before the first rehearsal.

Which parts of the DR design do engineers need to check first?

Start with the failure assumptions. Aurora PostgreSQL global clusters replicate across regions, but your recovery point depends on replication lag, which you should measure rather than assume. Check that the Mattermost file store is shared and reachable from the secondary region, because a high availability cluster needs shared file storage and local file systems can corrupt files. Verify the OpenSearch cluster in the second region can be rebuilt or kept in sync, and that the search index is treated as recoverable from the database where possible. Finally, check that the config directory, including SAML certificates, is replicated, since a restore without it can break sign-in. Each item should have a test with a clear pass condition.

Does DR preparation help with compliance reviews?

DR work produces evidence that assessors commonly ask for, such as documented recovery procedures, test records, access controls on the secondary region and logs of failover exercises. DeployOpen prepares systems, controls and evidence for compliance assessments, but it does not issue audit reports, attestations or certifications. Independent auditors and certification bodies make those determinations. Ask your assessor early which recovery objectives, test frequency and evidence format they expect, so the DR build is designed to produce that evidence from the start.

What should we ask for in a quote for this work?

Ask for a written scope that lists each component: database replication and failover tooling, S3 replication, OpenSearch in both regions, Mattermost configuration in the secondary environment, DNS and identity cutover, runbooks, and rehearsals. Each item should name its deliverable, the client inputs it depends on, and whether it is one-time or recurring. Ask how retesting, Mattermost upgrades and PostgreSQL and OpenSearch version changes are handled after handover, and whether support is provided through a retainer. DeployOpen works from fixed-scope agreements with scope, deliverables and timelines set in writing before work starts, and provides a quote from that scope.

How DeployOpen scopes and delivers Mattermost DR

DeployOpen plans Active/passive disaster recovery for Mattermost on AWS as a written, fixed-scope engagement inside your own AWS accounts. The work covers the primary and standby regions, database failover, file replication, search, DNS cutover and the test evidence your team needs to sign off on recovery.

How we scope

  • Confirm the recovery time and recovery point targets your business owners have agreed before any design work starts.
  • Inventory the Mattermost nodes, PostgreSQL database, S3 file storage, search service and DNS records that a failover must move.
  • Agree in writing which AWS accounts, regions and Mattermost plan features are in scope, with deliverables and timelines set out before work begins.

How we build

  • Build the standby region with its database, object storage replication, search service and application nodes defined as code in your accounts.
  • Configure the replication paths and then test a controlled failover and failback, recording the observed timings against your agreed targets.
  • Document each failover step as a runbook that a named operator can follow, including the DNS cutover and the checks that confirm Mattermost is serving users.

How we hand over

  • Deliver the runbooks, architecture diagrams, configuration records and test results to your platform, security and compliance teams.
  • Walk your operators through a live failover drill so the people who will run recovery have done it before an incident.
  • Set out the open items, such as steps that depend on your identity provider or network design, so your team can close them with clear owners.

How we support

  • Offer ongoing support, Mattermost upgrades and recurring DR testing as a retainer if your team wants DeployOpen to keep the standby current.
  • Plan retests after each Mattermost release, database major upgrade or change to the standby region so the runbook stays accurate.
  • Ask any provider, including DeployOpen, to confirm in writing which parts of the DR evidence are for your internal review and which are for independent auditors.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.