Migrate an existing deployment to FIPS-compliant images
From Mattermost v11, each release ships in two image variants: a standard Enterprise build (mattermost/mattermost-enterprise-edition) and a FIPS-compliant build (mattermost/mattermost-enterprise-fips-edition). Migrating an existing deployment to the FIPS image is primarily a matter of replacing the image and restarting Mattermost. No data migration is required, and rollback is symmetric.
This guide covers migrating an existing Mattermost Server deployment running on Docker or Kubernetes. Linux package and tarball installations have no FIPS-compliant equivalent.
Mattermost's FIPS offering also covers the Mattermost Operator controller and a self-hosted Push Proxy. Migrating those components to their FIPS variants is out of scope for this guide.
For background on what the FIPS build is and how it's constructed, see the FIPS/STIG tab on Deploy Mattermost using Containers.
Before you begin
-
Back up your database and configuration. Always take a full backup before changing the image. See the backup and disaster recovery documentation.
-
Confirm your deployment type. FIPS images are supported on Docker, Docker Compose, and Kubernetes only. If you're running Mattermost from a Linux package or tarball, you can't migrate in place.
-
Check your Mattermost version. FIPS images are available from v11.0 onward and use the same release tags as the standard Enterprise images. Plan to migrate to the matching FIPS tag for your current version.
-
Plan for additional plugins. The FIPS image includes Boards, Playbooks, and Agents prepackaged and running in FIPS mode. Any additional plugins you've installed will continue to run inside the FIPS image, but they run in non-FIPS mode. This is expected behavior, not a configuration error.
-
PostgreSQL authentication method and password length. The FIPS image places two requirements on how the Mattermost server authenticates to PostgreSQL:
- The password must be stored and verified with
scram-sha-256, notmd5. MD5 isn't a FIPS-approved algorithm, so the FIPS image can't authenticate to PostgreSQL usingmd5password authentication. - The password must be at least 14 characters. Beginning with Mattermost v11.7, the FIPS image requires a Postgres password of at least 14 characters.
Check these requirements before swapping the image. Connect to PostgreSQL with
psqlas a superuser, and replacemmuserandmattermostwith your deployment's database user and database name:a. Check how the Mattermost database user's password is stored:
SELECT rolname, rolpassword LIKE 'SCRAM-SHA-256$%' AS uses_scram FROM pg_authid WHERE rolname = 'mmuser';If
uses_scramistand the password is at least 14 characters, the stored password already meets both requirements, and you can skip step c. Complete steps b and d regardless. They make sure that future password changes are also stored as SCRAM hashes, and that PostgreSQL verifies the password with SCRAM.b. Make sure that future password changes are also stored as SCRAM hashes.
scram-sha-256is the default from PostgreSQL 14, but databases upgraded from older versions may still be set tomd5:SHOW password_encryption;If the result is
md5, change the server-wide setting and reload the configuration.ALTER SYSTEMwrites topostgresql.auto.conf, which overridespostgresql.conf:ALTER SYSTEM SET password_encryption = 'scram-sha-256';SELECT pg_reload_conf();Role and database settings override the server-wide value in the sessions they apply to. Run
\drdsinpsqlto list them, and remove anypassword_encryption=md5entry, for example withALTER ROLE mmuser RESET password_encryption;orALTER DATABASE mattermost RESET password_encryption;.c. Set the password again so that PostgreSQL stores it as a SCRAM hash. Changing
password_encryptiondoesn't convert existing passwords, which remain stored as MD5 hashes until they're set again. When you do this depends on whether the password itself changes:- Your current password is at least 14 characters: enter the same password. The credential doesn't change, so you can do this ahead of time, while Mattermost is still running.
- Your current password is shorter than 14 characters: enter a new password that's at least 14 characters long. Do this at the start of your planned downtime, immediately before the image swap. As soon as the password changes, the running Mattermost server can't open new database connections until it restarts with the new password.
If a connection pooler such as PgBouncer sits between Mattermost and PostgreSQL, review its authentication configuration before you do this, even if the password itself doesn't change. Re-hashing the password can also affect how the pooler authenticates. See PgBouncer's authentication settings.
Use the
psql\passwordcommand, which prompts for the password and hashes it before sending it to the server, so the plaintext doesn't end up in yourpsqlhistory or the PostgreSQL logs. RunSET password_encryptionin the same session first. It applies only to that session and overrides any server, database, or role setting, so the password is stored as a SCRAM hash even if an override remains:SET password_encryption = 'scram-sha-256';\password mmuserRun the query from step a again to confirm that
uses_scramis nowt.d. In
pg_hba.conf, requirescram-sha-256for connections from the Mattermost server, then reload the configuration withSELECT pg_reload_conf();. Scope the entry to the Mattermost database and user. For example:host mattermost mmuser <mattermost-address> scram-sha-256Replace
<mattermost-address>with the address or CIDR range that PostgreSQL sees the Mattermost server's connections coming from. If Mattermost runs in Docker or Kubernetes, don't use the current IP address of the Mattermost container or pod. The image swap recreates it, and it can come back with a different address. Use the network range it connects from instead, such as the Docker Compose network's subnet or your cluster's pod network range.PostgreSQL uses the first entry that matches a connection, so place this entry above any broader entry that also matches, such as a
host all allentry that usesmd5orpassword. If you change a shared entry likehost all alltoscram-sha-256instead, first confirm that every user it covers has a password stored as a SCRAM hash. A user whose password is still stored as an MD5 hash can't authenticate through ascram-sha-256entry.For the same reason, make this change only after step a or step c confirms that the password is stored as a SCRAM hash. Until then, leave any existing
md5entry in place. PostgreSQL already uses SCRAM for a password stored as a SCRAM hash, even when the entry saysmd5.e. If you changed the password in step c, update it where your deployment stores it at the same time: in the official Docker deployment, the
POSTGRES_PASSWORDvalue in.env; in Operator-managed Kubernetes deployments, the database Secret referenced by yourMattermostcustom resource (commonly underspec.database.external.secret).f. Proceed to the image swap procedure for your deployment type below. Recreating the container as part of the migration applies the new credentials — no separate restart is required.
- The password must be stored and verified with
-
Plan for downtime. The migration requires pulling the new image and restarting the Mattermost container or pod.
Migrate a Kubernetes deployment
These steps assume your deployment is managed by the Mattermost Operator using a Mattermost custom resource.
In the steps below, replace <namespace> with the namespace your Mattermost installation runs in. If you omit -n <namespace>, kubectl uses your current context's default namespace.
-
Find the name of your Mattermost custom resource:
kubectl -n <namespace> get mattermost -
Edit the
Mattermostcustom resource to point at the FIPS image. You can edit the live resource directly:kubectl -n <namespace> edit mattermost <installation-name>Or update your manifest file and re-apply it.
-
In
spec.image, change the value frommattermost/mattermost-enterprise-editiontomattermost/mattermost-enterprise-fips-edition. Keepspec.versionaligned with your current release tag. For example:spec:image: mattermost/mattermost-enterprise-fips-editionversion: 11.6.1 -
If you edited a manifest file, apply it:
kubectl -n <namespace> apply -f <your-mattermost-manifest>.yaml -
Watch the Mattermost pods until the new ones report
Readyand the old ones terminate. A pod showingRunningisn't necessarily serving traffic yet — wait until itsREADYcolumn shows all containers ready (for example,1/1):kubectl -n <namespace> get pods -l app=mattermost -w -
Verify the running pods are using the FIPS image:
kubectl -n <namespace> get pods -l app=mattermost -o jsonpath='{range .items[*]}{.metadata.name}{"\t"}{.spec.containers[*].image}{"\n"}{end}'
Migrate a Docker or Docker Compose deployment
These steps are written for the official Mattermost Docker deployment, which selects the Mattermost image and tag through .env variables (MATTERMOST_IMAGE and MATTERMOST_IMAGE_TAG) referenced from docker-compose.yml as mattermost/${MATTERMOST_IMAGE}:${MATTERMOST_IMAGE_TAG}. If you're using a custom Docker setup that hardcodes the image in docker-compose.yml or uses different variable names, adapt these steps accordingly.
-
Stop the Mattermost container:
docker compose stop mattermost -
Edit your
.envfile. ChangeMATTERMOST_IMAGEfrommattermost-enterprise-editiontomattermost-enterprise-fips-edition. LeaveMATTERMOST_IMAGE_TAGset to your current release tag — FIPS images are published under the same tags as the standard Enterprise images.MATTERMOST_IMAGE=mattermost-enterprise-fips-editionMATTERMOST_IMAGE_TAG=<tag> -
Pull the FIPS image:
docker compose pull mattermost -
Recreate the Mattermost container so the new
.envvalues are applied:docker compose up -d --force-recreate mattermost -
Verify the running container is using the FIPS image:
docker inspect mattermost --format '{{.Config.Image}}'
Verify the migration
-
Confirm Mattermost starts cleanly. Tail the logs and watch for startup errors. On Kubernetes, target a specific Mattermost pod:
kubectl -n <namespace> logs -f <pod-name>On Docker:
docker compose logs -f mattermost -
Sign in and verify core functionality (sending messages, file uploads, search).
-
Confirm the prepackaged plugins (Boards, Playbooks, Agents) load successfully. In the System Console, go to Plugins > Plugin Management and confirm they're enabled and healthy.
-
If you have additional plugins installed, confirm they still load. They'll run in non-FIPS mode inside the FIPS image — this is expected.
Roll back
If the migration doesn't go as planned, rolling back is symmetric: revert the image reference and redeploy. No data migration is involved.
- Kubernetes: Edit the
Mattermostcustom resource and changespec.imageback tomattermost/mattermost-enterprise-edition. Re-apply or save, and watch the rollout. - Docker / Docker Compose: Restore the original
MATTERMOST_IMAGEvalue in.env(mattermost-enterprise-edition) and rundocker compose pull mattermostfollowed bydocker compose up -d --force-recreate mattermost.