How to Install Mattermost on AlmaLinux 10

How to Install Mattermost on AlmaLinux 10

In this blog post, we will show you how to install Mattermost on AlmaLinux 10 OS. Mattermost is a tool that helps teams communicate and work together online. People use it to send messages, share files, manage projects, and stay connected throughout the day. It is similar to apps like Slack or Microsoft Teams, but many companies choose Mattermost for greater privacy and control over their data. It is often used by businesses, developers, and government organizations. Mattermost is primarily written in Go for the server side, while the web and desktop apps are built with JavaScript, TypeScript, and the React framework for the user interface.

Installing Mattermost on AlmaLinux 10 is a straightforward process that may take up to 15 minutes. Let’s get started!

Prerequisites

Step 1. Update the System

Before we start installing any software, we will update the system packages to their latest versions. To do that, execute the following command:

dnf update -y && dnf upgrade -y

Step 2. Install PostgreSQL database server

Mattermost uses PostgreSQL to securely and efficiently store and manage important data, such as messages, user accounts, channels, files, and settings. To install it, execute the following command:

dnf install postgresql-server postgresql-devel postgresql-server-devel -y

Once installed, we need to initialize the database:

postgresql-setup --initdb --unit postgresql

Then we can start and enable the PostgreSQL service. You need to do the following:

systemctl start postgresql && systemctl enable postgresql

To check the status of the service:

systemctl status postgresql

You should get output similar to this:

root@test ~]# systemctl status postgresql
● postgresql.service - PostgreSQL database server
     Loaded: loaded (/usr/lib/systemd/system/postgresql.service; enabled; preset: disabled)
     Active: active (running) since Sat 2026-05-09 11:48:49 CEST; 3min 18s ago
 Invocation: 2ab05619482748fcb99352f174438bf2
   Main PID: 1059 (postgres)
      Tasks: 7 (limit: 10665)
     Memory: 30.3M (peak: 32.1M)
        CPU: 118ms
     CGroup: /system.slice/postgresql.service

Step 3. Create Mattermost Database and User

To create a Mattermost database and user, execute the following commands in the PostgreSQL terminal.

First, log in to the PostgreSQL console:

sudo -u postgres psql

Then execute the following commands one by one:

CREATE DATABASE mmdb;
CREATE USER mmuser WITH PASSWORD 'YourStrongPasswordHere';
GRANT ALL PRIVILEGES ON DATABASE mmdb TO mmuser;
\q

Step 4. Download and Install Mattermost

To download Mattermost, execute the following command:

cd /opt

wget https://releases.mattermost.com/11.2.1/mattermost-11.2.1-linux-amd64.tar.gz

tar -xvzf mattermost*.gz

rm mattermost-11.2.1-linux-amd64.tar.gz

Next, we need to create a system user and group for Mattermost:

useradd --system --user-group mattermost

Next, create the Mattermost data directory and assign the correct permissions:

mkdir /opt/mattermost/data

chown -R mattermost:mattermost /opt/mattermost

chmod -R g+w /opt/mattermost

The last step in this heading is to configure the database connection using the credentials we set in Step 4 by editing the configuration file to connect to PostgreSQL.

First, log in as the Mattermost user:

su - mattermost

nano /opt/mattermost/config/config.json

Locate the “DataSource” line and update it to look like this:

"DataSource": "postgres://mmuser:YourStrongPasswordHere@localhost/mmdb?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes"

Save the file, close it, and log out from the Mattermost user by typing exit.

bash-5.2$ exit
exit

Step 5. Create Systemd Service File

Now we need to create a systemd service file for Mattermost:

nano /etc/systemd/system/mattermost.service

Paste the following lines of code:

[Unit]
Description=Mattermost

[Service]
Type=notify
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
KillMode=mixed
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
User=mattermost
Group=mattermost
LimitNOFILE=49152

[Install]
WantedBy=multi-user.target

Save the file, close it, and reload the daemon:

systemctl daemon-reload

Start and enable the Mattermost service for automatic start on system boot:

systemctl start mattermost && systemctl enable mattermost

To check the status of the service, execute the following command:

systemctl status mattermost

You should get output similar to this:

root@host:# systemctl status mattermost
● mattermost.service - Mattermost
     Loaded: loaded (/etc/systemd/system/mattermost.service; disabled; preset: enabled)
     Active: active (running) since Sat 2026-05-09 17:31:55 CDT; 1min 4s ago
 Invocation: b8e83eb73d044a5387abb76d3e3803ea
   Main PID: 116271 (mattermost)
      Tasks: 28 (limit: 3770)
     Memory: 332.2M (peak: 494.5M)
        CPU: 29.388s
     CGroup: /system.slice/mattermost.service
             ├─116271 /opt/mattermost/bin/mattermost
             ├─116300 plugins/playbooks/server/dist/plugin-linux-amd64
             └─116308 plugins/com.mattermost.calls/server/dist/plugin-linux-amd64

Step 6. Install and Configure Nginx

Mattermost typically uses NGINX as a reverse proxy to securely expose the app over HTTPS and efficiently handle real-time web traffic before forwarding requests to Mattermost itself. To install Nginx, execute the following command:

dnf install nginx -y

Once installed, start and enable the Nginx service for automatic start on system boot:

systemctl start nginx && systemctl enable nginx

To check the status of the service, execute the following command:

systemctl status nginx

You should get output similar to this:

root@host:# systemctl status nginx
● nginx.service - A high performance web server and a reverse proxy server
     Loaded: loaded (/usr/lib/systemd/system/nginx.service; enabled; preset: enabled)
     Active: active (running) since Sat 2026-05-09 17:42:22 CDT; 38s ago
 Invocation: e5aa86dde1fc4a32bc3d996c55b9899b
       Docs: man:nginx(8)
    Process: 116768 ExecStartPre=/usr/sbin/nginx -t -q -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
    Process: 116769 ExecStart=/usr/sbin/nginx -g daemon on; master_process on; (code=exited, status=0/SUCCESS)
   Main PID: 116814 (nginx)
      Tasks: 4 (limit: 3770)
     Memory: 4M (peak: 8.8M)
        CPU: 107ms
     CGroup: /system.slice/nginx.service

Next, we need to create an Nginx server block for our Mattermost website.

nano /etc/nginx/conf.d/mattermost.conf

Paste the following lines of code:

upstream backend {
   server 127.0.0.1:8065;
   keepalive 32;
}

server {
  listen 80;
  server_name  yourdomain.com;

location ~ /api/v[0-9]+/(users/)?websocket$ {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 90;
       proxy_send_timeout 300;
       proxy_read_timeout 90s;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://backend;
   }
}

Save the file and close it. Then check the Nginx syntax:

nginx -t

If everything is OK, you should get the following output:

root@host:/opt# nginx -t
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

Now, you can restart the Nginx service.

systemctl restart nginx

That’s it. You successfully installed Mattermost and can access it at http://YourDomainName.

Install Mattermost on AlmaLinux 10

If you have any difficulties with this installation, our Linux admins can help with any aspect of it. You need to sign up for one of our monthly server management or per-incident server support plans. Do not hesitate to contact us anytime. We are available 24/7.

If you liked this post on how to install Mattermost on AlmaLinux 10, please share it with your friends or leave a comment below.

Leave a Reply

Your email address will not be published. Required fields are marked *