How to Install Mattermost on Ubuntu 18.04

Install Mattermost on Ubuntu 18.04

In this article, we will have explained the necessary steps to install and configure Mattermost on Ubuntu 18.04 LTS. Before continuing with this tutorial, make sure you are logged in as a user with sudo privileges. All the commands in this tutorial should be run as a non-root user.

Mattermost is an open-source platform that is written in React and Golang. It can be used as an alternative messaging platform and utilizes the PostgreSQL or MySQL database in the backend. Mattermost main function is to bring team communication together and offer several features such as file sharing, custom emojis, video calls, messaging (one-on-one or group), and so on.

Install Mattermost on Ubuntu 18.04

Step 1. First, before you start installing any package on your Ubuntu server, we always recommend making sure that all system packages are updated.

Step 2. Install MySQL Database.

Installing the MySQL package with the following command:

MySQL server package comes with a script called mysql_secure_installation that can perform several security-related operations. Run the script by typing:

Next, create a new database and user for our Mattermost installation with:

Now, create a new system user and group for the sake of Mattermost instance. In this case, we will name our user mattermost:

Step 3. Install Mattermost on Ubuntu.

First, download the latest stable Mattermost version:

Make sure you change the ownership of the directory to the mattermost user:

Then, open the /opt/mattermost/config/config.json file, set the database driver to mysql and enter the database information:

Now, we need to test whether the Mattermost server is working properly. To do so, change into the /opt/mattermost directory then run the command below to start the server:

Step 4. Creating Systemd Unit.

We will create a mattermost.service unit file in the /etc/systemd/system/ directory:

Then restart the Mattermost service using the commands below:

Step 5. Setup a reverse proxy using Nginx.

If you have not installed nginx, follow the following this tutorial. Now we need to set up a new server block for the Mattermost instance:

Step 6. Accessing Mattermost.

To configure Mattermost service, go to your browser and enter the domain name where you will be directed to the signup page.

That’s all you need to do to install Mattermost on Ubuntu 18.04. I hope you find this quick tip helpful. If you have questions or suggestions, feel free to leave a comment below.