When running Mattermost with Docker Compose fits your plans
Docker Compose suits a team lead or platform owner who needs a self-hosted Mattermost trial, a proof of concept or a small-site deployment that a small group will use. It is not a high availability design. Mattermost documents high availability as redundant application servers, redundant database servers and redundant load balancers, available only on the Enterprise and Enterprise Advanced plans, and it points HA deployments toward Kubernetes. If your plan needs failover for the chat service itself, a Compose stack on one host does not meet that requirement, and you should decide that before anyone builds on it.
The Compose stack normally runs three services: a PostgreSQL database container, the Mattermost application container and an optional NGINX container that terminates TLS and proxies traffic. Mattermost describes its runtime as a single Linux binary that uses PostgreSQL as its database, so the Compose file is mainly a packaging of those two parts plus the optional proxy. Your team owns the host, the volumes that hold database and file data, the .env values and the upgrade process. Confirm in the current deployment docs which image tags and environment variables your chosen release expects, because container settings change between versions.
How the Compose services connect
The request starts at the browser or client on the outside network and enters the host either directly on the Mattermost port or through an optional nginx container that terminates TLS. The app container talks to the postgres container over the internal Compose network, and that database is never published to the host. Uploaded files and the database write to named volumes on the host, so the file storage path is the first thing to change when you add a second application node. Check that only the ports you intend to open are published, and that the file volume is local to one host.
Compose services, published ports and the local file storage path on one host.
Which Compose layout fits each situation
A single workstation or lab virtual machine running the database and app containers gives the team a working Mattermost in a short time. This layout suits trying features, testing integrations and learning the System Console. The app is reached directly on its published port, usually over plain HTTP on a private network, so no certificate is involved. Everything stored lives in Docker volumes that the team created and must manage.
- Containers: a PostgreSQL container and a Mattermost app container, started together from one Compose file.
- What you own: the host, the Docker engine, the image tag you pin, and the volumes that hold database contents and uploaded files.
- Access: a local address on a private network, with no public DNS name and no TLS.
- Data handling: treat the contents as disposable until you have tested a backup and restore of the volumes.
- Stop point: move on when people depend on the data, when the instance needs a public name or TLS, or when the evaluation becomes a pilot for live users.
Before you rely on this setup, confirm that the image version you test is the version you plan to run, since results on one version do not show how an upgrade will behave.
A single Linux host running the database, the app and an NGINX container suits a small team that wants a stable internal service with HTTPS. NGINX terminates TLS and forwards traffic, including WebSocket connections, to the app. Everything still runs on one machine, so that host is the single point of failure for the whole service.
- Containers: PostgreSQL, Mattermost and NGINX, with NGINX as the only container that publishes ports 80 and 443 to the network.
- What you own: TLS certificates and their renewal, the NGINX configuration, host firewall rules, and patching of the Linux host and Docker engine. Mattermost production support is for Linux only.
- Backups: scheduled database dumps and a copy of the file storage volume kept off the host, with a restore test on a schedule.
- Upgrades: pin image tags, read the release notes before changing them, and take a backup before each change.
- Stop point: consider a different route when the service must survive the loss of one host, when more than one app node must share file storage, or when the team needs high availability. Mattermost offers HA only on the Enterprise and Enterprise Advanced plans.
Before committing to this layout for the long term, confirm the plan level and the storage design with Mattermost, since both shape what the single host can safely carry.
Compose runs containers on one host, and Mattermost points high availability deployments to Kubernetes. Its high availability cluster documentation describes redundant application servers, redundant database servers and redundant load balancers. Once a site needs that level of redundancy, the work moves beyond this Compose layout, and the team should plan a different route before adding more hosts to the same design.
- Redundancy requirement: the HA design expects redundant application servers, database servers and load balancers, which one Compose host cannot provide.
- Shared storage: each cluster node needs shared file storage on Amazon S3, an S3-compatible service or a NAS. Local file system storage will not work correctly and risks corrupting files.
- Read scaling: database read replicas and search replicas distribute reads across replicas while writes go to the primary database.
- Plan and license: HA clustering is available only on the Enterprise and Enterprise Advanced plans, so the decision covers licensing as well as infrastructure.
- Deployment route: Mattermost's deployment planning covers Kubernetes, Linux and containers, so compare those options with the requirements before migrating any data.
When the site moves to a new route, plan the migration of file storage and database contents as separate work with its own verification steps.
Compose configuration choices and when each fits
This table compares the four decisions that shape a Docker Compose Mattermost stack: TLS termination, the database, file storage and where configuration lives. Read each row for the setting that fits your evaluation or small site and the constraint it places on later growth. The configuration options page holds the full detail for each setting.
| Decision | Option | When it fits | What it constrains |
|---|---|---|---|
| TLS termination | NGINX container in the Compose file | You want one place to manage certificates, redirects and WebSocket settings, and a proxy layer you can later move out. | You maintain the proxy config and certificate files in the project directory, and the proxy must be updated alongside Mattermost. |
| TLS termination | On the Mattermost app | A small evaluation with a single host and few users, where one fewer container keeps the stack simple. | Certificate renewal and port binding fall to the app container, which makes later load balancing or a shared proxy harder. |
| Database | PostgreSQL container in the same Compose project | A throwaway evaluation or lab where data can be rebuilt and nobody depends on uptime or backups yet. | Volume backups, version pinning and upgrades become your job, and the database shares the host's resources with the app. |
| Database | External PostgreSQL service | Production or any site where the database has its own backup, patching and monitoring owner. | You must provision the database, user and network path first, and the connection string must reach it from the app container. |
| File storage | Local Docker volume | Evaluation or a single-host site where attachments can stay on that host and be backed up with it. | Files live on one host, which rules out a second app node sharing storage, as the high availability docs require shared storage for clusters. |
| File storage | S3-compatible object storage or NAS mount | Sites that expect growth, need files reachable from more than one node, or want storage managed outside the host. | Credentials, bucket or share permissions and network reachability must be configured and tested before go-live. |
| Configuration source | Environment variables (MM_ prefix) | Containers where settings should come from the Compose file or a secret store, and where config is versioned with the stack. | Settings supplied this way are locked in the System Console, so admins must change them in the Compose file instead. |
| Configuration source | config.json file in a mounted volume | Single-server installs where admins edit one file and want the System Console to remain fully editable. | The file lives on one host, and multi-node setups need settings stored in the database so every node reads one configuration. |
Setting up a Compose stack for Mattermost
This sequence gives you a running Mattermost evaluation or small-site stack on a Linux host, with a database, the application and an optional proxy, and proves each layer works before you hand it to users. Each step ends with a check so a failure is caught where it starts.
Confirm the Linux host and container runtime
Confirm the host runs a Linux distribution that your Mattermost release supports, and that Docker Engine and the Compose plugin are installed and current. Check the release notes for the version you plan to run, because Mattermost production support is Linux-only and the supported distributions can change between releases. Run the Docker version and Compose version commands and confirm both return without errors. You are done when the host reports a working container runtime and you have written down the Linux distribution and kernel version for your records.
Write the Compose file for each service
Create a project directory and a
docker-compose.ymlfile with three service definitions: the PostgreSQL database, the Mattermost application, and an optional NGINX proxy for TLS and HTTP routing. Map the application port and keep the database off any published host port, so only the application or proxy can reach it. Confirm the Compose file parses by running the config command in the project directory and reading the rendered output. You are done when the command prints the full resolved configuration with all services listed and no syntax errors.Set database credentials and persistent volumes
Set the PostgreSQL user, password and database name in an environment file that is readable only by the account that runs Compose, and pass the matching connection settings to the Mattermost service. Create named volumes for database data, Mattermost configuration, data and file storage so that container restarts and image replacements do not remove them. Use a long, unique database password generated by your password manager, and record where it is stored. You are done when the variables resolve in the rendered configuration and the volume names appear with their mount points.
Confirm image tags before pulling
Open the Mattermost server releases page and choose the server version you intend to run, noting whether it is a monthly release or an Extended Support Release and its support end date. Pin the matching image tag in the Compose file rather than using a floating tag, and do the same for PostgreSQL and NGINX using the versions your Mattermost release documents. Pull the images and confirm each pull completes without errors. You are done when every service references an explicit tag you have checked against the release page and the images are present locally.
Start the stack and watch container status
Start all services in detached mode, then list the containers and their status. The database should reach a healthy state before the application begins its first start, so review the application logs for database connection messages rather than assuming the order held. Fix any connection or permission error before continuing, because a failed first start often leaves partial schema state that is harder to unwind later. You are done when all containers show as running and the logs show the application connected to the database without repeated retries.
Verify the health endpoint and create the first admin
Request the Mattermost system health endpoint from the host and from a second machine on the same network, using the address your proxy or published port exposes. Expect a successful response on both, then open the site in a browser and create the first system administrator account from the setup screen. Record the administrator account and store its credentials in your password manager. You are done when the health check returns a success status, the setup screen completes, and you can sign in as the administrator.
Test file upload and download through the app
Sign in as the administrator, create a test channel, and upload a small file of a known type and size. Download the same file from a second browser session and confirm the contents match the original. If you run the NGINX proxy, also check its access logs for the upload and download requests, since the application may not log file transfers in the same detail. You are done when the file uploads, downloads with matching contents, and both requests appear in the expected log locations.
Why Mattermost points high availability deployments to Kubernetes
A Docker Compose file on one host is the wrong tool for high availability. Mattermost's high availability design is a multi-node architecture with redundant application servers, redundant database servers and redundant load balancers, and it is available only on the Enterprise and Enterprise Advanced plans. A Compose project runs every container on one machine, so a host failure takes down the app, the database and the proxy together. Adding replicas of the containers on that same host does not remove the single point of failure, and it does not give you the separate nodes the design assumes.
The design also requires shared file storage. Each cluster node must mount the same store, which is Amazon S3, an S3-compatible service or a NAS. Mattermost documents that local file system storage will not work correctly in a cluster and risks corrupting files. That means a Compose setup that stores uploads in a local volume cannot be turned into an HA cluster by adding nodes. Your storage backend, network path and credentials for the shared store need to be designed before any application node starts. The documented route for multi-node designs is Kubernetes, which Mattermost supports alongside Linux and container deployments, so plan the cluster on that platform from the outset rather than retrofitting Compose.
Before you design anything, confirm your plan entitlements in writing with Mattermost. The high availability feature sits behind the Enterprise and Enterprise Advanced plans, and pricing is set through sales rather than a public list, so ask for the specific features included in your quote. Also confirm which Mattermost server version and support window apply to your deployment, using the Mattermost server releases page as the starting reference. Use Compose for evaluation or a small site, and treat any multi-node requirement as a separate Kubernetes project with its own plan.
Security risks of a Compose-based Mattermost
A Compose stack puts the database, application and proxy on one host, so a small set of settings decides how exposed the whole deployment is. The cards below cover the risks we see most often in evaluation and small-site stacks, and each one names a control you can check before users arrive.
Exposed container ports
Compose publishes any port listed under ports, and the database port is the one most often published by mistake. Check that PostgreSQL is reachable only on the internal Compose network, that only the proxy's HTTPS port is published to the outside, and that the host firewall blocks everything else. Run a port scan from outside the network after every change to the file, since a single added line can open a service to the world.
Default or weak database credentials
Example Compose files often ship with placeholder passwords for the PostgreSQL user, and those values can survive into a shared environment. Generate a unique, long password for the Mattermost database user, confirm the database user has rights only to its own database, and confirm the password is not stored in a file that is committed to version control. Rotate it through a documented change if it has ever been copied into a ticket, chat or repository.
Unpatched images and monthly releases
Mattermost publishes a new server version each month, and Compose pulls whatever tag the file names, so a latest tag or a stale pinned version quietly drifts out of support. Pin an explicit image version, record the support end date for that release from the server releases page, and schedule a review each month. Rebuild the stack on the new tag only after a backup and a test restore succeed.
- Monthly release day
- 16th
Volume permissions and backups
Named volumes and bind mounts hold the PostgreSQL data and the uploaded files, and a bind mount owned by the wrong user can block the application or expose files to other local accounts. Confirm the ownership and file modes on each volume, keep the file store and database dump in the same backup set, and test a restore to a separate host. A backup that has never been restored is not a control you can rely on.
Secrets stored in Compose files
Values such as the database password, SMTP credentials and any storage keys often sit in the environment block or a .env file next to the Compose file. Move them into Docker secrets or a file readable only by the deploying account, and keep the .env file out of backups that leave the host. Check the Compose file and the container inspect output for values you did not intend to expose, because anyone who can read the Docker socket can read those environment values too.
No audit trail for host access
Compose stacks are often run by a shared administrator account, which leaves no record of who changed the configuration, pulled an image or opened a shell in a container. Give each administrator a named account with sudo or a Docker group membership, log docker exec and Compose commands through the host audit subsystem, and forward those logs off the host. Ask who can reach the Docker socket, since that access equals root on the host.
Questions buyers ask about Docker Compose for Mattermost
Is Docker Compose supported for running Mattermost in production?
Compose is positioned for evaluation and small sites, and production support for this setup is limited to Linux hosts. Confirm the current support statement in Mattermost's documentation before you commit, because support terms decide who answers when a production incident occurs. Mattermost's deployment planning guide describes Linux, containers and Kubernetes as ways to deploy the server, so a Compose stack is one route among several. Ask for a written statement of which host operating systems, container versions and configuration your vendor or partner will support, and file it with your change records so your security team can review the same answer.
What makes a Compose deployment take more effort than a packaged install?
The main difference is who manages the host and the containers. A packaged install gives you systemd units and operating system service management, while a Compose stack leaves your team to manage the container runtime, image tags, volume layout, environment files and restart policies for each service. Your team also owns patching of the Linux host, backups of the PostgreSQL data and the file store, and certificate renewal at the proxy. Upgrades add recurring work. Mattermost ships a new server version in binary form on the 16th of each month, and each upgrade means pinning a new image tag, reading release notes, testing against a copy of your data and keeping a rollback path. Effort grows with user count, integrations and how often you upgrade.
What must our team provide for a Mattermost Compose deployment?
Your team provides the infrastructure and the people who run it. Before work starts, confirm:
- One or more Linux hosts with CPU, memory and disk sized for the deployment, plus a backup target that sits outside the host.
- A DNS record for the chosen hostname and a TLS certificate you control, or a documented method to issue and renew one.
- Firewall rules for inbound web traffic and outbound access to email, identity services and any object storage.
- Named owners for the Compose files, PostgreSQL backups, restore tests, upgrades and the on-call rota.
- An approver for change windows and a written rollback step.
Have someone restore a backup to a separate host before go-live, because a backup that has never been restored is unproven.
Do we need an outside partner for a small Mattermost pilot?
No, a small pilot does not need an outside partner if your team already runs Linux services and containers and can own the upgrades. The pilot is a good place to learn the Compose layout and the upgrade routine. A partner adds value when the pilot must pass a security review, when identity integration or file storage choices need design work, or when the internal team lacks time to run it. DeployOpen works on fixed-scope engagements, with scope, deliverables and timelines agreed in writing before work starts, and offers ongoing support, upgrades and continuous testing as retainers. Ask any partner for a written scope that names who runs upgrades and restores after the pilot ends.
How is the cost of a Compose-based Mattermost structured?
Cost has three layers. The first is the software and subscription. Mattermost's compiled binaries are MIT licensed, while its paid plans (Professional, Enterprise and Enterprise Advanced) are prepaid annual subscriptions based on seat licenses. Mattermost's pricing page lists no public prices and directs buyers to sales, so the subscription figure has to come from a written quote. The second layer is infrastructure: hosts, storage, backups and network, which recur. The third is labor: initial setup is largely one-time, while upgrades, monitoring and restore testing recur, whether your team or a partner performs them. Ask for a quote that separates one-time setup from recurring subscription, infrastructure and support, and that states which plan features it includes, such as SSO from Professional or high availability from Enterprise.
When should we move Mattermost from Docker Compose to Kubernetes?
Move toward Kubernetes when you need high availability. Mattermost documents high availability as redundant application servers, redundant database servers and redundant load balancers, and that cluster is available only on the Enterprise and Enterprise Advanced plans. It also needs shared file storage on Amazon S3, an S3-compatible service or NAS mounted on every node, because local file system storage will not work correctly and risks corrupting files. Other triggers include the need for database read replicas to scale concurrent users, or a platform team that already runs Kubernetes and wants declarative rollouts. Compose suits a single host, and Mattermost points high availability deployments toward Kubernetes. Check the high availability guide before you set a date for the move.
Which Mattermost release should a new Compose deployment track?
Most teams track either the monthly release line or an Extended Support Release, and the choice sets how often you must upgrade. Mattermost releases a new server version on the 16th of each month. Version 11.7 is an Extended Support Release, released on 2026-05-15 with support ending 2027-05-15, and the previous Extended Support Release, version 10.11, reached end of life on 2026-08-15. Version 12.0 was released on 2026-10-16 with support ending 2027-01-15, and version 11.11 was released on 2026-09-16 with support ending 2026-12-15. Monthly releases have shorter support windows than the Extended Support Release, so a Compose stack on them needs an upgrade routine your team can run every month. Confirm current support dates on the releases page before you pick a version.
Can a Compose stack later become a high availability cluster?
Yes, but plan it as a re-platform of the deployment, since a cluster needs redundant application servers, redundant database servers and redundant load balancers that a single Compose host cannot provide. The first blocker is usually file storage. A cluster needs shared storage on Amazon S3, an S3-compatible service or NAS mounted on each node, and local disk will not work. Plan the move of attachments before the move of servers, and check the database and configuration layout against Mattermost's high availability guide. High availability is available only on the Enterprise and Enterprise Advanced plans, so confirm the plan before design work starts.
Operating a Compose stack after go-live
Plan for a server release every month, because Mattermost publishes a new server version in binary form on the 16th of each month, and a Compose stack does not patch itself. Before go-live, decide which release line the site will follow. The monthly line gives you new features and fixes sooner but asks for an upgrade cycle roughly every month. The Extended Support Release line, currently v11.7 with support ending 2027-05-15 according to the Mattermost server releases page, trades newer features for a longer support window. Confirm the support dates for the line you choose before you commit, since they change with each release cycle, and record the end-of-life date of your current version in your maintenance calendar.
Every upgrade should be rehearsed on a copy of the stack first. Restore a recent backup into a separate Compose project with the same image tag you plan to run, pull the new image, start it, and run through login, posting, file upload and download, and any integrations your teams depend on. Read the release notes for breaking changes before you change the image tag in your Compose file. Keep the previous image tag written down so a rollback is a documented step rather than a rebuild. Then schedule the production change in a window your users expect.
Back up the database and the file volume together. Mattermost keeps messages in PostgreSQL and attachments in the file directory, so a database dump without the matching files leaves links that point to nothing, and the reverse leaves files with no records. Take a consistent PostgreSQL dump with pg_dump, archive the volume that holds the file data, and store both with the same timestamp. Test a restore on a clean host at least once, because an untested backup is only a hope. Confirm where your config.json and environment settings are stored too, since losing them slows recovery even when data is intact. Monitor container health with the Compose health status and your logs, and use the Mattermost operations and monitoring guidance for metrics, alerts and support data rather than building that detail into this stack alone.
How DeployOpen scopes and delivers a Mattermost Compose deployment
DeployOpen approaches a Docker Compose Mattermost deployment as a written, fixed-scope engagement inside your own infrastructure. We agree the scope, build the database, app and optional NGINX containers on Linux hosts you control, then document and hand the system over so your team can run it.
How we scope
- Confirm whether the site is an evaluation or a small production install, since Compose is not the path for high availability.
- Record the Linux host, Docker runtime, PostgreSQL version and storage backend your team has approved before work starts.
- Agree in writing whether NGINX, TLS termination, SSO and SMTP are included, and which sites or users the deployment serves.
How we build
- Write the Compose file with pinned image tags, named volumes, environment settings and health checks for each container.
- Configure the database, file storage and proxy, then test uploads, downloads, WebSocket sessions and restarts on the target host.
- Check the server against the vendor's supported platform list and record any deviation before the build is accepted.
How we hand over
- Deliver a runbook covering start, stop, upgrade, backup and restore steps for the database and file volumes.
- Document the monthly release cadence and Extended Support Release dates so your team plans each upgrade window.
- Walk your administrators through the configuration, secrets handling and the decision to move to Kubernetes if scale grows.
How we support
- Offer ongoing support, upgrades and continuous testing as a retainer, priced separately from the build scope.
- Schedule server upgrades against the release calendar and retest the deployment after each version change.
- Ask any provider to confirm response terms, backup restore testing and who holds credentials before signing.

