Installing Mattermost on RHEL, Rocky Linux or AlmaLinux

A practical guide to installing self-hosted Mattermost on RHEL 9 and compatible distributions from the release tarball, covering systemd, SELinux contexts, firewalld and fapolicyd allow rules.

On this page

Installing Mattermost on RHEL, Rocky Linux or AlmaLinux: when the tarball route fits

A team running an RHEL 9 family estate that must host Mattermost on servers it controls will succeed or fail on the same few tasks: placing the release tarball, writing a systemd unit that runs the server as a dedicated account, and setting SELinux contexts and firewalld rules so the service starts and stays reachable. Mattermost itself is simple to describe. It runs as a single Linux binary written in Go and React, and it stores its data in PostgreSQL. Because the server is one process with a database behind it, a tarball install on a host you already manage fits well when your standards favor packages, native service management and kernel-level policy over container runtimes.

The tarball route is usually the better fit when your security team already reviews RHEL hosts through SELinux, firewalld and fapolicyd, when your operations team wants Mattermost to behave like any other systemd service, or when container images are not yet approved in your environment. It is less suitable when your standard is Kubernetes or when you need the high availability features that Mattermost reserves for its Enterprise and Enterprise Advanced plans. Before committing, confirm which Mattermost release line you will run, since monthly releases and Extended Support Releases have different support windows, and check the current Mattermost server releases page for dates.

This page walks through the install itself: unpacking the release, creating the service account and directories, the systemd unit, the SELinux file contexts that let the binary write its data and logs, the firewalld and fapolicyd allow rules, and the checks that prove the install works. It assumes PostgreSQL is already prepared and that you have decided where TLS terminates and where file storage lives. Those decisions have their own sections, so treat this page as the host-level layer that sits beneath them.

What the RHEL host and team must have before the install starts

A RHEL-family install fails most often on decisions made before anyone runs the installer. These six cards cover the platform baseline, the database, the service identity, shared storage, and the names and certificates users will reach. Confirm the current supported OS and Mattermost versions with the vendor docs before you lock the plan.

Supported OS baseline

Start from a RHEL 9 family host (RHEL, Rocky Linux or AlmaLinux) with a current patch level, subscription or repository access for updates, and time sync configured. Confirm with the Mattermost server deployment docs which operating system versions the release you plan to install supports, because the supported list changes between releases. Record the kernel and OS version in the build ticket so the install can be reproduced.

Deployment planning docs

PostgreSQL version and support window

Mattermost stores its data in PostgreSQL, so the database version is a platform decision, not a detail. Among the currently supported PostgreSQL releases, version 15 is supported to November 11, 2027, version 16 to November 9, 2028, and version 17 to November 8, 2029. Pick a version whose support window outlasts your planned Mattermost upgrade cycle, and confirm compatibility with your release.

PostgreSQL versioning policy

Dedicated service account

Create a non-login system account, for example mattermost, that owns the install directory and the configuration file, separate from any administrator's personal account. Keep the service running under this account, with write access limited to the data and log paths it needs. Decide who can change the configuration and who can restart the service, and document that split before go-live.

File storage location

Decide where uploaded files will live before the install, because it changes the server layout. Local disk works for a single small server, but a high availability cluster requires shared storage such as Amazon S3, an S3-compatible service or a NAS mounted on every node. Size the mount point, set ownership for the service account, and confirm the storage option with your architecture owner before you configure it.

DNS and TLS planning

Choose the public host name, such as chat.example.com (illustrative), and create the DNS record before you configure the site URL, since clients and integrations depend on it. Decide whether TLS terminates on a reverse proxy or on the Mattermost server, and obtain a certificate from your own CA or an approved service. Plan renewal ownership up front so an expired certificate does not stop logins.

Named owners and change window

Name the people who will own the host, the database, the mail relay and the upgrade schedule before work begins. Confirm the change window and the rollback path with your change board, and agree who approves the release notes review each month. Mattermost publishes server releases on a monthly cadence, so an unowned upgrade path becomes a security exposure within a few cycles.

Monthly binary release day
16th
Server releases page

Install options on RHEL and how each fits

This table compares the tarball install on RHEL-family systems with Docker Compose, Kubernetes and the Ubuntu or Debian APT route, showing fit, operational burden and the controls each leaves with your team. Read it to decide whether a RHEL host is the right base for your size of deployment and who owns SELinux, firewall and application allow-listing work.

OptionBest fitOperational burdenControls left to your team
Tarball on RHEL, Rocky or AlmaLinuxSingle-server or small production sites that already run RHEL-family hosts under enterprise standardsModerate: you manage the systemd unit, PostgreSQL, upgrades and file ownership by handSELinux contexts, firewalld rules, fapolicyd allow rules, service account and backups
Docker ComposeEvaluation, pilots and small sites that want a packaged app and database stackLower for first build, but you still own host patching, container images and volumesImage pinning, volume permissions, network exposure and container host hardening
KubernetesSites that need high availability, since Mattermost points HA deployments toward KubernetesHighest: cluster operations, ingress, storage classes and upgrades sit beside MattermostCluster hardening, shared storage, database replicas and cluster recovery
APT route on Ubuntu or DebianTeams standardized on Debian-family hosts that prefer package-managed updatesLower day-to-day updates through the signed repository, with PostgreSQL still separateRepository key trust, PostgreSQL setup and maintenance windows
High availability on any routeOrganizations that need redundant app servers, database servers and load balancersHigh: needs an Enterprise or Enterprise Advanced plan and shared storage on each nodePlan purchase, S3, S3-compatible or NAS storage, and cluster testing (confirm details with Mattermost)

How to install Mattermost on RHEL 9 step by step

This sequence takes a fresh RHEL 9 host from a bare operating system to a running Mattermost server that answers health checks and accepts a login. Each step ends with a check so the administrator can confirm the layer works before the next one depends on it.

  1. Create the service account and directories

    A system administrator creates a non-login system user named mattermost, then creates the install directory, a separate directory for file storage if you use local disk, and a log location, all owned by that user. Keep the install tree out of the home directory of any person. Confirm the result with id mattermost and ls -ld on each directory, checking that the owner is mattermost and that the user cannot log in interactively. Confirm the exact paths and ownership against the install guide for the version you are deploying.

  2. Extract the release tarball and set ownership

    Download the Enterprise or Team Edition server tarball for your chosen version from the Mattermost downloads site, verify its checksum against the value published with the release, and extract it into the install directory as root. Then change ownership of the extracted tree to the mattermost user and confirm that the server binary is present and executable. Check the result by running the binary with its version flag as the mattermost user and reading back the version string, which should match the release you downloaded.

  3. Configure config.json and the database connection

    Edit config/config.json so the SQL data source points to your PostgreSQL primary, with the database name, user and TLS settings your database team created, and set the site URL to the address users will type into the browser. Set the file storage driver and its path or bucket settings to match your storage decision, and keep the file readable only by the mattermost user. Confirm the configuration by running the server's configuration validation command, if your version provides one, and checking that the database connection succeeds in the log before going further.

  4. Create the systemd unit

    Write a systemd unit file named mattermost.service that runs the server binary as the mattermost user, sets the working directory to the install path, restarts the process on failure and orders it after the network and database are available. Place it under /etc/systemd/system, run systemctl daemon-reload, then enable the unit so it starts at boot without starting it yet. Confirm the unit loads cleanly by running systemctl cat mattermost and checking that systemctl status reports the unit as loaded and inactive, with no parse errors in the journal.

  5. Set SELinux contexts and booleans

    With SELinux in enforcing mode, label the install directory and the file storage path so the mattermost service can read its binaries and config and write uploads, using semanage fcontext rules followed by restorecon. Apply any boolean changes your deployment needs for outbound database or network connections, and check the policy rules for the ports you will bind. Confirm the labels with ls -Z on each path and check the audit log for denials after a test start, since a missing label often shows up there first. Review the rules with your security team before you change the mode.

  6. Open firewalld services for required ports

    Add firewalld rules for the ports your Mattermost design uses, which typically include HTTPS on 443 for the proxy or the server, HTTP on 80 for redirects, and the application port 8065 only if clients reach the server directly. Open them in the active zone with firewall-cmd, make them permanent, and reload. Limit the source addresses where your network design allows it, and leave cluster and metrics ports closed unless you run those features. Confirm with firewall-cmd --list-all that only the intended services and ports appear.

  7. Add fapolicyd allow rules for the binary and plugins

    If fapolicyd is enforcing on the host, add trust or rules that allow the Mattermost server binary and the plugin directory to execute, using the rules format your fapolicyd version supports, then rebuild the trust database and restart the daemon. Allow only the files that ship in the release and the plugins you have approved, and keep the rule set under change control. Confirm the setup by starting the service in step 8 and checking the fapolicyd log for denials of the server or plugin files, then adjust the rules narrowly if any appear.

  8. Start the service and verify health and login

    Start the mattermost service with systemctl start, then follow the journal until the server reports that it is listening and connected to the database. Request the health or ping endpoint documented for your version through the proxy or directly on the server, and expect a successful response. Sign in through the browser with the first system administrator account, create a test user, and confirm that a message posts and a small file uploads and downloads. Confirm the final state by checking the log for errors and the system status as healthy.

Why SELinux contexts and fapolicyd rules break a fresh Mattermost install

A fresh Mattermost install on RHEL, Rocky Linux or AlmaLinux often fails not because the software is wrong but because two host controls the package set does not account for are doing their job. SELinux labels decide what a process may touch, and fapolicyd decides which executables the system will run at all. Both sit underneath systemd, so a service that starts cleanly from the shell can still fail under the unit file. Expect the failure to look like a permissions problem even when Unix ownership and modes are correct.

SELinux checks the label on the Mattermost binary before systemd can execute it, the label on the config file before the server can read config.json, and the label on the file storage directory before the server can write uploads. If the tarball was unpacked into a location such as /root or a home directory, or the storage path was created by hand, the files may carry labels that the Mattermost service domain is not permitted to use. fapolicyd works on a different axis: it checks each executable, and in some setups each shared library or plugin, against a trust database. A binary or plugin that was not in the trust set when the system was built or updated can be denied with no clear message in the service log.

Look in the audit log first. Denials from SELinux appear as AVC records in /var/log/audit/audit.log, and ausearch -m AVC -ts recent or sealert will summarize them. fapolicyd denials are logged with a deny event that names the path and the hash. Confirm the exact paths your install uses before writing any rule, because a rule for the wrong path does nothing. The fix is to add narrow allow rules: a file context for the install and storage paths, a boolean only if the audit log names one, and a fapolicyd trust entry for the specific binary or plugin. Disabling SELinux or setting fapolicyd to permissive mode hides the problem and removes controls that a security review will expect to see enforced. Record each rule so the upgrade process can reproduce it.

How the RHEL host, firewall, proxy and database fit together

The diagram starts with clients on the corporate network reaching the host through firewalld, which allows only the ports the reverse proxy or Mattermost itself needs. An optional reverse proxy terminates TLS and forwards traffic to the Mattermost systemd service, which runs as the single server binary. The service talks to PostgreSQL over the database network and writes uploaded files to the storage path. SELinux and fapolicyd sit on the host as enforcement layers that can block the binary, its file contexts and its network or file access, so check both logs when a hand-off fails.

Request path through the RHEL host, with host enforcement layers marked.

Security controls to apply on the RHEL host

A Mattermost server on RHEL-family systems runs with several host-level controls that sit beside the application's own settings. Each card below covers one control, what it protects and what to verify after installation. Apply them together, because a permissive file mode or an open port weakens the protection SELinux and fapolicyd provide.

Keep SELinux enforcing

Run SELinux in enforcing mode and add targeted allow rules for the Mattermost binary, its data directory and its listening port, rather than switching the policy off when the service fails to start. Check the file contexts on the binary, the data and file storage paths, and the config file after you copy them into place, since files moved from another location keep their old labels. Confirm the audit log records any denials so you can review them before adding a rule.

Least-privilege service account and config permissions

Run Mattermost under a dedicated system account with no login shell, and make that account the only owner of the working directories it writes to. Restrict config.json so only the service account and administrators can read it, because the file holds the database connection string, the file storage keys and the SMTP credentials. Verify the permissions with a listing after every upgrade, since package or tarball extraction can reset them.

Scope firewalld to required ports

Open only the ports your design needs in firewalld, typically the public web ports at the proxy and the application port reachable from that proxy, and leave the database port closed to everything except the Mattermost host. If you run a high availability cluster, cluster gossip and metrics ports need rules limited to the other nodes and the monitoring host. Confirm the final zones and rules with a port scan from a host outside the allowed network.

Trust the binary with fapolicyd

On systems where fapolicyd is enforcing, add an allow rule for the Mattermost binary by path, hash or trusted source so the service can start without disabling the policy. Re-check the rule after each binary replacement, because a new file will not match an old hash-based rule. Review the fapolicyd log for denials on the plugin directory and any helper binaries your configuration calls.

Protect database credentials

Keep the PostgreSQL password out of shell history, process listings and general log output, and store it where only the service account can read it. Give the Mattermost database user only the rights it needs on its own database, and confirm the database server accepts the authentication method you configured for that user. Rotate the password on a schedule your security team sets and record the change in the same place as the config file update.

Patch the OS and Mattermost monthly

Mattermost releases a new server version in binary form on the 16th of each month, so plan a monthly review of the server release notes alongside your RHEL security updates. Extended Support Releases follow a longer cycle, and you should confirm with your own change process which track the server follows. Test each update on a staging host first, then record the version you deployed and the date your support window ends.

Server releases

Questions buyers ask before installing Mattermost on RHEL

How much does a DeployOpen Mattermost install cost?

DeployOpen does not publish a price list. A quote follows from the written scope, which is agreed before work starts. The scope sets the cost: how many servers and environments are involved, whether PostgreSQL and the reverse proxy are built in the same engagement, how many SELinux and fapolicyd rules need to be written and tested, and whether you want a retainer for upgrades afterward. Ask for the quote to list each deliverable, what is one-time work and what recurs, and which parts are your team's responsibility. Mattermost licensing is a separate cost. Its plans are prepaid annual subscriptions based on seat licenses, and the pricing page lists no public prices, so ask Mattermost sales for those figures.

How long does a Mattermost install on RHEL take?

Duration depends on the scope rather than on the install command itself. The main drivers are the number of environments (test and production usually take longer than one server), whether your security policy requires fapolicyd and SELinux to stay in enforcing mode, how quickly your team can approve firewalld changes and PostgreSQL access, and whether a proxy, TLS certificate and file storage are in scope. Your security team's review cycle often sets the pace. Ask for a timeline in the written scope that names the dependencies on your side, such as change windows and access approvals.

What does our team need to provide for the install?

Expect to provide a Linux host or hosts that meet the Mattermost server requirements for your version, access to a RHEL 9 or compatible subscription or repository, a PostgreSQL instance or the approval to create one, DNS names and TLS certificate material, and a named owner who can approve firewall and policy changes. You also need someone who knows your identity and email systems if those are in scope. Confirm with your change board which hosts, accounts and network paths require approval before the work starts, because these are the most common delays.

Can our own team install Mattermost on RHEL without a partner?

Yes, a capable Linux team can install Mattermost from the release tarball by following the vendor documentation. The work is manageable when the team already runs systemd services, understands SELinux contexts and can read firewalld and fapolicyd logs. The risk sits in the details that are easy to skip: restoring correct file contexts, allowing the server binary and plugins under fapolicyd, opening only the ports you need, and documenting the setup so that upgrades do not break it. Decide based on whether someone on your team will own the service after go-live and whether they have time for the upgrade cycle.

How do we diagnose SELinux and fapolicyd problems during a Mattermost install?

Start by reading the audit log for denials that match the Mattermost process, then check whether the file contexts on the binary, configuration directory and data directory match what the service expects. For SELinux, ausearch -m AVC and sealert show which label or port is blocked, and restorecon corrects mislabeled files. For fapolicyd, the logs show which binary or library was denied, and the fix is usually a trust rule for the exact file path and hash rather than turning the policy off. Keep a record of every rule you add, because each one is an exception that a security review will ask about. Test each change in a non-production host first.

When should we choose a partner for a Mattermost install on RHEL?

Choose a partner when the install must pass a security or compliance review on a fixed date, when several environments need identical builds, or when your team lacks time to own SELinux and fapolicyd policy through upgrades. A partner is also useful when the deployment must later move to high availability, which requires shared file storage and separate database and load balancer tiers, and the Enterprise plans are the ones that include clustering. DeployOpen plans, implements, hardens, documents and supports self-hosted platforms in infrastructure you control, and most engagements are fixed-scope with the terms agreed in writing first. Ask any partner to show how it tests policy changes and hands over the runbook.

Does a RHEL install need extra work for compliance evidence?

A hardened install produces evidence that auditors ask for: documented configuration, a record of firewall and policy exceptions, access controls on the host, and logs showing who changed what. 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. Confirm with your assessor which frameworks apply and which evidence they expect before the build starts, so the configuration records are captured during the install rather than reconstructed later.

How DeployOpen scopes and delivers a RHEL Mattermost install

DeployOpen scopes a RHEL Mattermost install in writing before any work starts. The written scope names the target distribution (RHEL 9 or a compatible rebuild such as Rocky Linux or AlmaLinux), the Mattermost server version and release channel, the PostgreSQL version and where it runs, the file storage backend, the TLS and reverse proxy design, the SSO and identity provider, and the hosts and network zones in your infrastructure. The scope also states who owns each decision. The environment review comes first and checks the things that are hard to change later: whether SELinux is enforcing, whether fapolicyd is in use and what its trust policy allows, the firewalld zones and outbound paths to the database, SMTP, LDAP and object storage, and the change-control process your team requires. A quote follows from that written scope, so you can compare it against your own team's estimate line by line.

The build follows the scope and covers the parts of the RHEL install that usually fail in production: the systemd unit and service account, the file ownership and SELinux contexts on the configuration and data directories, the firewalld rules for the ports your design uses, and the fapolicyd allow rules for the binary and plugin paths. Each control is tested against the running service rather than assumed to work. Hardening follows the same written scope, and any control that conflicts with a requirement you have already set is raised before it is applied. Handover consists of runbooks for installation, upgrades, backups and restores, and the checks your operations team will run after a change, so the knowledge stays with your team. Ongoing support, upgrades and continuous testing are available as retainers, which you can take on after handover or skip. Confirm with your DeployOpen contact which deliverables, acceptance tests and timelines apply to your scope, since these are agreed per engagement rather than set in advance.

How DeployOpen works on Mattermost installs

DeployOpen plans and installs self-hosted Mattermost inside your own infrastructure, including the RHEL-family host settings that a plain tarball install leaves to the operator. We scope the work in writing first, then build, test and document the server so your security and platform teams can review it before go-live.

How we scope

  • Written scope covers host OS version, server sizing, PostgreSQL connection, and file storage choice for your environment.
  • Scope lists the SELinux contexts, firewalld zones and fapolicyd rules that your hardening policy requires on each host.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any installation begins.

How we build

  • We install the release tarball, create the service account, and configure the systemd unit to match your change process.
  • We apply and verify SELinux file contexts for the binary, configuration, and data paths, then confirm the service starts cleanly.
  • We open only the ports your scope names in firewalld and test fapolicyd allow rules against the server binary and plugins.

How we hand over

  • You receive an installation record covering versions, file paths, service settings, SELinux and firewall rules, and fapolicyd entries.
  • Runbooks describe how to apply a monthly server release and how to roll back if a restart or policy check fails.
  • We walk your operations and security staff through the build and the verification results before the engagement closes.

How we support

  • Ongoing support, upgrades and continuous testing are available as a retainer covering monthly and Extended Support Releases.
  • We retest host hardening after OS updates, SELinux policy changes, or fapolicyd rule changes that could block the server.
  • Confirm with DeployOpen the support window, response expectations and change handling in the written retainer before signing.

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.