• Contact
  • Contact Us
  • Disclamer
  • Home 1
  • Home 2
  • Home 3
  • Privacy Policy
Friday, May 9, 2025
How VPS - How to use/setup VPS
  • Login
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon
No Result
View All Result
How VPS - How to use/setup VPS
No Result
View All Result
Home Operating System CentOS

How to Install Mattermost 4.1 on CentOS 7

How VPS by How VPS
October 1, 2019
in CentOS
0
0
SHARES
24
VIEWS
Share on FacebookShare on Twitter

Contents

  1. Using a Different System?
    1. Prerequisites
    2. Step 1: Install and configure MariaDB 10.2
      1. Use the following commands to install MariaDB 10.2.
      2. Secure MariaDB 10.2
      3. Create a MariaDB database for Mattermost.
    3. Step 2: Install and configure Mattermost
  2. Want to contribute?

Using a Different System?

  • How to Install Mattermost 5.2 on Ubuntu 16.04

Are we missing a guide for your target system? Request one, or submit your own!


Mattermost is an open source, self-hosted alternative to the Slack SAAS messaging service. In other words, with Mattermost, you can setup a private and dedicated messaging server on your own machine for your team.

Prerequisites

  • A newly created Vultr CentOS 7 x64 server instance. Say its IP address is 203.0.113.1.
  • A sudo user.
  • The server instance has been updated to the latest stable status using the EPEL YUM repo.
  • A domain mattermost.example.com that has been configured to point to the 203.0.113.1 server instance. You can learn more details about this in another Vultr tutorial.
  • In order to automatically obtain the Let’s Encrypt certificate, the server instance’s FQDN should have been configured as mattermost.example.com.

Step 1: Install and configure MariaDB 10.2

As required by Mattermost, you need to setup a database to store all the data for Mattermost. For that purpose, we will install MariaDB.

Use the following commands to install MariaDB 10.2.
curl -sS https://downloads.mariadb.com/MariaDB/mariadb_repo_setup | sudo bash
sudo yum install MariaDB-server MariaDB-client -y
sudo systemctl start mariadb.service
sudo systemctl enable mariadb.service
Secure MariaDB 10.2
sudo /usr/bin/mysql_secure_installation

When prompted, answer the questions.

  • Enter current password for root (enter for none): Just press the Enter button
  • Set root password? [Y/n]: Y
  • New password: your-MariaDB-root-password
  • Re-enter new password: your-MariaDB-root-password
  • Remove anonymous users? [Y/n]: Y
  • Disallow root login remotely? [Y/n]: Y
  • Remove test database and access to it? [Y/n]: Y
  • Reload privilege tables now? [Y/n]: Y
Create a MariaDB database for Mattermost.

Log into the MariaDB shell as root.

mysql -u root -p

In the MariaDB shell, input the following statements.

Note: For security purposes, be sure to replace mattermost, mattermostuser, and yourpassword with your own ones.

CREATE DATABASE mattermost;
CREATE USER 'mattermostuser'@'localhost' IDENTIFIED BY 'yourpassword';
GRANT ALL PRIVILEGES ON mattermost.* TO 'mattermostuser'@'localhost' IDENTIFIED BY 'yourpassword' WITH GRANT OPTION;
FLUSH PRIVILEGES;
EXIT;

Step 2: Install and configure Mattermost

Download and extract the Mattermost 4.1 archive.

cd
wget https://releases.mattermost.com/4.1.0/mattermost-4.1.0-linux-amd64.tar.gz
tar -zxvf mattermost-4.1.0-linux-amd64.tar.gz

Move all Mattermost files to the /opt directory, and then create a subdirectory /opt/mattermost/data to store program data.

sudo mv ~/mattermost /opt
sudo mkdir /opt/mattermost/data

Create a dedicated user mattermost and a dedicated group mattermost for running Mattermost.

sudo useradd --system --user-group mattermost

Modify all Mattermost program files’ ownership and permissions.

sudo chown -R mattermost:mattermost /opt/mattermost
sudo chmod -R g+w /opt/mattermost

In order to setup an HTTPS-enabled Mattermost server, you need to make modifications to the Mattermost config file.

sudo vi /opt/mattermost/config/config.json

Find these lines, one by one.

"SiteURL": "",
"ListenAddress": ":8065",
"ConnectionSecurity": "",
"UseLetsEncrypt": false,
"Forward80To443": false,
"DataSource": "mmuser:mostest@tcp(dockerhost:3306)/mattermost_test?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s",

Replace them with the lines below.

"SiteURL": "https://mattermost.example.com",
"ListenAddress": ":443",
"ConnectionSecurity": "TLS",
"UseLetsEncrypt": true,
"Forward80To443": true,
"DataSource": "mattermostuser:yourpassword@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&writeTimeout=30s",

Note: In the DataSource line, you need to sequentially specify the database username mattermostuser, the corresponding password yourpassword, the database server location localhost, and the database name mattermost.

Make sure that the DriverName line above the DataSource line is using the default value mysql.

"DriverName": "mysql",

Save and quit.

:wq!

Allow Mattermost to bind to privileged ports, i.e. 80 and 443.

cd /opt/mattermost/bin
sudo setcap cap_net_bind_service=+ep ./platform

Manage Mattermost with systemd.

Create a Mattermost systemd unit file.

cat <<EOF | sudo tee -a /etc/systemd/system/mattermost.service
[Unit]
Description=Mattermost
After=syslog.target network.target mysqld.service

[Service]
Type=simple
WorkingDirectory=/opt/mattermost/bin
User=mattermost
ExecStart=/opt/mattermost/bin/platform
PIDFile=/var/spool/mattermost/pid/master.pid
LimitNOFILE=49152

[Install]
WantedBy=multi-user.target
EOF

Modify permissions on this systemd unit file.

sudo chmod 664 /etc/systemd/system/mattermost.service

Start the Mattermost service and make it automatically start on system boot.

sudo systemctl daemon-reload
sudo systemctl start mattermost.service
sudo systemctl enable mattermost.service

Allow access on the http and https ports.

sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --zone=public --permanent --add-service=https
sudo firewall-cmd --reload

Finally, point your favorite web browser to http://mattermost.example.com or https://mattermost.example.com, and you will see the Mattermost Sign Up page.

On the Mattermost Sign Up page, input an email address, a username, and a password, and then click the Create Account button to register the first user.

Note: Be aware that the first user you register will also be the system administrator.

On the Team Name page and the Team URL page, input a team name and a URL for your first team.

You have now successfully setup a Mattermost messaging server which is robust enough to serve a small- or mid-sized team in production environment. Feel free to explore the interface of Mattermost and invite more team members.

Want to contribute?

You could earn up to $300 by adding new articles

Submit your article
Suggest an update
Request an article
Previous Post

How to Install Graylog Server on CentOS 7

Next Post

How To Install OpenCart On A Vultr LEMP Server

Next Post

How To Install OpenCart On A Vultr LEMP Server

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

No Result
View All Result

Recent Post

Install Imagemagick on CentOS
CentOS

Install Imagemagick on CentOS

by How VPS
June 28, 2023
0

This is how I installed Imagemagick on a vanilla CentOS server Start off by installing the prerequisites yum install php-pear...

Read more
how to Check phpinfo

How to Check phpinfo of Hosting or VPS?

June 28, 2023
Failed to download metadata for repo 'appstream' on Centos 8

How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

February 25, 2022
How to Fix MySQL Error "Plugin 'InnoDB' registration as a STORAGE ENGINE failed"?

How to Fix MySQL Error “Plugin ‘InnoDB’ registration as a STORAGE ENGINE failed”?

November 17, 2020
How to optimize Mysql or MariaDB

How to optimize Mysql or MariaDB

November 3, 2020

Recent News

  • Install Imagemagick on CentOS
  • How to Check phpinfo of Hosting or VPS?
  • How to fix error: Failed to download metadata for repo ‘appstream’ on Centos 8

Category

  • Arch
  • Authentication
  • Backups
  • BSD
  • Centmin Mod
  • CentOS
  • Control Panels
  • CoreOS
  • CWP
  • Debian
  • Directadmin
  • Encryption
  • Fedora
  • Firewalls
  • Hocvps Script
  • Hosting providers
  • Kloxo-MR
  • Linux
  • Mitigations
  • Operating System
  • Plesk
  • Reviews
  • Securing VPS/Servers
  • Security Patches
  • SSL Certificates
  • Uncategorized
  • Upgrading
  • VPS/Servers management guides
  • Vulnerability Detection
  • Web servers software
  • Webhosting Control Panel
  • About
  • Advertise
  • Careers
  • Contact

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

No Result
View All Result
  • Home
  • Management guides
    • Web servers software
      • Directadmin
      • Hocvps Script
      • Centmin Mod
      • CWP
      • Kloxo-MR
      • Plesk
    • Control Panels
    • Securing VPS/Servers
      • SSL Certificates
      • Upgrading
      • Authentication
  • Operating System
    • CentOS
    • Fedora
    • Debian
    • Linux
    • Arch
    • BSD
    • CoreOS
  • Reviews
  • Coupon
    • Domain Coupon
    • Hosting Coupon

© 2025 JNews - Premium WordPress news & magazine theme by Jegtheme.

Welcome Back!

Login to your account below

Forgotten Password?

Retrieve your password

Please enter your username or email address to reset your password.

Log In
Thabet