You can install the product-level mattermost system on one to three machines; there are three key components: proxy, database, mattermost; You can install them on one machine or one on each, if there are only two machines, Then the proxy and mattermost can be installed on one machine, the database is installed on another machine;
Database selection, here you can use MySQL or PostgreSQL (I am accustomed to using MySQL, followed mainly based on MySQL). An agent can use Nginx
Install Ubuntu system
On each component of the machine, first install the Ubunut 16.04LTS system, make sure to update to the latest security patches, execute the following command:
mysql> sudo apt-get update
mysql> sudo apt-get upgrade
After the system is updated, proceed to the installation of each component by doing the following
Installing the MySQL Database
. installing MySQL with Apt-get install
mysql> sudo apt-get install Mysql-server
. log in as root user MySQL
Mysql> Mysql-u Root-p
. Create mattermost user ' Mmuser '
mysql> create user ' mmuser ' @ '% ' identified by ' Mmuser-password ';
Where% means that all the machines on the net can be connected, using a specific IP address more secure point
mysql> create user ' mmuser ' @ ' 10.10.10.2 ' identified by ' Mmuser-password ';
. Create a Mattermost database
Mysql> CREATE DATABASE Mattermost
. Allow access to Mmuser users
Mysql> Grant all privileges the mattermost.* to ' Mmuser ';
. Quit MySQL
Mysql> exit
Installing Mattermost
. Download the latest version of the source code
wget https://releases.mattermost.com/X.X.X/mattermost-X.X.X-linux-amd64.tar.gz
. Unzip the file
TAR-XZVF mattermost*.gz
. Move to the/OPT directory
sudo mv mattermost/opt
. Create a storage directory
sudo mkdir/opt/mattermost/data
. Set up system groups and users to run these service components, and then set the owner and permissions of the working directory
sudo useradd--system--user-group mattermost
sudo chown-r mattermost:mattermost/opt/mattermost
sudo chmod-r g+w/opt/mattermost
. Set the database driver, modify the configuration in the/opt/mattermost/config/config.json file, take MySQL for example
A. Set "drivername" to "MySQL"
B. Set "DataSource" as shown below, where Mmuser-password is the password to log in to MySQL, Host-name-or-ip is the MySQL server address, Mattermost is the database name
"Mmuser:<mmuser-password> @tcp (
Test whether the mattermost can be run.
Cd/opt/mattermost/bin
Sudo-u Mattermost./platform
. set Mattermost to start and stop using SYSTEMD
A. Sudo touch/lib/systemd/system/mattermost.service
B. Enter the following in the file created above:
[Unit] Description=mattermostafter=network.targetafter=mysql.servicerequires=postgresql.service[service]type= Simpleexecstart=/opt/mattermost/bin/platformrestart=alwaysrestartsec=10workingdirectory=/opt/mattermostuser= Mattermostgroup=mattermostlimitnofile=49152[install]wantedby=multi-user.target
C. sudo systemctl start mattermost.service
D. Verify that the mattermost is operating correctly
Curl http://localhost:8065
E. Setup mattermost with machine start-up
sudo systemctl enable Mattermost.service
Install Mattermost in Ubuntu 16.04 LTS