Mattermost Team Edition on Ubuntu 26.04 on Azure User Guide
Overview
Mattermost is an open source, self-hosted team chat and collaboration server: channels, threads, direct and group messages, file sharing, search, and an administrator's System Console, used from a browser, the desktop apps or the mobile apps. The cloudimg image delivers Mattermost Team Edition 12.1.1 fully installed and configured on Ubuntu 26.04 LTS: the Mattermost server behind nginx over HTTPS, backed by PostgreSQL 18, with the database, uploaded files and logs on their own 40 GiB data disk. The database is created and the System Admin account is made on the first boot of your VM, so you land directly on the sign-in page with nothing to configure. cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours.
Mattermost Team Edition is distributed under the Mattermost MIT Compiled License (/opt/mattermost/MIT-COMPILED-LICENSE.md on the image); its source is published by Mattermost, Inc. on GitHub. cloudimg is not affiliated with, endorsed by, or sponsored by Mattermost, Inc.; "Mattermost" is a trademark of Mattermost, Inc. This image repackages the upstream Team Edition release with cloudimg's provisioning and support. Team Edition carries no Enterprise licence and no Enterprise features.
What is included:
- Mattermost Team Edition 12.1.1 (the official Team Edition build, checksum-verified), installed in
/opt/mattermostand run as the unprivilegedmattermostuser bymattermost.service - nginx in front of it: HTTPS on :443 (HTTP/2, WebSockets proxied for real-time messaging), with :80 redirecting to HTTPS and answering a plain
/healthzliveness check - PostgreSQL 18 from the Ubuntu 26.04 archive, listening on loopback only, with its data directory on the data disk
- A 40 GiB data disk mounted at
/var/lib/mattermostholding the database, uploaded files, plugins and logs, so you can grow or snapshot it on its own - Per-VM System Admin password, database password and TLS certificate, all made on first boot. The sign-in details go to the root-only file
/root/mattermost-credentials.txt. No default or shared login ships in the image - Open self sign-up switched off: people join by your invitation or an account you create
- cloudimg's support team on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours

Prerequisites
An active Azure subscription, an SSH key pair, and a VNet plus subnet in the target region. Standard_B2ms (2 vCPU / 8 GiB RAM) is a good starting point for a team of a few hundred people; scale up for larger teams or heavy file sharing. NSG inbound: allow 22/tcp from your management network and 443/tcp (HTTPS) plus 80/tcp (which redirects to HTTPS) from your users.
Step 1 — Deploy from the Azure Marketplace
Sign in to the Azure Portal, choose Create a resource, search the Marketplace for Mattermost by cloudimg, and select Create. On Basics pick your subscription, resource group, region and size; under Administrator account choose SSH public key and paste your key; under Inbound port rules allow SSH (22), HTTP (80) and HTTPS (443). Keep the image's data disk on the Disks tab: it holds the database and files. Then Review + create and Create.
Step 2 — Deploy from the Azure CLI
# Accept the Marketplace terms once per subscription (required before the first CLI deploy)
az vm image terms accept --urn cloudimg1647283583153:mattermost-ubuntu-26-04:default:latest
az vm create \
--resource-group <your-rg> \
--name mattermost \
--image cloudimg1647283583153:mattermost-ubuntu-26-04:default:latest \
--size Standard_B2ms \
--admin-username azureuser \
--generate-ssh-keys \
--public-ip-sku Standard
Open HTTPS (and HTTP, which redirects) to reach the web app:
az vm open-port --resource-group <your-rg> --name mattermost --port 443 --priority 900
az vm open-port --resource-group <your-rg> --name mattermost --port 80 --priority 910
Step 3 — Connect to your VM
ssh azureuser@<vm-public-ip>
The address is on the VM's Overview page in the portal, or from the CLI with az vm show -d -g <your-rg> -n mattermost --query publicIps -o tsv.
Step 4 — Confirm the services are running
The three services behind Mattermost should all report active. Plain HTTP answers the /healthz liveness check and redirects everything else to HTTPS, and the Mattermost API answers through nginx over TLS. Mattermost (8065) and PostgreSQL (5432) listen on loopback only; only nginx faces the network:
systemctl is-active postgresql mattermost nginx
curl -s -o /dev/null -w 'healthz -> %{http_code}\n' http://127.0.0.1/healthz
curl -s -o /dev/null -w 'http redirect -> %{http_code} %{redirect_url}\n' http://127.0.0.1/login
curl -ks -o /dev/null -w 'https ping -> %{http_code}\n' https://127.0.0.1/api/v4/system/ping
sudo ss -tln | grep -E ':(80|443|8065|5432) ' | awk '{print $4}'
Expected output:
active
active
active
healthz -> 200
http redirect -> 301 https://127.0.0.1/login
https ping -> 200
127.0.0.1:5432
0.0.0.0:80
127.0.0.1:8065
0.0.0.0:443
[::]:80
[::]:443

Step 5 — Retrieve your System Admin password
On the first boot of every VM, mattermost-dbinit.service creates the database with a password unique to that VM, then mattermost-firstboot.service creates the System Admin account with its own random password, points Mattermost's Site URL at the VM's address, and writes the sign-in details to a root-only file. nginx makes the VM's own self-signed certificate before it first starts. No shared or default credentials ship in the image.
sudo cat /root/mattermost-credentials.txt
The file (mode 0600, root only) holds the sign-in URL, the System Console URL, the admin email (admin@cloudimg.local), the username (admin) and the password:
MATTERMOST_URL=https://<VM address>/
MATTERMOST_SYSTEM_CONSOLE=https://<VM address>/admin_console
MATTERMOST_ADMIN_EMAIL=admin@cloudimg.local
MATTERMOST_ADMIN_USERNAME=admin
MATTERMOST_ADMIN_PASSWORD=<MATTERMOST_ADMIN_PASSWORD>

You can prove the sign-in round trip from the VM's own shell. This reads the per-VM credentials and signs in through nginx with Mattermost's API (a good login answers 200), then shows a wrong password is refused (401):
EMAIL=$(sudo grep '^MATTERMOST_ADMIN_EMAIL=' /root/mattermost-credentials.txt | cut -d= -f2-)
PASS=$(sudo grep '^MATTERMOST_ADMIN_PASSWORD=' /root/mattermost-credentials.txt | cut -d= -f2-)
printf '{"login_id":"%s","password":"%s"}' "$EMAIL" "$PASS" | curl -ks -o /dev/null -w 'good login -> %{http_code}\n' -H 'Content-Type: application/json' --data-binary @- https://127.0.0.1/api/v4/users/login
printf '{"login_id":"%s","password":"wrong-99"}' "$EMAIL" | curl -ks -o /dev/null -w 'wrong pass -> %{http_code}\n' -H 'Content-Type: application/json' --data-binary @- https://127.0.0.1/api/v4/users/login
unset PASS
Expected output:
good login -> 200
wrong pass -> 401
Step 6 — Sign in
Browse to https://<vm-public-ip>/. Because the image ships a per-VM self-signed certificate, your browser shows a one-time certificate warning on the first visit: continue past it, or install your own domain's certificate (see Your own domain and certificate below). On the first visit Mattermost asks Where would you like to view this?: choose View in Browser (tick Remember my preference to skip it next time), or View in Desktop App if you use the Mattermost desktop app.
Sign in with the email admin@cloudimg.local (or the username admin) and the password from the credentials file. Change the admin email and password to your own from your avatar's Profile after signing in.
Step 7 — Create your team, channels and invite people
On first sign-in, with no team yet, Mattermost walks you through creating one: name it (for example Engineering), and it becomes the home for your channels. Every team starts with Town Square and Off-Topic; add your own from + → Create new channel, public or private. Messages thread, take files and reactions, and are searchable across the team.

Direct and group messages sit under Direct Messages in the sidebar, private between the people in them.

The image ships with open sign-up switched off, so nobody can create an account on your server unless you let them. Bring people in from Invite Members in the sidebar: copy the team's invite link and send it to them (invitation emails need SMTP, below), or create accounts yourself in System Console → User Management → Users. The System Console is also where you manage teams, channels, permissions, authentication and every server setting.

From the shell, Mattermost's mmctl tool works in local mode as root, with no token needed:
sudo /opt/mattermost/bin/mmctl --local user list
sudo /opt/mattermost/bin/mmctl --local system version
Expected: the admin account plus Mattermost's built-in system-bot and calls bot accounts, then Server version 12.1.1.... To create an account from the shell:
sudo /opt/mattermost/bin/mmctl --local user create --email <their-email> --username <their-username> --password '<a-strong-password>'
sudo /opt/mattermost/bin/mmctl --local team users add <your-team-name> <their-username>
Step 8 — Confirm the version and the stack
sudo -u mattermost /opt/mattermost/bin/mattermost version 2>/dev/null | grep -E '^(Version|Build Enterprise Ready):'
grep EDITION /opt/mattermost/manifest.txt
psql --version
nginx -v
df -h /var/lib/mattermost
sudo -u postgres psql -tAc 'SHOW data_directory'
Expected output:
Version: 12.1.1
Build Enterprise Ready: false
EDITION=team
psql (PostgreSQL) 18.6 (Ubuntu 18.6-0ubuntu0.26.04.1)
nginx version: nginx/1.28.3 (Ubuntu)
Filesystem Size Used Avail Use% Mounted on
/dev/sdc 40G 308M 37G 1% /var/lib/mattermost
/var/lib/mattermost/pgdata
The device name of the data disk can differ between VMs; it is always mounted at /var/lib/mattermost.

Server components
| Component | Version | Runs as | Listens on |
|---|---|---|---|
| Mattermost Team Edition | 12.1.1 | mattermost (mattermost.service) |
127.0.0.1:8065 |
| nginx | 1.28 (Ubuntu archive) | nginx.service |
:80 (health check and redirect), :443 (HTTPS) |
| PostgreSQL | 18 (Ubuntu archive) | postgresql.service |
127.0.0.1:5432 |
| Ubuntu | 26.04 LTS |
Filesystem layout
| Path | What it holds |
|---|---|
/ |
The OS disk (about 28 GB usable): Ubuntu, nginx and the Mattermost program files |
/opt/mattermost |
Mattermost Team Edition: bin/ (mattermost, mmctl), config/config.json, the web client and the licence |
/var/lib/mattermost |
The 40 GiB data disk |
/var/lib/mattermost/pgdata |
The PostgreSQL 18 data directory |
/var/lib/mattermost/data |
Uploaded files and attachments |
/var/lib/mattermost/plugins, client/plugins |
Installed plugins |
/var/lib/mattermost/logs |
Mattermost's own logs (mattermost.log) |
/etc/nginx/sites-available/cloudimg-mattermost |
The nginx site |
/etc/nginx/ssl/mattermost.crt, mattermost.key |
The TLS certificate and key (the key is root-only) |
/root/mattermost-credentials.txt |
The per-VM System Admin sign-in (root-only) |
/mnt |
The Azure temporary disk: lost on deallocation, never for data |
First-boot service and security model
The image ships with no database, no accounts and no keys: they are all made on your VM, in this order. mattermost-dbinit.service creates the mattermost database with a per-VM password. Mattermost starts and generates its own keys and salts for this VM the first time it needs them. nginx makes a self-signed certificate for the VM's address before it first starts, and answers 503 on HTTPS until the System Admin exists, so nobody can race you to the first account. Then mattermost-firstboot.service creates the System Admin, sets the Site URL, writes the credentials file and leaves a sentinel so it runs exactly once. Open self sign-up stays off.
systemctl status mattermost-firstboot.service --no-pager | head -3
sudo /opt/mattermost/bin/mmctl --local config get TeamSettings.EnableOpenServer
curl -ks -o /dev/null -w 'self sign-up -> %{http_code}\n' -H 'Content-Type: application/json' -d '{"email":"x@example.com","username":"selfsignup","password":"Xx-123456789!"}' https://127.0.0.1/api/v4/users
echo | openssl s_client -connect 127.0.0.1:443 2>/dev/null | openssl x509 -noout -subject -ext subjectAltName
sudo stat -c '%a %U:%G %n' /root/mattermost-credentials.txt /opt/mattermost/config/config.json /etc/nginx/ssl/mattermost.key
Expected output: the service active (exited), open sign-up false, an anonymous sign-up refused with 403, a certificate made for this VM's address, and the secrets readable only by their owners:
● mattermost-firstboot.service - Mattermost first-boot initialisation (per-VM System Admin and SiteURL)
Loaded: loaded (/etc/systemd/system/mattermost-firstboot.service; enabled; preset: enabled)
Active: active (exited) since ...
false
self sign-up -> 403
subject=CN=<VM address>
X509v3 Subject Alternative Name:
IP Address:<VM address>, IP Address:127.0.0.1
600 root:root /root/mattermost-credentials.txt
600 mattermost:mattermost /opt/mattermost/config/config.json
600 root:root /etc/nginx/ssl/mattermost.key

Managing the services
sudo systemctl status mattermost --no-pager | head -5
Restart Mattermost with sudo systemctl restart mattermost, and nginx with sudo systemctl reload nginx. Mattermost's log is /var/lib/mattermost/logs/mattermost.log, also readable from System Console → Reporting → Server Logs; the service's own output is in journalctl -u mattermost.
Change server settings in the System Console, or from the shell with mmctl --local config set, never by editing config.json by hand while the server runs.
Mattermost shows Preview Mode: Email notifications have not been configured until it can send mail. Add your SMTP server in System Console → Environment → SMTP (server, port, connection security, username and password), press Test Connection, then turn on Site Configuration → Notifications → Enable Email Notifications. Email is needed for invitation emails, password resets and notification emails; the invite link works without it.
Your own domain and certificate
Point a DNS record (for example chat.example.com) at the VM's public address, then move Mattermost's Site URL, the self-signed certificate and the credentials file to the name in one step:
sudo cloudimg-set-public-address chat.example.com
Run it with no argument to go back to the VM's public IP, and again whenever the VM's address changes. For a browser-trusted certificate, install one from your CA over the self-signed pair. With Let's Encrypt, once DNS points at the VM and port 80 is open to the internet, certbot's standalone mode briefly stops nginx to answer the challenge on port 80, copies the certificate into place, and saves the same steps for its automatic renewals:
sudo apt-get update && sudo apt-get install -y certbot
sudo certbot certonly --standalone -d chat.example.com \
--pre-hook 'systemctl stop nginx' --post-hook 'systemctl start nginx' \
--deploy-hook 'install -m 0644 "$RENEWED_LINEAGE/fullchain.pem" /etc/nginx/ssl/mattermost.crt && install -m 0600 "$RENEWED_LINEAGE/privkey.pem" /etc/nginx/ssl/mattermost.key'
A certificate you install yourself is never replaced by the image's tools. To make a fresh self-signed one for another name instead, run sudo mattermost-tls-cert --force <name> and sudo systemctl reload nginx.
Backup and maintenance
Everything that changes lives on the data disk at /var/lib/mattermost: the database, uploaded files, plugins and logs. Snapshot that disk (and the OS disk, for config.json) from the Azure portal for a point-in-time copy, or take a logical database backup plus the files:
sudo -u postgres pg_dump -Fc mattermost | sudo tee /var/backups/mattermost-$(date +%F).dump > /dev/null
sudo tar -C /var/lib/mattermost -czf /var/backups/mattermost-files-$(date +%F).tar.gz data
Keep the OS current with sudo apt-get update && sudo apt-get upgrade; the image ships with unattended security updates enabled. Read Mattermost's upgrade notes and back up before moving to a new Mattermost version.
Troubleshooting
- The browser shows a certificate warning. Expected with the self-signed certificate: continue past it, or install your own (above).
- HTTPS shows "Mattermost is finishing its first boot". First boot has not finished making the System Admin. Give it a minute after the VM starts, then check
systemctl status mattermost-firstboot. - The credentials file says first boot has not run yet. Wait for first boot, then read it again;
journalctl -u mattermost-firstbootshows each step. - Links in Mattermost or in emails point at an old address. The VM's address changed: run
sudo cloudimg-set-public-address(above). - Mattermost does not start.
journalctl -u mattermost -n 50and/var/lib/mattermost/logs/mattermost.logname the reason;df -h /var/lib/mattermostshows whether the data disk is full or missing.
Security recommendations
- Restrict
22/tcpin the NSG to your management network, and expose only443/tcp(and80/tcpfor the redirect) to users. - Change the admin email to your own and keep the System Admin password somewhere safe; then delete
/root/mattermost-credentials.txtif you no longer need it. - Install a browser-trusted certificate on your own domain before people start using the server.
- Leave open sign-up off unless you mean anyone who can reach the server to create an account; use invite links and, in the System Console, Restrict account creation to specified email domains if you open it.
- Turn on multi-factor authentication in System Console → Authentication → MFA.
Support
cloudimg's support team is on hand 24 hours a day by email (support@cloudimg.co.uk), with a guaranteed response within 24 hours, for deployment, upgrades, SMTP and notification setup, your own domain and certificates, plugins, integrations and webhooks, performance tuning and PostgreSQL administration. Email support@cloudimg.co.uk.