---
title: "Cloud server with Mattermost"
sidebar_label: "Mattermost"
sidebar_position: 19
toc_max_heading_level: 3
description: "How to create a cloud server with a messenger for corporate communication"
---

import EditIcon from '@selectel/docux/icons/edit'
import CheckIcon from '@selectel/docux/icons/check'
import Tabs from '@theme/Tabs'
import TabItem from '@theme/TabItem'
import {TabItemLabel} from '@selectel/docux/components'
import {CustomTable} from '@selectel/docux/components'
import Formbricks from '@theme/MDXComponents/Formbricks'
import CopyIcon from '@selectel/docux/icons/copy'
import CreateServer from '@site/i18n/en/docusaurus-plugin-content-docs/current/_partials/cloud-servers/applications/create-server-for-apps.mdx'

# Cloud server with Mattermost

Mattermost is an open-source messenger for instant messaging. It can be used as an alternative to other messengers (e.g., Rocket.Chat) as a corporate internal chat for companies. In Mattermost, you can share files and automate routine tasks using scripts.

Mattermost can be deployed locally or in the cloud — [create a cloud server with the pre-installed Mattermost application](#create-cloud-server-with-mattermost).

Before creating a cloud server with an application, read the [software license agreements](https://423.selcdn.ru/kb/license-agreements-for-application-images-LANG.pdf) included in the image.

## Minimum resource requirements \{#minimum-requirements}

<CustomTable>
  <table>
    <thead>
      <th />

      <th>Test environment</th><th>Production environment</th>
    </thead>

    <tbody>
      <tr>
        <th>Number of vCPUs</th><td>2</td><td>2</td>
      </tr>

      <tr>
        <th>RAM</th><td>2 GB</td><td>4 GB</td>
      </tr>

      <tr>
        <th>Boot volume</th><td>20 GB</td><td>20 GB</td>
      </tr>
    </tbody>
  </table>
</CustomTable>

## Create a cloud server with Mattermost \{#create-cloud-server-with-mattermost}

For Mattermost to work, the cloud server must be accessible from the internet. To do this, when creating a server, you must create a private subnet and attach a public floating IP address.

чтобы настроить Mattermost, при создании сервера необходимо указать user data — пользовательские параметры конфигурации операционной системы.Вы можете задать один из двух набор параметров:

* with automatic creation of a PostgreSQL database on the server;
* with connection of the created [Managed Database PostgreSQL](/managed-databases/postgresql/) version higher than 12.

After the server with Mattermost is created, a free [TLS certificate from Let’s Encrypt®](/certificates-manager/certificates/lets-encrypt.mdx) will be automatically issued for the domain you specify. To issue the certificate, you need to add an A record for the domain and specify the server's public floating IP address in the record value. You can add the domain to [Selectel DNS hosting (actual](/dns-hosting/)).

1. [Create a public floating IP address](#create-floating-ip).

2. [Add an A record for the domain](#add-a-record).

3. [Create a cloud server with Mattermost](#create-mattermost-server).

### 1. Create a public floating IP address \{#create-floating-ip}

Create a public floating IP address so that the cloud server with Mattermost is accessible from the internet.

Use the [Create a public floating IP address](/cloud-servers/cloud-networks/public-floating-ip-addresses.mdx#create-public-floating-ip) section of the [Public floating IP addresses](/cloud-servers/cloud-networks/public-floating-ip-addresses.mdx) guide.

### 2. Add an A record for the domain⁠ \{#add-a-record}

[Add a resource record](/dns-hosting/records/add-record.mdx) to access Mattermost by domain.

Specify:

* [resource record type](/dns-hosting/records/add-record.mdx#record-types) in the group — A;
* record value — the public floating IP address that you [created in step 1](#create-floating-ip).

### 3. Create a cloud server with Mattermost \{#create-mattermost-server}

<CreateServer AppNameInPanel="Cloud Mattermost" MinConfig="2 vCPU, RAM starting from 4 GB and a boot disk size starting from 20 GB" OptionalVolumes="Optional: in order to add additional" VolumeSize="Specify the size of the network disk in GB or TB" />

<div style={{paddingLeft:'2em'}}>
  <Tabs queryString="add-user-data">
    <TabItem value="standard" default>
      <TabItemLabel>
        Creating a database on the server
      </TabItemLabel>

      ```yaml
      #cloud-config

      write_files:
      - path: "/opt/gomplate/values/user-values.yaml"
        permissions: "0644"
        content: |
          mattermostDomain: "<example.com>"
          mattermostAcmeEmail: "<root@example.com>"
          mattermostPostgresDB: "<database_name>"
          mattermostPostgresUser: "<database_user_name>"
          mattermostPostgresPassword: "<database_user_password>"
          mattermostTimezone: "<time_zone>"
          useExternalDB: false
      ```

      Specify:

      * `<example.com>` — domain for accessing Mattermost, which you [added earlier](#add-a-record);
      * `<root@example.com>` — administrator email;
      * `<database_name>` — PostgreSQL database name;
      * `<database_user_name>` — PostgreSQL database user name;
      * `<database_user_password>` — PostgreSQL database user password;
      * `<time_zone>` — time zone, for example `Europe/Moscow`;
      * `useExternalDB: false` — parameter to use a database on the server.
    </TabItem>

    <TabItem value="with-dbaas">
      <TabItemLabel>
        Connecting an existing Managed Database
      </TabItemLabel>

      ```yaml
      #cloud-config

      write_files:
      - path: "/opt/gomplate/values/user-values.yaml"
        permissions: "0644"
        content: |
          mattermostDomain: "<example.com>"
          mattermostAcmeEmail: "<root@example.com>"
          mattermostPostgresDB: "<database_name>"
          mattermostPostgresUser: "<database_user_name>"
          mattermostPostgresPassword: "<database_user_password>"
          mattermostTimezone: "<time_zone>"
          useExternalDB: true
          externalDBHost: "<host>"
          externalDBSSLMode: verify-ca
          externalDBPort: "<port>"
      ```

      Specify:

      * `<example.com>` — domain for accessing Mattermost that you [added earlier](#add-a-record);
      * `<root@example.com>` — Mattermost administrator email for account creation and Let’s Encrypt® notifications;
      * `<database_name>` — name of the PostgreSQL Managed Database. You can view it in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → tab **Databases**;
      * `<database_user_name>` — user name of the PostgreSQL Managed Database. You can view it in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → tab **Databases** → database card → field **Database owner**;
      * `<database_user_password>` — password of the PostgreSQL Managed Database user. The password is not stored in the control panel — if you lose it, [change the password](/managed-databases/postgresql/manage-users.mdx#change-user-password);
      * `<time_zone>` — time zone, for example `Europe/Moscow`;
      * `useExternalDB: true` — parameter to use a Managed Database;
      * `<host>` — DNS address of the PostgreSQL Managed Database. You can view it in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → tab **Settings** → block **Node addresses and statuses** → tab **DNS-addresses**;
      * optional: `<port>` — port to connect to PostgreSQL:
        * `5432` — port for direct connection to the PostgreSQL process;
        * `5433` — port to connect to the selected node via the [connection pooler](/managed-databases/postgresql/connection-pooler.mdx) — allows reducing the load on PostgreSQL. Use only the [session mode (session](/managed-databases/postgresql/connection-pooler.mdx#session-mode)). Do not use transaction mode (transaction), as migrations will not run during Mattermost initialization.
    </TabItem>
  </Tabs>
</div>

<Formbricks />
