Mattermost

This article describes how to install and configure the Mattermost server.

From Mattermost's homepage:

Mattermost is an open source, self-hosted Slack-alternative. As an alternative to proprietary SaaS messaging, Mattermost brings all your team communication into one place, making it searchable and accessible anywhere.

Installation

The Mattermost server can be installed in two ways:

An Electron-based desktop client is provided by the mattermost-desktop package.

With Docker

By using Docker, you do not need to manually install a database server and configure Mattermost dependencies. Since the docker image comes with all the dependencies automatically bundled, this is less work for you.

However, the tradeoff is that you cannot choose the database back-end or web server you want, but only those provided in the docker images, unless you make your own.

$ git clone https://github.com/mattermost/mattermost-docker.git 
  • Edit the docker-compose.yml file
    • Uncomment the args: line.
    • For Team edition, remove the comments on the line: - edition=team.
    • Adopt the UID/GID in the section to those of the owner of your ./volumes/app/mattermost/* folders.
    • Add the port forwarding statements as a child of app section (e.g. between build and restart)
  • Build and start the docker container:
  • Open in your browser.

Please refer to the official guide for how to configure TLS, email, enable Enterprise features and use several server nodes using Docker Compose.

There are also some Docker images provided on the official Mattermost Docker Hub page. Please also refer to the repository of the Mattermost Docker images.

With package

Install the package, or mattermost-gitAUR for the development version.

  • The installation will create the mattermost user and group.
  • The configuration happens in where and are both owned by .
  • In recursively owned by , we can find:
    • , a folder where all user files posted via messages, profile pictures and team pictures are stored;
    • , a folder related to the webapp client which contains files rewritten by the webapp during runtime and, in the subfolder, the web plugins installed via the webui;
    • , a folder related to the plugins (server part).
  • In , a folder created on the fly during the install process (cf. tmpfiles.d) which stores the server logs as json. and are both owned by .
  • The rest of the immutable Mattermost directory is located at /usr/share/webapps/mattermost/ and is recursively owned by root:root.

Continue with #Database setup.

Database setup

Mattermost requires a database back-end. If you plan to run it on the same machine, first install either MySQL or PostgreSQL as database.

Follow one of the following sections and then proceed with #Configuring Mattermost.

PostgreSQL

1. Install and configure PostgreSQL.

2. Choose between TCP or UNIX Socket, and jump to the corresponding section.

With TCP socket

3. Create the new user while connecting to the server as user (you will be prompted for a password for the new user):

4. Create the Mattermost database, owned by user:

$ sudo -u postgres createdb -O mmuser mattermostdb

5. PostgreSQL#Configure PostgreSQL to be accessible from remote hosts

6. Verify it works:

With Unix socket

3. Create the new user while connecting to the server as user:

4. Create the Mattermost database, owned by mattermost user:

5. Setup the Unix socket by adding the following line to /var/lib/postgres/data/pg_hba.conf:

6. Restart .

7. Verify it works:

Configuring Mattermost

Mattermost is configured in . Strings need to be quoted.

There are two settings you need to adapt to your database.

The setting: for MySQL and for PostgreSQL.

The :

  • For MySQL, set it to .
  • For PostgreSQL
    • TCP socket:
    • Unix socket: postgres:///mattermostdb?host=/run/postgresql ; make sure there are 3 slashes after postgres:, is the name of the database and is the directory containing the Unix socket

Start/enable and open http://localhost:8065/.

Setting up Mattermost

  1. Navigate to your Mattermost install and create a team and user.
  2. The first user in the system is automatically granted the role, which gives you access to the System Console.
  3. Click on the menu button in the top left corner and choose the System Console option.
  4. Update Environment > SMTP settings to setup an SMTP email service. The example below assumes AmazonSES.
    • Set SMTP Server to
    • Set SMTP Server Port to
    • Set Enable SMTP Authentication to true
    • Set SMTP Server Username to
    • Set SMTP Server Password to your_smtp_password
    • Set Connection Security to TLS
    • Save the Settings
  5. Update Site configuration > Notifications:
    • Set Send Email Notifications to true
    • Set Notification Display Name to
    • Set Notification From Address to mattermost@example.com
    • Set Support Email Address to some real address that can receive emails
    • Save the Settings
  6. Update Authentication > Email by changing Require Email Verification to true.
  7. Update Environment > Logging settings by setting Output logs to console to false.
  8. Feel free to modify other settings.
  9. Restart .

Plugins

Plugins are enabled by default, but require access to the plugins directory which needs to be created with the correct owner:

Useful tips

Valid HTTPS via reverse web-proxy

To securely access your Mattermost server from the Android and iOS apps, which do not support self-signed TLS certificates, you can setup a reverse web proxy.

The main benefits of a proxy are:

  • SSL termination
  • HTTP to HTTPS redirect
  • Port mapping 80 to 8065
  • Standard request logs

Proxying can be achieved with most web servers.

nginx

  1. Install and run nginx, preferably .
  2. Point your domain name eg. to the server.
  3. Configure nginx to proxy connections from the internet to the Mattermost Server. Create and edit the nginx configuration file .
  4. Enable the mattermost server:
  5. Restart .
  6. Verify you can access Mattermost through the proxy:
    $ curl http://localhost/
    You should see a page titled .
  7. Set up Let’s Encrypt.

Lighttpd2

A configuration sample for to act as a proxy for Mattermost, assuming you have a certificate at /etc/lighttpd2/certs/lighttpd2.pem.

See mod_vhost if you want to transfer the proxy into a virtual host.

Testing translations and pull requests

You can use the unofficial script mattermost-prepare-pkgbuild to test languages and pull requests.

gollark: It is then harder to change.
gollark: With server rendering: client gets HTML page from server, draws it.With client rendering: client gets HTML page, partly draws it, notices JS in it, fetches JS, executes it, draws result.
gollark: There is an ADDITIONAL NETWORK ROUND TRIP!
gollark: WRONG!
gollark: * loading time
This article is issued from Archlinux. The text is licensed under Creative Commons - Attribution - Sharealike. Additional terms may apply for the media files.