Skip to main content

Deploy Mattermost manually from the tarball

Install Mattermost Server on any 64-bit Linux distribution directly from the release tarball. This is the most flexible install method and usually the choice for:

  • Distributions Mattermost doesn't package directly (Arch, SUSE, Gentoo, Alpine, …)
  • Air-gapped environments where tarballs are staged on an internal mirror
  • Custom paths, users, or systemd unit configurations
  • Environments where you control every version pin and don't want a package manager auto-upgrade

Step 1: Get a PostgreSQL database

Choose one of:

  • Install PostgreSQL locally on the same host. See the PostgreSQL installation documentation.
  • Use an external PostgreSQL server and collect connection credentials before Step 2.
  • Use a managed database service (AWS RDS, Azure Database for PostgreSQL, etc.).

Step 2: Prepare the database

Follow the database preparation instructions to create the Mattermost database, user, and grants.

Step 3: Download the Mattermost Server tarball

SSH onto the target host and download the release. Replace amd64 with arm64 for ARM-based hardware.

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

Step 4: Install Mattermost Server

Extract the tarball, move it into place, and set ownership.

tar -xvzf mattermost*.gz
sudo mv mattermost /opt
sudo mkdir /opt/mattermost/data
sudo useradd --system --user-group mattermost
sudo chown -R mattermost:mattermost /opt/mattermost
sudo chmod -R g+w /opt/mattermost

Create the systemd unit file at /etc/systemd/system/mattermost.service:

[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

Reload systemd:

sudo systemctl daemon-reload

Step 5: Configure and start the server

Back up the default config before editing:

sudo cp /opt/mattermost/config/config.json /opt/mattermost/config/config.defaults.json

Edit /opt/mattermost/config/config.json and set:

  • SqlSettings.DriverName: "postgres"
  • SqlSettings.DataSource: "postgres://mmuser:<mmuser-password>@<host>:5432/mattermost?sslmode=disable&connect_timeout=10" — replace each placeholder.
  • ServiceSettings.SiteURL: the public URL of your deployment (e.g., https://mattermost.example.com).
  • (Recommended) SupportSettings.SupportEmail: the email address users contact for help.

Start the server:

sudo systemctl start mattermost
curl http://localhost:8065

You should see the Mattermost HTML response. Enable on boot:

sudo systemctl enable mattermost.service

Step 6: Update the server

Tarball installs are upgraded manually — there's no package manager to pull the new version. See Upgrading Mattermost Server for the step-by-step procedure. The summary:

  1. Stop the running server (sudo systemctl stop mattermost).
  2. Back up config/, data/, plugins/, and your PostgreSQL database.
  3. Download the new tarball.
  4. Extract over the install directory (preserving config/, data/, plugins/).
  5. Reset ownership and permissions.
  6. Start the server.

Remove Mattermost

Stop the server, back up data you need to keep, then remove the install:

sudo systemctl stop mattermost
sudo rm -rf /opt/mattermost
sudo rm /lib/systemd/system/mattermost.service
sudo userdel mattermost

Next steps