Mattermost
Mattermost is an online chat service that is open source and self hostable and has features like
file sharing, search and support many integrations. Mattermost creates a trusted secure space
for the team to work together openly. Discussions can be organized into channels. Channels can
be created for each team project and topic and that way its easier to manage different projects
and the teams associated with it effectively. Each channel in mattermost keeps a persistent
chat history and its accessible across devices. The search feature allows to easily search the
conversations and get the information you need. Mattermost allows teams to collaborate in
realtime with rich formatted text,images,videos and files. Mattermost channels can either be
public or private. Anyone can join a public channel see the conversations and also contribute to
the conversation. Private channels can be only accessed by authorized individuals. Users can
also send private messages to one another. Mattermost can work across all your devices.
Mattermost is an enterprise ready platform that can be deployed in the private cloud or on-
premises.
Installation steps for Mattermost
1.Install the MariaDB database server
apt install mariadb-server
2.Initialize the database server:
mysql_secure_installation
3.Login to MySQL and create a user for mattermost.
create user 'mattermost'@'localhost' identified by 'a-secure-password';
4.Create a database for Mattermost
create database mattermost;
5.Grant access privileges to the user mattermost and exit .
grant all privileges on mattermost.* to 'mattermost'@'localhost';
6.Download the latest version of the Mattermost server to your instance.
wget https://releases.mattermost.com/5.22.0/mattermost-5.22.0-linux-
amd64.tar.gz
7.Extract the files and move it to /opt
tar -xvzf mattermost*.gz
mv mattermost /opt
8.Create the storage directory for Mattermost:
mkdir /opt/mattermost/data
9.Set up a system user and group to be in charge of running the service and set the ownership
and permissions.
useradd --system --user-group mattermost
chown -R mattermost:mattermost /opt/mattermost
chmod -R g+w /opt/mattermost
10.Open the file /opt/mattermost/config/config.json with your favourite text editor and edit
the database settings.
Set the "DriverName" to mysql
•
•
Configure "DataSource". Replace with the password you have set for your database.
"mattermost:<a-secret-
password>@tcp(localhost:3306)/mattermost?charset=utf8mb4,utf8&readTimeout=30s&
writeTimeout=30s"
11.Start the Mattermost server manually to check everything is working:
cd /opt/mattermost/
sudo -u mattermost ./bin/mattermost
During startup the database structure of Mattermost will be configured and you will see some
log messages as well as a notice.Stop the process by pushing Control+C on your keyboard.
12. Create the file /lib/systemd/system/mattermost.service and add the below content.
[Unit]
Description=Mattermost
After=network.target
After=mysql.service
Requires=mysql.service
[Service]
Type=notify
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
User=mattermost
Group=mattermost
LimitNOFILE=49152
[Install]
WantedBy=mysql.service
13.Reload the systemd configuration:
systemctl daemon-reload
14.Start and enable the service:
systemctl start mattermost.service
systemctl enable mattermost.service
15.Access mattermost at http://your_servers_ip:8065
Enabling Audio/video conference in Mattermost using standalone jitsi server.
Mattermost doest have a default call feature integrated into it. To use matter most for
conferencing, We need to set up an opensource conferencing software called jitsi in another
server and integrate it to matter most using a plugin.
Jistsi meet is an opensource video conferencing platform. It is based on WebRTC. We will install
jistsi meet in another ubuntu server.
Installation steps for Jitsi Meet
1.Setup up the system Hostname.
Set the system’s hostname to the domain that you are going to use for the jitsi
instance.This domain jistsi.your-domain should be pointed to the servers IP.
sudo hostnamectl set-hostname jitsi.your-domain
Set local mapping of the server’s hostname to the loopback IP address 127.0.0.1. Open
/etc/hosts and add the line 127.0.0.1 jitsi.your-domain and save and exit the file.
•
•
Make sure the ufw firewall is disabled . check the status using the command
sudo ufw status
There are some ports that need to be opened in the network security group of the
instances. Open the ports 80/tcp,443/tcp,4443/tcp and 10000/udp in the instances's
security group.
2.Installing Jitsi Meet
Download the jitsi GPG key with the wget downloading utility.
wget https://download.jitsi.org/jitsi-key.gpg.key
Add the GPG key you downloaded to apt’s keyring using the apt-key utility.
sudo apt-key add jitsi-key.gpg.key
Add the Jitsi repository to the server.
sudo nano /etc/apt/sources.list.d/jitsi-stable.list
Add the below line to the file. Save and exit the file.
deb https://download.jitsi.org stable/
Save and exit.
Perform a system update to update the packages and then install jitsi-meet package.
sudo apt update
sudo apt install jitsi-meet
During the installation you will have to enter your domain name when prompted. Enter
the domain name and press Enter.
•
•
In the next option that appears select the first option and press Enter.
3.Installing SSL certificate.
Add the Certbot Repository
sudo add-apt-repository ppa:certbot/certbot
•
Install Certbot Package.
sudo apt install certbot
Run the TLS certificate installation program provided by Jitsi Meet:
sudo /usr/share/jitsi-meet/scripts/install-letsencrypt-cert.sh
Enter a valid email address when prompted and press Enter.
4. Password protect Jitsi meet.
Setup a password and username so that only users with these credentials can use
jitsimeet.
Open the file /etc/prosody/conf.avail/your_domain.cfg.lua in a text editor.
Edit the line
authentication = "anonymous"
Change it to
authentication = "internal_plain"
In the same file, add the following to the end of the file.
VirtualHost "guest.your_domain"
authentication = "anonymous"
c2s_require_encryption = false
Save and exit the file.
Open the configuration file /etc/jitsi/meet/your_domain-config.js
vi /etc/jitsi/meet/your_domain-config.js
edit the line anonymousdomain: 'guest.example.com', and change it to
anonymousdomain: 'guest.your_domain',
Save and exit the file.
Open the file /etc/jitsi/jicofo/sip-communicator.properties
vi /etc/jitsi/jicofo/sip-communicator.properties
add the line in it.
org.jitsi.jicofo.auth.URL=XMPP:your_domain
save and exit the file.
Add a user and password that can be used for authentication
sudo prosodyctl register user your_domain password
Restart the below processes.
sudo systemctl restart prosody.service
sudo systemctl restart jicofo.service
sudo systemctl restart jitsi-videobridge2.service
Integrate jistimeet to mattermost.
1.Download the jitsi plugin rar file from this link https://github.com/seansackowitz/mattermost-
plugin-jitsi/releases/download/v1.3.0/jitsi-1.3.0.tar.gz
2. Login to mattermost admin console.
Go to System Console > Integrations > Integration Management and turn the below setting
to true.
Enable Incoming Webhooks
Enable Outgoing Webhooks
Enable Custom Slash Commands
Enable integrations to override usernames
Enable integrations to override profile picture icons
Go to System Console > Plugin Management > Configuration and set Enable Plugins to true.
3.ssh into the mattermost server and open the file
/opt/mattermost/config/config.json
Under PluginSettings, make sure Enable and Enable Uploads are both set to true.
Restart your Mattermost with sudo systemctl restart mattermost
4.Go to System Console > Plugin Management . Click on choose file and uploaded the jitsi
plugin file we downloaded earlier.
5. Select jitsi under plugins and paste you jitsi server domain name and click on save.
Go to plugin management.
Click on enable to Enable jitsi.
In mattermost teams click on the camera icon at top to start the meetings and click on
Join meeting to join the meeting.
In the page that opens you will be prompted for the username and password . Enter the
username and password to start conferencing.