Mattermost is a powerful open-source messaging platform designed as a self-hosted alternative to Slack and Microsoft Teams. It provides full data control, robust collaboration tools, and is ideal for organizations focused on privacy and scalability. This guide covers the full installation of Mattermost on an Ubuntu 20.04/22.04 server.
Before starting, make sure you have:
Mattermost requires PostgreSQL for data storage.
Create the database and user for Mattermost:
Inside the PostgreSQL shell:
Navigate to the /opt directory:
Download the latest version of Mattermost:
Replace X.X.X
with the latest version number, e.g., 9.5.2
.
Extract the archive:
Open the configuration file:
Locate the database settings and update the connection string:
Save and exit.
Create a dedicated system user:
Create a systemd unit file:
Insert the following content:
Enable and start the service:
Create a new site configuration file:
Example configuration:
<
Enable the site and restart NGINX:
(Optional) Use Certbot to add HTTPS via Let’s Encrypt:
Visit http://yourdomain.com in your browser. You’ll be prompted to create the first admin account and set up your team workspace.
You now have Mattermost installed and running on Ubuntu. With PostgreSQL handling data and NGINX managing web traffic, this setup is optimized for secure and scalable real-time collaboration. Make sure to regularly update the application and secure your system as you scale your teams and usage.