How To Install Mattermost on CentOS 8

Install Mattermost on CentOS 8

In this tutorial, we will show you how to install Mattermost on CentOS 8. For those of you who didn’t know, Mattermost is an open-source, private cloud Slack-alternative. A workplace messaging system for web, PCs, and phones, released under the MIT license. As an alternative to proprietary SaaS messaging, Mattermost brings all your team communication into one place, making it searchable and accessible anywhere. Mattermost is “Slack-compatible, not Slack-limited”, supporting a superset of Slack’s incoming and outgoing webhook integrations, including compatibility with existing Slack integrations. From your existing Slack teams, you can import users, public channel history, and even theme setting colors into Mattermost.

This article assumes you have at least basic knowledge of Linux, know how to use the shell, and most importantly, you host your site on your own VPS. The installation is quite simple and assumes you are running in the root account, if not you may need to add ‘sudo‘ to the commands to get root privileges. I will show you through the step by step installation Mattermost on a CentOS 8.

Install Mattermost on CentOS 8

Step 1. First, let’s start by ensuring your system is up-to-date.

Step 2. Installing Database Server.

Run the following command to install MariaDB:

By default, MariaDB is not hardened. You can secure MariaDB using the mysql_secure_installation script. you should read and below each step carefully which will set a root password, remove anonymous users, disallow remote root login, and remove the test database and access to secure MariaDB:

Then, restart the MariaDB database server and enable it to start on system start-up using:

After database installation, login to MariaDB shell and create database and user for Mattermost:

Step 3. Installing Mattermost on CentOS 8.

First, you will need to create a separate user to run Mattermost. You can create it with the following command:

Next, download the latest version of the Mattermost:

Unpack the Mattermost archive to the document root directory on your server:

Create the storage directory for files:

Also, set the ownership and permissions:

Next, we’ll have to set up the database driver in the file /opt/mattermost/config/config.json by making some changes to its contents. Search for “DriverName” and “DataSource” lines and change as follows:

Save and close the file. Then, change the directory to /opt/mattermost and start the Mattermost server with the following command:

Step 4. Configure Mattermost Systemd Service.

First, we’ll create a new systemd unit file using the following command:

Next, start the Mattermost service and enable it to start after system reboot with the following command:

Verify that Mattermost is running and listening on port 8065. You can check it with the following command:

Step 5. Configuring Nginx with Mattermost.

Install and configure Nginx as a reverse proxy for better performance and security. Now we install Nginx on CentOS system:

After installing the Nginx web server, start the Nginx service and enable it to start after system reboot with the following command:

Then, configure Nginx web server as a proxy for Mattermost:

Finally, restart the Nginx service to apply the changes:

Step 6. Configure Firewall.

Allow the firewall access on http and https ports:

Step 7. Accessing Mattermost Web Interface.

Mattermost will be available on HTTP port 80 by default. Open your favorite browser and navigate to http://mattermost.example.com and continue to configure Mattermost by entering an email address and creating an account.

Congratulations! You have successfully installed Mattermost. Thanks for using this tutorial for installing Mattermost on CentOS 8 system. For additional help or useful information, we recommend you to check the official Mattermost website.

VPS Manage Service Offer
If you don’t have time to do all of this stuff, or if this is not your area of expertise, we offer a service to do “VPS Manage Service Offer”, starting from $10 (Paypal payment). Please contact us to get the best deal!