How to Install Mattermost on Ubuntu 26.04

How to Install Mattermost on Ubuntu 26.04

Mattermost is both the name of the company and the software solution it offers. It provides a Slack-like chat tool specifically designed for team communication. It offers a free, open-source version and two enterprise editions with advanced features. As an alternative to proprietary SaaS messaging, Mattermost consolidates all team communication in one place, making it searchable and accessible from anywhere. It’s built with Golang and React and runs as a production-ready Linux binary under the MIT license, using MySQL or Postgres. In this article, we will show you how to install Mattermost on Ubuntu 26.04.

Prerequisites

  • An Ubuntu 26.04 VPS with at least 2GB of RAM
  • SSH access with sudo privileges, or root access.

Conventions

# – given commands should be executed with root privileges either directly as a root user or by use of sudo command
$ – given commands should be executed as a regular user

Step 1. Log in to your server via SSH

First of all, let us log in to our Ubuntu 26.04 VPS via SSH as the root user:

ssh root@IP_Address -p Port_number

You will need to replace ‘IP_Address’ and ‘Port_number’ with your server’s respective IP address and SSH port number. Additionally, replace ‘root’ with the username of the system user with sudo privileges.

Now, let’s check whether you have the proper Ubuntu version installed on your server with the following command:

$ lsb_release -a

The command should return an output like this:

No LSB modules are available.
Distributor ID: Ubuntu
Description:  Ubuntu 26.04 LTS
Release:  26.04
Codename: resolute

In this article, we run the commands as root and as the Mattermost user. Please pay attention to the symbol shown before the commands.

Step 2. Update the system

Before starting, we need to ensure that all Ubuntu 26.04 packages installed on the server are up to date. You can do this by running the following commands:

# apt update

The list of available packages in the system package index has now been refreshed. Let’s proceed to the next step.

Step 3. Create a System User

In this step, we will create a new system user called “mattermost”. Let’s execute the command below; you can substitute ‘mattermost’ with any username you like.

# useradd -G sudo,www-data -s /bin/bash -m -d /opt/mattermost mattermost

That’s it; we have just created a new user called mattermost

Step 4. Install PostgreSQL Server

Initially, Mattermost supported MySQL and PostgreSQL. But, starting with Mattermost v11, support for MySQL has been completely removed from the codebase. So, PostgreSQL is the only supported database driver now. Let’s install the PostgreSQL server.

# apt install postgresql postgresql-contrib

Once the installation is complete, PostgreSQL will automatically start and be up and running. It is also configured to automatically run upon a server reboot.

Step 5. Create a Database

We’re getting close to being able to install Mattermost on Ubuntu 26.04. Next, let’s create a PostgreSQL database. First, we need to log in as user ‘postgres’ then go to the PostgreSQL shell

# sudo -u postgres psql

Once logged in, let’s run the commands below to create a database and user, and grant the user access.

CREATE DATABASE mattermost;
CREATE USER mattermost WITH PASSWORD 'm0d1fyth15';
GRANT ALL ON DATABASE mattermost TO mattermost;
ALTER DATABASE mattermost OWNER TO mattermost;
GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mattermost;

Next, we can verify the new PostgreSQL user; simply execute the \du command:

postgres=# \du
                              List of roles
 Role name  |                         Attributes                         
------------+------------------------------------------------------------
 mattermost | 
 postgres   | Superuser, Create role, Create DB, Replication, Bypass RLS

Next, we can check the connection information.

# sudo -u postgres psql --host=localhost --dbname=mattermost --username=mattermost --password

The command above will prompt you for the Mattermost PostgreSQL user password. We created the user in the previous step.

After logging in to the PostgreSQL shell, you can run this command:

\conninfo

Once executed, the command will print this output:

psql (18.3 (Ubuntu 18.3-1))
SSL connection (protocol: TLSv1.3, cipher: TLS_AES_256_GCM_SHA384, compression: off, ALPN: postgresql)
Type "help" for help.

mattermost=> \conninfo
            Connection Information
      Parameter       |         Value          
----------------------+------------------------
 Database             | mattermost
 Client User          | mattermost
 Host                 | localhost
 Host Address         | 127.0.0.1
 Server Port          | 5432
 Options              | 
 Protocol Version     | 3.0
 Password Used        | true
 GSSAPI Authenticated | false
 Backend PID          | 27626
 SSL Connection       | true
 SSL Library          | OpenSSL
 SSL Protocol         | TLSv1.3
 SSL Key Bits         | 256
 SSL Cipher           | TLS_AES_256_GCM_SHA384
 SSL Compression      | false
 ALPN                 | postgresql
 Superuser            | off
 Hot Standby          | off
(19 rows)

mattermost=> 

That’s it, a new database has been created. Let’s exit from the postgres user.

\q
$ exit

Step 6. Download and Install Mattermost on Ubuntu 26.04

Let’s switch to the ‘mattermost’ user we created earlier, then download the installation files.

# su - mattermost

Get the download link from their download page, then download it.

$ wget https://releases.mattermost.com/11.6.1/mattermost-11.6.1-linux-amd64.tar.gz -O mattermost.tar.gz

The installation file has been downloaded and saved as mattermost.tar.gz. Let’s extract the file right under the ‘mattermost’ user home directory.

$ tar -xzvf mattermost.tar.gz --strip-component 1

Before running Mattermost, we need to configure it to connect to our database.

$ cp -a /opt/mattermost/config/config.json{,.orig}

The command above saves a copy of config.json as config.json.orig. Now, let’s edit the config.json file to connect to the PostgreSQL database.

$ nano /opt/mattermost/config/config.json

Configure the following properties in this file:

    "DataSource": "postgres://mmuser:mostest@localhost/mattermost_test?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes",

Replace the lines with these:

    "DataSource": "postgres://mattermost:m0d1fyth15@localhost/mattermost?sslmode=disable\u0026connect_timeout=10\u0026binary_parameters=yes",

Make sure to use the correct database user and password you created earlier.

Set your “SiteURL”: Your domain name for the Mattermost server (e.g., https://mattermost.yourdomain.com).

Save the file, then exit from nano editor. We can exit from user ‘mattermost’ now.

$ exit

Step 7. Create Systemd Service File

Before we install Mattermost on Ubuntu 26.04, we will manage the Mattermost service using systemd. Let’s create a systemd service file for Mattermost now.

# nano /etc/systemd/system/mattermost.service

Paste the following into the systemd service file, then save it.

[Unit]
Description=Mattermost
After=network.target

[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, exit, and then reload systemd to refresh and apply the changes we made.

# systemctl daemon-reload

Let’s run Mattermost now and configure it to start automatically on server reboot.

# systemctl enable --now mattermost

Your Mattermost service should be up and running now. To verify, run this command:

# systemctl status mattermost

Now, you will see an output similar to this

● mattermost.service - Mattermost
     Loaded: loaded (/etc/systemd/system/mattermost.service; enabled; preset: enabled)
     Active: active (running) since Sat 2026-05-09 07:05:10 UTC; 1s ago
 Invocation: 1832a281abf54cacbae2010ca3b528c0
   Main PID: 32851 (mattermost)
      Tasks: 37 (limit: 1605)
     Memory: 366.3M (peak: 583M)
        CPU: 13.028s
     CGroup: /system.slice/mattermost.service
             ├─32851 /opt/mattermost/bin/mattermost
             ├─33098 plugins/mattermost-ai/server/dist/plugin-linux-amd64
             ├─33108 plugins/playbooks/server/dist/plugin-linux-amd64
             └─33121 plugins/com.mattermost.calls/server/dist/plugin-linux-amd64

May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.264 Z","level":"info","msg":"got public IP address for local interface","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls","origin">
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.265 Z","level":"info","msg":"rtc: server is listening on udp 127.0.0.1:8443","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls","or>
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.266 Z","level":"info","msg":"rtc: server is listening on udp 192.168.93.138:8443","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls>
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.267 Z","level":"info","msg":"rtc: server is listening on udp 172.17.0.1:8443","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls","o>
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.269 Z","level":"info","msg":"rtc: server is listening on udp 172.18.0.1:8443","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls","o>
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.270 Z","level":"info","msg":"Listening TCP on 0.0.0.0:8443","caller":"app/plugin_api.go:1139","plugin_id":"com.mattermost.calls","origin":"main.(*log>
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.295 Z","level":"info","msg":"Starting Server...","caller":"app/server.go:872"}
May 09 07:05:10 ubuntu26 mattermost[32851]: {"timestamp":"2026-05-09 07:05:10.296 Z","level":"info","msg":"Server is listening on [::]:8065","caller":"app/server.go:948","address":"[::]:8065"}
May 09 07:05:10 ubuntu26 systemd[1]: Started mattermost.service - Mattermost.

You should be able to access Mattermost at http://YOUR_SERVER_IP_ADDRESS:8065

Install Mattermost on Ubuntu 26.04

Next up, you can click on the ‘View in Browser’ button to create a new account.

Start Mattermost installation on Ubuntu 26.04

Step 8. Install and Configure Nginx

Mattermost is accessible at http://YOUR_SERVER_IP_ADDRESS:8065. To access Mattermost via a domain or subdomain without the port number at the end of the URL, we need to install and configure a reverse proxy. Let’s install and configure nginx.

Need a fast and easy fix?
✔ Unlimited Managed Support
✔ Supports Your Software
✔ 2 CPU Cores
✔ 2 GB RAM
✔ 50 GB PCIe4 NVMe Disk
✔ 1854 GeekBench Score
✔ Unmetered Data Transfer
NVME 2 VPS

Now just $43 .99
/mo

GET YOUR VPS
# apt install nginx -y

Once installed, we can create an nginx server block for our Mattermost website.

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

Then, insert the following into the file.

upstream mm {
    server 127.0.0.1:8065;
}

server {
  listen 80;
  server_name   mattermost.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://mm;
   }

   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://mm;
   }
}

Save the file, then exit from the editor and restart nginx

# systemctl restart nginx

Bringing It All Together

That’s it, you should be able to access Mattermost at http://mattermost.yourdomain.com now. You can use this address to connect using your mobile application or web browser.

Congratulations! You followed this article and have successfully installed Mattermost on your Ubuntu 26.04 server.

Of course, you don’t have to spend your time following this article to install Mattermost on your Ubuntu 26.04 server if you have an active Mattermost server with us, in which case you can simply ask our expert Linux admins to install Mattermost for you. Simply log in to the client area, then submit a ticket. Our expert administrators are available 24×7 and will respond to your request immediately. They will also help you install an SSL certificate on your Mattermost service.

If you liked this post on how to install Mattermost on Ubuntu 26.04, please share it with your friends or leave a reply below.

Leave a Comment