docs/main/deployment-guide/server/linux/deploy-tar.mdx
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:
:::tip Use a packaged install if it fits If you're on Ubuntu / Debian, use the APT-based install for automatic security updates. If you're on RHEL / Rocky / Alma / Oracle, use the RHEL install — it covers SELinux, firewalld, and fapolicyd configuration too. :::
:::info Minimum requirements
systemd (or a comparable service manager).Choose one of:
Follow the database preparation instructions to create the Mattermost database, user, and grants.
SSH onto the target host and download the release. Replace amd64 with arm64 for ARM-based hardware.
wget https://releases.mattermost.com/11.8.3/mattermost-11.8.3-linux-amd64.tar.gz
wget https://releases.mattermost.com/11.7.6/mattermost-11.7.6-linux-amd64.tar.gz
Enterprise and Team Edition releases are listed in the version archive.
</TabItem> </Tabs>:::note Air-gapped installs In an air-gapped environment, stage the tarball on your operator workstation, verify the SHA-256 and PGP signature, then transfer it across the boundary. See Air-Gapped Operations → Quick-Start Runbook for the full procedure. :::
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
:::note Custom paths and users
If you use a path other than /opt/mattermost or a user/group name other than mattermost, use that name in every step that follows.
:::
Create the systemd unit file at /lib/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
:::note Local database
If PostgreSQL is on the same host, add to the [Unit] section so Mattermost won't start before the database is ready:
After=postgresql.service
BindsTo=postgresql.service
:::
Reload systemd:
sudo systemctl daemon-reload
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).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
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:
sudo systemctl stop mattermost).config/, data/, plugins/, and your PostgreSQL database.config/, data/, plugins/).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
:::important Back up before removing
/opt/mattermost contains config/, logs/, plugins/, client/plugins/, and data/. Back these up before running rm -rf if you may need to restore.
:::