Mattermost TLS setup: when to terminate TLS on the server or a proxy
The choice is between built-in TLS on the Mattermost server and a reverse proxy in front of it, and the two main drivers are how many people will sign in and whether you need high availability. Mattermost runs as a single Linux binary with PostgreSQL as its database, so a small single-server install can serve HTTPS directly from the host and manage its own certificate. Once you need redundancy, the design changes. The high availability documentation describes redundant application servers, redundant database servers and redundant load balancers, and HA is available only on the Enterprise and Enterprise Advanced plans. In that design, TLS usually ends at the load balancer tier, so a proxy becomes the practical choice. Confirm your plan level and HA requirement before you design around either option.
Certificate source is the second decision. Let's Encrypt suits a public domain where the host can complete the validation method you choose, and it needs a renewal process that the server or proxy can run unattended. A certificate from your internal certificate authority suits private networks and sites where your security policy restricts automated issuance from public authorities. Either way, confirm who owns renewal, where the private key is stored and who can read it. If the Mattermost process itself will listen on port 443, confirm how your distribution grants a non-root service account the right to bind a privileged port, because that setting often gets missed until go-live.
Built-in TLS or a proxy: which fits your user count and topology
For a single server with fewer than 200 users, terminating TLS on the Mattermost server itself is the simplest option. Mattermost can bind to port 443 directly and serve certificates it is configured with, so there is one fewer component to build and patch. Let's Encrypt can issue the certificate, which keeps the cost of the certificate itself low, but renewal must still work reliably on the host. The team owns the certificate lifecycle, the renewal job and the restart or reload that follows a renewal.
- Termination point: The Mattermost server handles HTTPS on the host, with no separate proxy in the request path.
- Certificate source: Let's Encrypt or your own certificate authority, chosen before go-live and recorded in your change log.
- Binding to 443: The service account needs permission to bind to a privileged port, or you grant that capability through the service manager.
- Renewal ownership: Your team owns the renewal client, its schedule, and the post-renewal step that makes Mattermost load the new certificate.
- Limits: Upload size, rate limiting and request logging are handled by the application, so plan how you will monitor and tune them.
Before go-live, confirm that a forced renewal works on the production host, that expiry alerts reach a team that will act on them, and that port 80 is reachable if your chosen validation method needs it.
Once a single site grows beyond the small-server range, most teams put a reverse proxy in front of Mattermost and terminate TLS there. The proxy holds the public certificate, redirects HTTP to HTTPS, and forwards WebSocket traffic to the application. Mattermost then listens on an internal port such as 8065, which keeps the application off the public edge. The team owns the proxy configuration, the certificate on the proxy and the logs that the proxy writes.
- Termination point: The reverse proxy terminates TLS, and Mattermost receives plain HTTP from the proxy on an internal network.
- Certificate source: The proxy's certificate can come from Let's Encrypt or your enterprise certificate authority, managed with the same process as other internet-facing services.
- Traffic handling: The proxy must pass WebSocket connections and file upload requests through without breaking them.
- Logging: Proxy request logs capture file uploads and downloads that the server does not log, so decide retention and access to those logs early.
- Ownership after go-live: Your team owns proxy upgrades, cipher and protocol settings, and certificate rotation across the proxy pair if you run more than one.
Confirm the proxy's forwarded headers and the Mattermost site URL match the public address, because a mismatch causes login and link problems that look like application faults.
A high availability cluster has redundant application servers, redundant database servers and redundant load balancers. TLS should terminate on the load balancer tier, so every node receives traffic over the same internal path and certificate changes happen in one place. Mattermost documents high availability only on the Enterprise and Enterprise Advanced plans, so confirm your plan before designing around it. The team owns certificate distribution to the load balancers, health checks that route around failed nodes, and the internal trust model between the balancer and the nodes.
- Termination point: The load balancer tier terminates TLS for all application nodes, with internal traffic to each node.
- Certificate management: Use one issuance process for every load balancer, with a documented owner and a tested rotation that avoids a gap across the pair.
- Cluster traffic: Cluster gossip on port 8074 stays on the internal network, separate from the public listener.
- Shared state: Shared file storage on S3, an S3-compatible service or NAS must be mounted on every node, which affects how you plan certificate and configuration changes.
- Ownership after go-live: Your team owns the load balancer fleet, certificate rotation runbooks and failover tests that include the TLS layer.
Before committing to a design, confirm with Mattermost which load balancer and certificate options are supported for your version, and test a certificate rotation in a non-production cluster.
Configuration options for Mattermost TLS and when each fits
This table compares four places to end TLS for a self-hosted Mattermost: the server itself, a reverse proxy, an enterprise certificate, and a load balancer tier. Read each row by asking where the certificate lives, who renews it, and which trade-off you accept. The main takeaway is that the server-side option suits small installs, while proxy or load balancer termination fits larger and high availability deployments.
| Option | Where TLS ends | Who renews the certificate | When it fits | Main trade-off |
|---|---|---|---|---|
| Built-in TLS with Let's Encrypt | Mattermost server itself, bound to port 443 | Automated client on the Mattermost host, if the certificate tooling is configured | Single server with fewer than 200 users and no existing proxy | Renewal and port 443 binding live on one host, so a server failure takes TLS down with it |
| Built-in TLS with your own certificate | Mattermost server itself, bound to port 443 | Your PKI or certificate team, with manual or scripted replacement | Small install where your organization requires an internal or commercial certificate | You must track expiry and replace the certificate and key on the server yourself |
| Reverse proxy such as NGINX with Let's Encrypt | Proxy tier in front of Mattermost, which forwards to the application over the internal network | Certificate client on the proxy host | Larger installs, or sites that already run a proxy for other services | Proxy configuration must handle WebSocket traffic and file transfers correctly, and you must confirm settings for your version |
| Reverse proxy with enterprise certificate | Proxy tier, with internal traffic re-encrypted if your policy requires it | Your certificate authority team, through the proxy's certificate store | Regulated sites that need certificates issued by an internal or commercial authority | Renewal runs on a separate change process, so expiry tracking must be part of operations |
| Load balancer tier for high availability | Load balancers in front of several Mattermost application nodes | Whoever manages the load balancer or cloud certificate service | High availability clusters, which Mattermost documents as requiring redundant load balancers on Enterprise plans | Adds components to build, monitor and patch, and the cluster design must be confirmed with Mattermost docs |
Setting up TLS on port 443 step by step
This sequence takes a Mattermost site from a DNS name that resolves to the server through to a verified HTTPS listener on port 443, with the certificate, site URL and HTTP redirect all agreeing with each other. Each step ends with a check so the team knows it can move on.
Confirm DNS and the public address
The network or platform engineer confirms that the chosen Mattermost hostname resolves to the public address that will serve traffic, and that the same name is used everywhere users and clients will reach the site. Check the record from outside your network, not only from an internal resolver, because split-horizon DNS is a common source of certificate failures later. Confirm that inbound TCP 80 and 443 reach the server or proxy, and record which port Mattermost listens on internally, since the official port planning guidance lists 8065 as the application port. Done when an external lookup returns the expected address and a test connection to port 443 from outside your network succeeds or fails for a reason you understand.
Choose the termination point
The platform owner decides whether TLS ends on the Mattermost server itself or on a reverse proxy or load balancer in front of it. Built-in termination suits a small, single-server installation, while a proxy fits larger installs, multiple application nodes or sites that already manage certificates centrally. Record the decision in the change ticket along with who owns renewal and who can change the proxy configuration. Confirm the choice against the user count and deployment model before going further, because a high availability cluster has its own load balancer requirements. Done when the owner, the termination point and the renewal owner are written down and approved.
Obtain the certificate
The engineer requests a certificate for the exact hostname users will type, using either a Let's Encrypt HTTP challenge, which needs port 80 reachable from the internet, or a DNS challenge, which needs API access to the DNS zone and suits servers without public port 80. Organizations with an internal certificate authority request a certificate from that CA instead, and confirm its chain is trusted by the client devices that will connect. Store the private key with restricted file permissions and keep a note of the renewal method. Done when the certificate and full chain files exist on the server or proxy, and the certificate's subject name matches the hostname from the first step.
Configure the listener and bind to port 443
On built-in termination, the administrator points the Mattermost TLS settings at the certificate and key files and sets the listener to port 443. Because ports below 1024 are privileged on Linux, the administrator either grants the binary the capability to bind low ports or runs the service through a proxy on 443. Confirm the approach for your distribution and service manager, since the file ownership, service unit and SELinux or AppArmor rules differ between Ubuntu, Debian and RHEL-family systems. On a proxy, the proxy listens on 443 and forwards to the Mattermost port. Done when the service starts, listens on 443 as expected, and logs no permission errors.
Set the site URL to match the certificate
The administrator sets the Mattermost site URL to the same HTTPS address that users and integrations will use, so generated links, email notifications, SSO redirects and webhook callbacks all point at the correct name. A mismatch between the site URL, the certificate name and the hostname users type is a frequent cause of broken login and SAML callbacks. Make the change in the System Console or the configuration file, then restart the service if the platform requires it. Done when a sign-in page loads over HTTPS and the links it generates use the expected hostname.
Redirect HTTP to HTTPS
The administrator configures port 80 to answer with a permanent redirect to the HTTPS address, so users who type the bare hostname arrive on the encrypted site. Keep the Let's Encrypt HTTP challenge path reachable if you renew with that method, or the renewal will fail. Check that the redirect preserves the requested path and does not loop. Done when a request to the HTTP address returns a redirect to the HTTPS address and the target loads with a valid certificate.
Verify with an external TLS check
From a machine outside your network, the engineer runs an external TLS test that reports the certificate chain, expiry date, protocol versions and cipher suites, and confirms no weak legacy protocols are offered. Set a calendar reminder or automated check for renewal based on the certificate's expiry, and confirm that automated renewal actually runs in a dry run. Record the results with the change ticket. Done when the external report shows a trusted chain for the correct name and the renewal job completes a test run.
Test WebSocket connectivity
Mattermost uses WebSocket connections for real-time messages, so the engineer signs in from a browser, opens a channel, and sends a message from a second session to confirm live updates arrive without a page refresh. Repeat the check through the proxy path if one is in use, because a proxy that does not forward the upgrade headers will load pages but silently fail real-time delivery. Check the server logs for repeated connection errors. Done when two sessions exchange messages in real time through the final public address and the logs show no recurring WebSocket errors.
How client traffic reaches Mattermost through the TLS termination point
Client traffic starts at the user's browser or app and reaches the TLS termination point on port 443. In the built-in option, Mattermost itself holds the certificate and listens on 443. In the proxy option, a reverse proxy or load balancer terminates TLS and forwards requests to Mattermost on port 8065, either over plain HTTP on a private network or re-encrypted. The trust boundary sits at the termination point, so confirm which hop is encrypted and that the certificate chain is valid for every name clients use.
Two ways TLS can terminate in front of a self-hosted Mattermost server.
Security risks in Mattermost TLS: keys, redirects and internal hops
Whether Mattermost terminates TLS on a proxy or on the server itself, the same few points carry the risk: the private key, the certificate renewal, the redirect and HSTS behavior, the hop between proxy and server, and the policy that decides which protocols and ciphers are accepted. Each card below is a check to make before go-live and again after every renewal or upgrade.
Private key protection and file permissions
The private key is the single secret that proves your server is who it claims to be, so it needs tighter permissions than the certificate beside it. Confirm that only the account running the proxy or the Mattermost service can read the key file, that it is not copied into shared configuration repositories or container images, and that backups of the key are encrypted and access-logged. If Mattermost terminates TLS itself, check that the config.json file and the key path it references are not readable by other local users. Ask your team who holds a copy of the key today.
Certificate renewal failure
Let's Encrypt certificates are short-lived by design, so renewal is a recurring operation rather than a one-time setup. A renewal that silently fails will show up as expired TLS on every client, including the mobile and desktop apps, at an inconvenient moment. Confirm that the renewal job runs under a schedule you monitor, that a reload of the proxy or Mattermost picks up the new certificate, and that someone is alerted on failure. For your own certificate, confirm who owns the purchase and renewal date and where it is recorded.
HSTS and redirect handling
Redirecting plain HTTP to HTTPS is simple, but the details decide whether it is safe. Check that the HTTP listener only redirects and serves no application content, that the redirect target uses the correct host name, and that any HTTP Strict Transport Security header is set deliberately, because a long max-age is hard to undo once browsers have cached it. Test the redirect path from a clean browser and from the desktop app, since a misconfigured redirect can break WebSocket connections that Mattermost relies on for real-time messages.
Trust of the internal hop
When a proxy terminates TLS and forwards to Mattermost on port 8065, the traffic between them is often left in plain text on a network segment that many teams assume is private. Decide whether that hop stays on a locked-down host or subnet, or whether it is encrypted and the server verifies the proxy. Also confirm that Mattermost trusts forwarded client address headers only from the proxy, so access rules and audit records do not accept spoofed addresses. Ask whether your network policy requires encryption on internal links, because the answer changes this design.
Cipher and protocol policy
The protocol versions and cipher suites a server accepts should come from your security baseline, not from whatever the proxy defaults to in a given release. Write down the minimum TLS version, the approved cipher list and the key exchange settings, then apply them in the proxy or in Mattermost, and scan the public endpoint after each change and each upgrade. Confirm the policy also meets any FIPS or government requirement you have, and check with your compliance team whether the chosen settings must be evidenced for an assessor.
Logging of request paths and uploads
A proxy sees every request, including file uploads and downloads that the Mattermost server does not log in its own request records. That makes the proxy log both useful for investigation and a place where sensitive content, session tokens or personal data can leak. Decide which fields are recorded, set retention for those logs, restrict who can read them, and make sure query strings or authorization headers are not written in full. Confirm the log path with your records and privacy owners before the proxy goes live.
Let's Encrypt or your own certificate: how to decide
The choice between Let's Encrypt and your own certificate comes down to who controls issuance, renewal and trust. Let's Encrypt removes the purchase step and automates renewal, which suits a public hostname on a single server or a proxy you run yourself. Your own certificate, issued by an internal CA or a commercial CA your organization already buys from, suits a name that never resolves on the public internet, a trust chain your endpoints already accept, or a policy that requires certificates to come from a named authority. Internal naming is the most common blocker: Let's Encrypt only issues for names it can validate through a public challenge, so a Mattermost host reachable only on a corporate network usually needs your own CA.
Air-gapped and restricted networks change the answer. If the server cannot reach Let's Encrypt's validation services, automated renewal fails silently until the certificate expires, so a certificate from your internal PKI is the safer default there. Confirm with your network team whether the Mattermost host, and the proxy if you use one, can make the outbound requests the challenge needs. Also confirm your organization's rules for certificate lifetimes and issuance volume before you rely on a public CA, since those rules come from the CA and your own policy, not from this page.
Before approval, the security team should review the challenge method, which decides what must be exposed. HTTP-01 requires port 80 to reach the server from the internet, which conflicts with some inbound policies, while DNS-based challenges need credentials for your DNS provider that must be scoped and stored like any other secret. Ask where the renewal job runs and under which account, who can read the private key and where it is backed up, and how an expiry alert reaches the operations team. Record the answers in the change ticket, because a renewal that depends on one engineer's workstation becomes an outage risk.
Limits to confirm before you choose a TLS design
Each item below is a constraint that can rule out a TLS design before any configuration starts. Confirm them in order, because the Mattermost version, the license plan and the network path decide which options remain open for your environment.
Mattermost version and install method
Confirm the exact server version and whether you install from the APT repository, a release tarball, a container image or Kubernetes. Mattermost releases a new server version in binary form on the 16th of each month, and Extended Support Releases follow a longer cycle. The install method determines where the configuration file lives, how the site URL is set and which TLS keys you can change, so record both before you read any TLS guidance.
Server releases pagePublic ACME reachability
Let's Encrypt issues certificates through the ACME protocol, so the server or proxy must reach public ACME endpoints and complete a domain validation challenge. Air-gapped, coalition and tightly egress-filtered networks often cannot do this. If the target environment cannot reach public ACME services, plan an internal certificate authority or an organization-issued certificate instead of assuming the built-in option is available.
Plan supports a proxy tier
Mattermost high availability, which relies on redundant application servers, database servers and load balancers, is available only on the Enterprise and Enterprise Advanced plans. Confirm which plan you are buying before you assume a load balancer or reverse proxy tier is supported. A single server terminating TLS for a small team does not depend on this, but a clustered design does, so check it against the written subscription terms.
High availability docsPort 443 availability
Confirm that the host or load balancer can listen on port 443 and that no other service, such as an existing web server or ingress controller, already holds it. Built-in TLS on the Mattermost server needs the server to bind to 443 directly or sit behind a forwarding rule, which often requires a privileged port or a capability setting on Linux. Check firewall rules for inbound 80 and 443 at the same time, because ACME validation and HTTP to HTTPS redirects both depend on them.
Current official guidance on site URL and TLS
Confirm the site URL and TLS settings against the current Mattermost documentation for your exact version, because configuration keys, defaults and supported certificate options can change between releases. Ask your Mattermost contact or DeployOpen to confirm any setting that affects WebSocket traffic, certificate paths or the port the server listens on. Record the version you checked so the design can be re-verified at each upgrade.
Deployment planning docsQuestions teams ask before they set up Mattermost TLS
How much effort does a Mattermost TLS setup take, and what drives it?
The effort depends mainly on where TLS terminates, how many hostnames and certificates are involved, and how many systems must trust the certificate. Terminating TLS on the Mattermost server itself is the smaller job: one hostname, one certificate, and a server configuration that binds to port 443. A proxy layer adds configuration for redirects, WebSocket traffic, upload size limits, and certificate files on another host. Other drivers include whether you use a private certificate authority, how many environments you run (test, staging, production), and how well your change process handles a certificate that has to be replaced on a live service. Ask any provider to break its quote into these components.
Can an internal team set up Mattermost TLS without outside help?
Yes, a team with Linux administration and web server experience can usually complete a basic setup, and the documentation covers both the built-in and proxy approaches. The work becomes harder when the team has to coordinate DNS, certificate authority access, firewall rules, and load balancer behavior across groups that do not normally work together. Outside help is most useful for reviewing the design against your policy, for proxy configuration that must handle WebSocket traffic and file transfers correctly, and for documenting the setup so that the next person can renew and troubleshoot it. Decide which of these your team can cover before you choose a path.
What does the TLS work need from our DNS, certificate authority, and network teams?
The work needs four things from outside the Mattermost team. DNS administrators must create or confirm the public or internal hostname that users will type. The certificate owner must either approve a Let's Encrypt issuance or supply a certificate and its chain from your internal or commercial authority. Network or firewall administrators must allow inbound traffic on port 443 to the terminating host, and on port 80 if you use the HTTP challenge or redirects. Security or platform owners must agree on where private keys are stored and who can read them. Request these approvals in writing before the build starts so that the schedule does not depend on informal favors.
Is Let's Encrypt acceptable under our security or compliance policy?
Let's Encrypt issues publicly trusted certificates with short validity periods and automated renewal, which some policies accept and others do not. Check whether your policy permits certificates issued by a public certificate authority, whether it requires internal issuance for internal hostnames, and whether it sets limits on certificate lifetime or key handling. Public issuance also needs the hostname to be reachable from the internet for the validation method you choose, which may conflict with a private network design. If your policy requires a private certificate authority or a commercial certificate, the built-in and proxy options still work, but the renewal process and trust distribution will differ. Confirm the answer with your security and compliance owners before you commit to a design.
How do we keep certificate renewal working after a Mattermost upgrade?
Renewal breaks most often when an upgrade or configuration change removes the path that the renewal client or proxy depends on, such as a port binding, a challenge directory, a file location, or a reload hook. Keep the renewal method, certificate file paths, and the service reload step in your change record, and check them as part of every upgrade. Test renewal in a non-production environment with the same proxy or server configuration, and confirm that the process reloads the service without a full restart where your setup allows it. Monitor certificate expiry independently of the renewal job so that a silent failure is caught well before the certificate expires.
What changes about TLS when we move Mattermost to high availability?
High availability moves TLS from one server to a group of components, so the design must decide where certificates terminate and how every node or load balancer receives the same certificate. Mattermost high availability uses redundant application servers, database servers and load balancers, and it is available only on the Enterprise and Enterprise Advanced plans. In practice, the load balancer tier usually terminates TLS, so renewal and certificate distribution must cover every load balancer instance. Confirm the cluster topology with your Mattermost design before you finalize the TLS path, because the on-server option that suits small installs does not fit a clustered deployment.
How is the cost of a Mattermost TLS setup quoted?
A written quote should follow from a written scope that lists the termination point, the certificate source, the number of hostnames and environments, the network changes required, the documentation expected, and any support after go-live. Ask whether the quote covers the build only or also covers renewal setup, testing of renewal after an upgrade, and handover. Your own costs also count: staff time from DNS, network, and security teams, and any certificate fees if you use a commercial authority. Recurring costs are mostly the time spent on renewal checks and upgrades, which you should price separately from the one-time build. DeployOpen does not publish a price list, and a quote follows from the agreed scope.
Keeping TLS working through upgrades and HA growth
The point of this section is that TLS settings drift during upgrades and growth, so the proxy and site configuration need a recheck after every server upgrade. Mattermost publishes a new server version in binary form on the 16th of each month, and each monthly release is a chance for the surrounding configuration to fall out of step with the server. After each upgrade, confirm three things: the reverse proxy configuration still forwards the Host and X-Forwarded-Proto headers the server expects, the SiteURL value in config.json still matches the public HTTPS address users type in, and the WebSocket path used for real-time updates still proxies correctly. A certificate that renews cleanly can still break the browser experience if the site URL points at the old ` address or the WebSocket upgrade headers were dropped during a proxy template change. Test sign-in, a channel that receives live messages, and a file download from a browser after each upgrade, not only a health check.
Extended Support Releases change the planning rhythm. Mattermost v11.7 is an Extended Support Release, released on 2026-05-15 with support ending 2027-05-15, so a team on that line has a longer window between forced changes than a team following each monthly release. Use that window to schedule the TLS recheck as a standing item in the change calendar, not as a side task of each upgrade. Confirm the support end date for your release line against the Mattermost server releases page before you set the upgrade cadence, because the date governs when you must move. Also confirm whether your proxy, operating system and certificate tooling are still supported at the versions you run, since those components are often upgraded on their own schedule.
When the deployment grows into a high availability cluster, TLS termination moves from one server to a load balancer tier in front of several application nodes. Mattermost high availability requires redundant application servers, redundant database servers and redundant load balancers, and it is available only on the Enterprise and Enterprise Advanced plans, so confirm plan eligibility before you design the tier. Decide where the certificate lives: on the load balancer, with traffic re-encrypted to the nodes, or terminated at each node. Each choice changes who renews certificates, where the private key is stored and how SiteURL and forwarded headers are set. Shared storage also matters here, because a cluster needs shared file storage on Amazon S3, an S3-compatible service or NAS mounted on each node, and local file system storage risks corrupting files. Confirm with your architect which renewal method and key distribution your load balancers support, and test a renewal in staging before the first production cluster goes live.

