Install Mattermost on CentOS 7


Install Mattermost (premise below)

Rough flow

Follow the steps in the official documentation below

Installing PostgreSQL Server

# cd
# curl -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  6672  100  6672    0     0   5086      0  0:00:01  0:00:01 --:--:--  5089
# yum localinstall pgdg-redhat-repo-latest.noarch.rpm
Has completed!
# yum install postgresql95-server postgresq95-contrib
Has completed!

Set environment variables to specify initdb parameters

# export PGSETUP_INITDB_OPTIONS="--locale=ja_JP.UTF8"
# /usr/pgsql-9.5/bin/postgresql95-setup initdb
# systemctl enable postgresql-9.5
Created symlink from /etc/systemd/system/ to /usr/lib/systemd/system/postgresql-9.5.service.
# systemctl start postgresql-9.5
# su - postgres

Create a database (locale is Japan)

$ psql
psql (9.5.24)
"help"Get help with.

postgres=# CREATE DATABASE mattermost WITH ENCODING 'UTF8' LC_COLLATE='ja_JP.UTF-8' LC_CTYPE='ja_JP.UTF-8' TEMPLATE=template0;

'mmuser-password' sets its own password

postgres=# CREATE USER mmuser WITH PASSWORD 'mmuser-password';
postgres=# \q
$ exit

Install Mattermost Server

Check the URL of the latest installation file below This time it will be as follows Use the curl command if the wget command is not available

# cd
# curl -O
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  201M  100  201M    0     0  7655k      0  0:00:26  0:00:26 --:--:-- 8125k
# tar -xvzf mattermost-5.31.0-linux-amd64.tar.gz

Upload files and images are saved in the data directory, so change the location if necessary.

# mv mattermost /opt
# mkdir /opt/mattermost/data
# useradd --system --user-group mattermost
# chown -R mattermost:mattermost /opt/mattermost
# chmod -R g+w /opt/mattermost
# vi /opt/mattermost/config/config.json


    "SiteURL": "",
    "DriverName": "postgres",
    "DataSource": "postgres://mmuser:mmuser-pasword@localhost/mattermost?sslmode=disable\u0026connect_timeout=10",
# cd /opt/mattermost
# sudo -u mattermost ./bin/mattermost
{"level":"info","ts":1611110265.8058856,"caller":"app/server.go:225","msg":"Server is initializing..."}
{"level":"info","ts":1611110271.9833667,"caller":"app/server.go:983","msg":"Server is listening on [::]:8065","address":"[::]:8065"}

Make sure you can connect to Stop the server with Ctrl + C

^C{"level":"info","ts":1611110455.7103934,"caller":"app/server.go:721","msg":"Stopping Server..."}
{"level":"info","ts":1611110455.7169805,"caller":"app/server.go:799","msg":"Server stopped"}
# vi /etc/systemd/system/mattermost.service


Description=Mattermost postgresql-9.5.service


# chmod 664 /etc/systemd/system/mattermost.service
# systemctl daemon-reload
# systemctl enable mattermost
# systemctl start mattermost

Make sure you can connect to

Mattermost settings

Japanese localization of menu

First, create a team and display the team Follow the steps below to change the display language Account Settings > Display > Language > Japanese > Save

Email notification settings

System Console> Site Settings> Notifications

Other settings

Make other settings

Reboot for the changes to take effect

# systemctl restart mattermost

Enable SSL

Enable SSL by installing a reverse proxy Also allow access on HTTPS default port 443 Here we assume that Nginx is already installed Also, it is assumed that include /etc/nginx/conf.d/*.conf is described in /etc/nginx/nginx.conf.

Create a configuration file

# vi /etc/nginx/conf.d/


upstream backend {
   server localhost:8065;
   keepalive 32;
server {
  listen 80 default_server;
  return 301 https://$server_name$request_uri;

server {
   listen 443 ssl http2;

   http2_push_preload on; # Enable HTTP/2 Server Push

   #ssl on;
   ssl_certificate /etc/letsencrypt/live/;
   ssl_certificate_key /etc/letsencrypt/live/;
   ssl_session_timeout 1d;

Enable the config file

# cd /etc/nginx/conf.d
# ln -s /etc/nginx/conf.d/
# systemctl restart nginx

Recommended Posts

Install Mattermost on CentOS 7
Install Golang on CentOS 8
Install Neo4j 4.1.3 on centOS
Install Vertica 10.0 on CentOS 6.10
Install PostgreSQL 12 on Centos8
Install nginx on centOS7
Install Python 3 on CentOS 7
Install kuromoji on CentOS7
Install PostGIS 2.5.5 on CentOS7
Install jpndistrict on CentOS 7
Install Redmine 4.1.1 on CentOS 7
Smokeping Install on CentOS7
Install PostgreSQL 13 on CentOS 7.5
Install OpenFOAM v2006 on CentOS
Install Jenkins on Docker's CentOS
Install Apache on CentOS on VirtualBox
Install Ruby 2.7 on CentOS 7 (SCL)
Try DPDK20 SDK on CentOS7 ①Install
Install Ruby 2.5 on CentOS 7 using SCL
How to install MariaDB 10.4 on CentOS 8
Install apache 2.4.46 from source on CentOS7
Steps to install MySQL 8 on CentOS 8
Steps to install devtoolset-6 on CentOS 7
Install Java 9 on windows 10 and CentOS 7
Install MariaDB (CentOS 8)
[CentOS] Install apache-loggen
OpenVPN on CentOS 8
Install samba4 from source code on CentOS8
How to install beta php8.0 on CentOS8
Install CentOS 7 on Raspberry pi 4 Model B
Install NextCloud on CentOS 7 with Alibaba Cloud ECS
Install gradle on mac
Command to install nginx / PHP7 / php-fpm on CentOS7
Install Corretto 8 on Windows
Maven on CentOS 7 tutorial
Install OpenJDK on macOS
Install Java on Mac
Install pyqt5 on ubuntu
Tomcat v8 on CentOS7
[CentOS7] Install aws cli
Install Docker on Manjaro
Zabbix 5 installation on CentOS 8
Install Ruby on Ubuntu 20.04
Install lombok on SpringToolSuite4
Install GitLab on CentOS 8 with no internet connection
Use bat on Centos.
Jetty v8 on CentOS7
Install Autoware on Ubuntu 18.04.5
OpenJDK installation on CentOS 7
Install openjdk11 on mac
Install Homebrew on Ubuntu 20.04
Install CMS Made Simple v2.2.2 on LAMP on CentOS 7.3
Install OpenJDK 8 on mac
Install BookStack Documentation Wiki on Elastic Compute Service on CentOS 7
Install the latest hardware drivers from ELRepo on CentOS
Install MySQL 5.6 on CentOS6 [How to specify the version]
Install ag (the silver searcher) [on CentOS / Ubuntu / Mac]
Try RabbitMQ + PHP on CentOS
Install Docker on Raspberry Pi
Install Docker on Windows 10 PRO
Network install CentOS 8 with Kickstart.