How VPS - How to use/setup VPS
  • 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
22
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:[email protected](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:[email protected](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
How VPS

How VPS

Related Posts

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

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

February 25, 2022
How to Install BoltWire CMS on CentOS 7
CentOS

How to Install BoltWire CMS on CentOS 7

February 14, 2020
Showterm.io – A Terminal/Shell Recording, Upload and Share Tool for Linux
CentOS

Setup HTTP Authentication With Nginx on CentOS 7

February 14, 2020
Next Post

How To Install OpenCart On A Vultr LEMP Server

Creating a Jekyll Blog on CentOS 7

How to Hide Version Numbers of Nginx and PHP on a LEMP Server

Leave a Reply Cancel reply

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

Follow Us

  • 121 Followers
  • 87.2k Followers

Recommended

How to Install an Ark Server On an Ubuntu 18.04 VPS or Dedicated Server

How to Install an Ark Server On an Ubuntu 18.04 VPS or Dedicated Server

4 years ago

Crystone Review

4 years ago

How to Install BlogoText CMS on a CentOS 7 LAMP VPS

3 years ago

Cheat – An Ultimate Command Line ‘Cheat-Sheet’ for Linux Beginners and Administrators

4 years ago

Instagram

    Please install/update and activate JNews Instagram plugin.

Categories

  • 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

Topics

Apache Web Server Bluehost Review 2019 Bluehost Review 2020 Bluehost Review 2021 Centmin Mod CentminMod centos install htop fsck htop install HTTP DoS attack Install Snort on an Ubuntu install Zabbix on CentOS install Zabbix on CentOS 7 Linux Commands linux guide linux install htop linux vps setup guide MariaDB MariaDB Error Mysql mysqld error optimize MariaDB optimize Mysql snort Ubuntu
No Result
View All Result

Highlights

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Webmin Reviews

Virtualmin Reviews

CentOS Web Panel Reviews

Ajenti Reviews

ISPConfig Reviews

Trending

Failed to download metadata for repo 'appstream' on Centos 8
CentOS

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

by How VPS
February 25, 2022
0

I tried to update some extensions by use yum on centOs which I specified in Dockerfile. After...

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
Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

Top Free Web Hosting Control Panels To Manage VPS/Dedicated Servers

February 17, 2020
Webmin Reviews

Webmin Reviews

February 17, 2020
How VPS – How to use/setup VPS

We bring you the best Premium WordPress Themes that perfect for news, magazine, personal blog, etc. Visit our landing page to see all features & demos.
LEARN MORE »

Recent News

  • 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”? November 17, 2020
  • How to optimize Mysql or MariaDB November 3, 2020

Categories

  • 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

[mc4wp_form]

© 2018 JNews - City News Magazine WordPress theme. All rights belong to their respective owners.
JNews is a top selling 2018 WordPress News, Blog, Newspaper & Magazine Theme.

No Result
View All Result
  • Home

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