Installing Mattermost on Ubuntu or Debian from the APT repository: when a package install fits
The APT repository install is a supported path for a self-hosted Mattermost on Ubuntu 22.04 or 24.04 and Debian 12, so a team that wants a production-ready server on one Linux host can plan around it directly. Mattermost is an open core collaboration platform written in Go and React that runs as a single Linux binary and stores its data in PostgreSQL. Its compiled binaries are MIT licensed, the source for custom builds is AGPL v3.0 with a commercial alternative from Mattermost, Inc., and admin tools and configuration files are Apache 2.0. Because the application is one binary, a package install on one server with a dedicated PostgreSQL instance fits a team that does not need redundancy at the application layer.
The package install is the right starting point when one server, one database and a tested restore procedure meet your availability needs. High availability with redundant application servers, database servers and load balancers is available only on the Enterprise and Enterprise Advanced plans, and it requires shared file storage on S3, an S3-compatible service or NAS on every node. If you expect to need that clustering within the first year, decide on the plan and storage backend before you install, because moving a single server into a cluster later is a larger project than the install itself. Confirm the current plan entitlements with Mattermost sales, since the pricing page lists no public prices.
Mattermost releases a new server version in binary form on the 16th of each month, and you choose between tracking those monthly releases and staying on an Extended Support Release. The current ESR is v11.7, released on 2026-05-15 with support ending 2027-05-15, which suits organizations that prefer fewer upgrades. Pick the release track before the install, record the version you deploy, and check the Mattermost server releases page for the support end date that applies to your choice.
How to install Mattermost from the APT repository step by step
This sequence takes a prepared Ubuntu 22.04 or 24.04, or Debian 12, host to a running Mattermost server backed by PostgreSQL. Each step ends with a check, so a fault is caught before the next layer depends on it. Confirm every version, key fingerprint and file path against the Mattermost install docs before you run it.
Confirm the target Mattermost release
The engineer who owns the install chooses the Mattermost server version before any host is built, because the release sets the PostgreSQL and operating system requirements that follow. Mattermost ships a new server version in binary form on the 16th of each month, and Extended Support Releases are tracked separately. The server releases page lists v12.0 as released on 2026-10-16 and v11.7 as an Extended Support Release supported until 2027-05-15. Record the chosen version and its end-of-support date in the change ticket. Check: the version and end-of-support date appear in the decision record, and your Ubuntu or Debian release is on the supported list in the install docs.
Prepare the operating system and clock
The platform engineer applies pending updates, sets the host name, and confirms the host synchronizes time with your approved NTP source, using chrony or systemd-timesyncd as your standard requires. Accurate time matters for TLS certificates, SSO assertions and log correlation. Confirm the supported Ubuntu 22.04, Ubuntu 24.04 or Debian 12 release and the minimum glibc level for your chosen version in the install docs, because the glibc requirement applies from v12 onward. Check: the time synchronization tool reports the clock as synchronized, and the package update completes without errors.
Install and configure PostgreSQL first
A database engineer installs PostgreSQL before Mattermost so the application has a database ready at its first start. Choose a supported major version. The PostgreSQL versioning policy lists 18, 17, 16 and 15 as supported, and 14 reaches end of support on November 12, 2026, so avoid it for a new build. Create a dedicated owner for the database and a separate application role, use UTF-8 encoding, and limit network access to the Mattermost server address. Check: a login as the application role succeeds from the Mattermost host and is refused from other hosts.
Import and verify the repository signing key
The engineer downloads the Mattermost APT signing key from the location given in the official install docs and stores it in the apt keyrings directory. The signing key has changed, so do not reuse a key from older guides, earlier hosts or third-party copies. Compare the fingerprint printed by gpg with the fingerprint published in the docs, and record both values in the ticket. Stop if they differ. Check: the gpg key listing shows a fingerprint that matches the documented value character for character.
Add the repository and install the package
The engineer adds the Mattermost repository entry for the codename of the operating system, points it at the keyring from the previous step, and refreshes the package index. Install the package for the version chosen in the first step by pinning that version explicitly, rather than accepting whatever the index offers on the day. Confirm the repository line, suite name and package naming against the install docs for your release. Check: the policy listing shows the Mattermost origin with the expected version, and the installation finishes without signature warnings.
Point Mattermost at PostgreSQL and set the site URL
The engineer edits the Mattermost configuration file so the server uses the PostgreSQL database created earlier. Set the database driver to PostgreSQL, and set the data source with the application role, host, port, database name and the SSL mode your security policy requires. Set the public site URL that users will open. Confirm the configuration path and key names for your version in the docs. Keep the database password in a restricted file or a secrets store. Check: the file parses as valid JSON, and its permissions allow only the service account to read it.
Start the service and run health checks
The engineer enables and starts the Mattermost service, then follows its logs until the server reports a database connection and is listening on its configured port. Confirm the listening port and health endpoint in the network ports documentation, and test them through the same proxy or load balancer path that users will take. Create the first system administrator account through the documented first-run process, then open the System Console. Check: the health endpoint returns a healthy status, the logs show no database errors, and a test message posts between two accounts.
Which Ubuntu, Debian and PostgreSQL choices fit your site
This table compares the three supported operating systems, the PostgreSQL major versions still in support, and the monthly release channel against the Extended Support Release (ESR). Read each row against your own host standards and upgrade calendar, then confirm the glibc floor from v12 before you commit to an OS. The main takeaway is that PostgreSQL 14 leaves support first, so new installs should start on a newer major version.
| Choice | Support window | When it fits | What to confirm |
|---|---|---|---|
| Ubuntu 22.04 | Set by Canonical; confirm the end date | Hosts already standardized on this release | Compare its glibc version with the v12 floor |
| Ubuntu 24.04 | Set by Canonical; confirm the end date | New builds where your standard base image is current | Compare its glibc version with the v12 floor |
| Debian 12 | Set by Debian; confirm the end date | Sites that standardize on Debian stable servers | Compare its glibc version with the v12 floor |
| PostgreSQL 18 | Final release November 14, 2030 | New installs that need the longest supported runway | Confirm Mattermost lists this version in its requirements |
| PostgreSQL 17 | Final release November 8, 2029 | New installs that want a version with many years of support left | Confirm Mattermost lists this version in its requirements |
| PostgreSQL 16 | Final release November 9, 2028 | Installs that already have this version tested in-house | Confirm Mattermost lists this version in its requirements |
| PostgreSQL 15 | Final release November 11, 2027 | Existing databases with a major upgrade already scheduled | Plan the move to a newer major version before this date |
| PostgreSQL 14 | Final release November 12, 2026 | Existing databases only, until they move to a newer major version | Schedule the upgrade now, because support ends soon after this date |
| Monthly release or ESR | Monthly: v11.11 to 2026-12-15, v12.0 to 2027-01-15. ESR v11.7 to 2027-05-15 | Monthly suits teams that test and upgrade often. ESR suits teams that want fewer upgrades | Confirm the glibc floor from v12 matches your OS before choosing monthly |
Why PostgreSQL must be ready before Mattermost starts
Mattermost uses PostgreSQL as its only database, so the database, the role that owns it, the authentication method and the network path between the application and the database must all exist before the first start. If any of them is missing, the server will fail to connect and the install will look broken when the real fault is in the database layer. Work through the database side first, then start mattermost.service and read its logs. Plan for a PostgreSQL major version that is still inside its support window: the PostgreSQL versioning policy lists PostgreSQL 14 as supported only until November 12, 2026, while 15 runs to November 11, 2027, 16 to November 9, 2028, 17 to November 8, 2029 and 18 to November 14, 2030. Confirm which major version your distribution packages and whether your upgrade plan covers it before you commit to it.
Authentication is the setting most likely to block the first connection. PostgreSQL 18 deprecated MD5 password authentication in favor of SCRAM, so the role should be created with a SCRAM password and the pg_hba.conf entry for the Mattermost connection should use scram-sha-256. Check the authentication method in the PostgreSQL client authentication documentation for your version before you write the rule, and confirm that the Mattermost database user matches the DataSource value in config.json, including the database name and SSL mode. Do not solve a failed login by loosening the rule to trust.
Where PostgreSQL runs changes the work. On the same host, the connection stays on the loopback interface, listen_addresses can remain local and no inbound database port needs to be opened. On a separate host, you must set listen_addresses to the interface the application uses, add a pg_hba.conf entry for the application server's address only, and open the PostgreSQL port in the firewall between those two machines. Ask your network team to confirm that path and the port your site uses before the install, because a blocked port looks the same as a wrong password in the Mattermost log.
How the install components connect on one server
Users reach the Mattermost server on its web port, and the server reads and writes its data in PostgreSQL on a separate database host. Attachments go to file storage and outbound calls leave the server for mail and push services. The APT repository and its signing key sit only in the install phase, so check the key before any package is installed. The line between the server and the database host is the trust boundary to review, since database credentials and traffic cross it.
Request, database and storage paths for a single Mattermost server, with the install phase shown separately.
What drives sizing for about 1,000 users
A 1,000-user Mattermost server is shaped less by headcount than by how many people are active at once, how much they upload and search, and how fast the database and backups grow. These drivers interact, so the right server and database sizes come from Mattermost sizing guidance and a load test run in your own environment.
Concurrent connections
Mattermost holds open WebSocket connections for each active client, so the number of people online at the same moment matters more than the number of accounts. Count peak concurrent users across desktop, web and mobile clients, not total seats. Ask how many simultaneous sessions your sizing assumes and whether your reverse proxy and load balancer handle long-lived connections.
Deployment planning docsFile upload volume
Attachments are stored outside the database and pass through the application servers, so upload size and frequency drive CPU, memory, network and storage needs. A team that shares design files or video will load the server differently from one that posts text. Estimate upload volume per day and per largest expected file, and confirm the maximum file size you will allow.
Search load
Search queries run against the database and can become expensive as message history grows, especially for busy channels and broad date ranges. Search load often rises faster than message volume because users search more as the archive expands. Plan for query volume at peak, and confirm with Mattermost whether search replicas or other search components are needed at your user count.
Database storage growth
Messages, reactions, channel membership and audit records accumulate in PostgreSQL every day, and retention settings decide whether that growth is bounded. Measure how many messages a typical active user sends and how long you keep them. Size the data volume with headroom for growth, and set alerts on free space before the database fills.
Backup window
A full database dump and file storage copy must finish within the time your operations allow, and that window grows with data volume. Large databases can make nightly backups overlap the working day. Confirm how long a restore takes in a test, because recovery time matters more than backup speed on paper.
Local or shared file storage
Whether attachments live on local disk or on shared storage changes the design of the whole server. Local storage suits a single server, but a clustered deployment needs shared storage mounted on every node, and local disk on multiple nodes is unsafe. Decide the file store before sizing disks, and confirm the choice against your high availability plans.
Questions buyers ask before installing Mattermost on Ubuntu or Debian
Can our internal team do the Mattermost APT install alone?
Yes, if you have a Linux engineer who can manage PostgreSQL, TLS, DNS and systemd services and who can own the server after go-live. The package install itself is short. The work that takes longer is preparing the database, choosing where TLS terminates, setting up file storage, confirming the outbound paths for email, LDAP and push, and documenting the upgrade routine. Ask whether your team has done a production PostgreSQL install before and whether anyone will be on call for the server. If the answer to either is no, a partner can carry the build while your team learns the runbook.
What drives the cost and effort of an APT install?
The main drivers are the number of environments (test, staging and production), how much of the surrounding stack you need in place, and how many integrations must work at launch. Single sign-on, AD or LDAP sync, SMTP, object storage for attachments and a reverse proxy each add configuration and testing. Data migration from another chat tool adds a separate workstream. Costs are split between internal staff time, any infrastructure you pay for, and any external services. Most of the cost is one-time build work, while patching, upgrades and monitoring recur. Ask any provider for a quote that lists each of these items separately.
What does the work need from our side before it starts?
Plan for access and approvals early. You will need administrative access to the target Ubuntu 22.04 or 24.04 or Debian 12 hosts, a database host or managed database account, DNS records for the Mattermost hostname, and a TLS certificate or a decision to use Let's Encrypt. You will also need firewall changes for the ports the server uses, a named owner for email and identity provider settings, and change windows for the cutover. Confirm these in writing before the build starts, because waiting on a firewall ticket or certificate request is a common cause of schedule slip.
How long does a Mattermost install take, and what changes the timing?
Duration depends on scope. A single-server install with a prepared PostgreSQL database and no identity integration is a much smaller task than a production build with SSO, LDAP sync, object storage, a reverse proxy, backup testing and a migration. Timing is also set by approvals, change windows and how quickly your team reviews configuration. Ask for a timeline tied to specific milestones in the written scope, and confirm which of your environments are included. Do not accept a duration that is not tied to the scope items it covers.
When do we need high availability on the Enterprise plan instead of a single server?
Consider high availability when a single server cannot meet your uptime or capacity needs, or when your policy requires redundant application and database servers. Mattermost documents high availability clustering as part of its Enterprise and Enterprise Advanced plans, and it needs shared file storage on Amazon S3, an S3-compatible service or NAS mounted on each node, because local file storage will not work correctly in a cluster. Database read replicas are also part of the scaling options. A single-server APT install is a valid starting point, but the file storage, database and proxy choices made at install time affect how easily you can move to a cluster later. Confirm plan entitlements with Mattermost before you size the design.
What should we ask for in a quote for this install?
Ask for a written scope that names each host and environment, the Mattermost version and the package source, the PostgreSQL version and whether it is self-managed or managed, the TLS and DNS approach, the file storage backend, the identity and email integrations, and the backup and restore test. Ask which items are one-time work and which are recurring, such as upgrades, monitoring and support. Ask what is excluded, how changes to scope are priced, what the handover includes and who signs off acceptance. A quote that lacks these items is hard to compare with another, even if the headline number looks similar.
Which PostgreSQL version should we plan for on the database side?
Plan for a PostgreSQL version that is still in its support window for the whole life of the server. Current support dates from the PostgreSQL versioning policy show that version 14 ends support on November 12, 2026, while versions 15 through 18 have later end dates. Mattermost's own guidance on database preparation should also be checked against the release you install. Confirm the version your Mattermost release supports, then plan the major upgrade path before go-live, because major PostgreSQL upgrades need a tested method such as pg_upgrade or logical replication.
Security controls to set during the install
The install creates a server, a database and a package trust relationship, and each one can be weakened without any visible error. The cards below cover the controls to set while the system is still being built, so that the first production day does not depend on defaults. Check each one before the server takes users.
Verify the repository signing key
Mattermost packages come from a signed APT repository, and the key that signs them is changed over time. Before you trust any package, download the key from the official Mattermost source, compare its fingerprint with the value published there, and store the key in a dedicated keyring file rather than trusting an unverified key added in a hurry. Repeat this check whenever the key changes, because an install that silently accepts a new key has changed what your server trusts.
Mattermost release docsRestrict PostgreSQL network access
The Mattermost database holds every message, channel and account, so it should accept connections only from the Mattermost server. Limit the listen address in postgresql.conf and allow only the Mattermost host in pg_hba.conf, with the Mattermost role bound to the Mattermost database. Set password_encryption to scram-sha-256 so the role's password is stored with SCRAM rather than MD5, and confirm the existing role uses SCRAM before you go live.
Limit inbound ports
Mattermost listens on port 8065 by default, and a direct listener exposes the application without the TLS and header handling a reverse proxy provides. Allow inbound traffic only on 443 to the proxy, and allow 8065 only from the proxy host. Keep the database port closed to everything except the Mattermost server, and confirm the rules from a machine outside your user network, because a host firewall that blocks nothing is a common result of an unchecked default.
Protect secrets in config.json
The config.json file holds the database connection string, the file storage keys and other secrets in plain text. Set the file owner to the service account, restrict permissions so only that account and administrators can read it, and keep backups of the file encrypted and access controlled. Plan how you will rotate the database password and the file storage keys, and confirm which of these settings you will later move to environment variables or the database, since that decision changes where the secret lives.
Apply updates on the release schedule
Mattermost publishes server releases on a fixed monthly date, and Extended Support Releases are supported for longer. Choose one track at install time, write down the support end date for that version, and schedule the next maintenance window before the current version reaches end of support. Read the release notes for breaking changes before each upgrade, and test the upgrade against a copy of the production database so that a failed upgrade does not become an outage.
- Monthly release day
- 16th
Patch the database and server together
The Mattermost server and PostgreSQL are separate packages with separate support windows, and each can fall out of support on its own date. Track the PostgreSQL major version you run against its end-of-support date, and plan minor updates, which replace executables and need a restart, on the same maintenance calendar as the server. Confirm the database version is still supported by your Mattermost release before you upgrade either component.
- PostgreSQL 18 final
- 2030
What changes after the first install: upgrades, backups and monitoring
The first install is a one-time event, but the server and its database keep changing afterward, so the ongoing work is what decides whether the platform stays supported. Mattermost publishes a new server version in binary form on the 16th of each month, and the releases page lists a support end date for every version. Your team needs to decide early whether it will apply each monthly release or stay on an Extended Support Release line, and whether the APT package path matches that choice. Confirm the current support dates on the server releases page before you commit to a line, because a server that falls out of support leaves you without security fixes.
PostgreSQL carries its own calendar. Minor releases do not change the storage format, so applying them means replacing executables and restarting, while a major upgrade needs a planned method such as dump and restore, pg_upgrade, or logical replication. Confirm that the PostgreSQL major version on your server is still within its support window, and schedule the major move before it runs out. Mattermost also needs its own version to be compatible with the database version you choose, so check the Mattermost deployment documentation before any database change. Keep the two upgrade tracks on one calendar so they do not collide in the same maintenance window.
Backups are the control you will be asked about most in a review, and a copy of the database alone is not enough. Plan a base backup schedule plus continuous WAL archiving so you can restore to a point in time, and test that restore on a separate host, not only the backup job's exit status. The file store, the configuration file and the secrets used by the service must be included in the same recovery plan, or a restored database will point at missing attachments. Health checks, log collection and alerts on disk, database connections and service status complete the picture, and the operations content covers the specific metrics and alert rules to use. Ask your team who owns each check and how often someone reviews the results.
How DeployOpen works on this
DeployOpen plans and builds self-hosted Mattermost inside your own infrastructure, so the APT install, PostgreSQL database, ports and sizing are agreed before any server is touched. The work is delivered as a fixed-scope engagement with written deliverables, followed by documentation your team can run and retain.
How we scope
- We confirm the Ubuntu 22.04, Ubuntu 24.04 or Debian 12 hosts you will use and their patch baseline before work starts.
- The written scope states the PostgreSQL version, the sizing target for about 1,000 users, and which ports and network paths are opened.
- We agree in writing whether TLS, reverse proxy, file storage and SSO are in or out of this install, and who owns each.
How we build
- We install and verify PostgreSQL first, then the Mattermost package from the signed APT repository, following the GPG key change steps.
- We check the host glibc level against the floor that Mattermost v12 requires, and confirm the package version before it is installed.
- We test login, channel posting, file upload and the service restart path on a staging host before any production cutover.
How we hand over
- You receive a runbook covering install steps, configuration locations, service management, and the firewall rules that were applied.
- The handover documents the APT pinning, key verification and upgrade steps your team will repeat at each monthly server release.
- We walk your administrators through backup, restore and the first upgrade so the procedures are tested by your own staff.
How we support
- Ongoing support, upgrades and continuous testing are available as a retainer, scoped separately from the initial install.
- A retainer can cover monthly and Extended Support Release upgrades, with each upgrade planned against the support end dates your team confirms.
- Questions about Mattermost version support windows, plan features or subscription terms should be confirmed with Mattermost directly.

