---
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 a pre-installed Mattermost application](#create-cloud-server-with-mattermost).

Before creating a cloud server with the 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 need to create a private subnet and attach a public floating IP address.

To set up Mattermost, you must specify user data when creating a server — these are custom operating system configuration parameters. You can specify one of two parameter sets:

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

After creating a server with Mattermost, a free [Let’s Encrypt® TLS certificate](/certificates-manager/certificates/lets-encrypt.mdx) will be automatically issued for the domain you specify. To issue a certificate, you need to add an A record for the domain and specify the server's public floating IP address as 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) instructions.

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

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

Specify:

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

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

<CreateServer AppNameInPanel="Cloud Mattermost" MinConfig="2 vCPUs, RAM from 4 GB, and a boot disk size from 20 GB" OptionalVolumes="Optional: to add additional" VolumeSize="Specify the network disk size 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 to access Mattermost that you [added earlier](#add-a-record);
      * `<root@example.com>` — administrator's email;
      * `<database_name>` — PostgreSQL database name;
      * `<database_user_name>` — PostgreSQL database username;
      * `<database_user_password>` — PostgreSQL database user password;
      * `<time_zone>` — time zone, for example, `Europe/Moscow`;
      * `useExternalDB: false` — parameter for using the 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 to access Mattermost that you [added earlier](#add-a-record);
      * `<root@example.com>` — Mattermost administrator email to create an account and receive Let’s Encrypt® notifications;
      * `<database_name>` — PostgreSQL Managed Database name. Can be viewed in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → **Databases** tab;
      * `<database_user_name>` — PostgreSQL Managed Database username. Can be viewed in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → **Databases** tab → database card → **Database owner** field;
      * `<database_user_password>` — PostgreSQL Managed Database user password. The password is not stored in the control panel — if you lost it, [change the password](/managed-databases/postgresql/manage-users.mdx#change-user-password);
      * `<time_zone>` — time zone, for example, `Europe/Moscow`;
      * `useExternalDB: true` — parameter for using a managed database;
      * `<host>` — PostgreSQL Managed Database DNS address. Can be viewed in the [control panel](https://my.selectel.ru/vpc/default/dbaas/): in the top menu, click **Products** → **Managed Databases** → cluster page → **Settings** tab → **Node addresses and statuses** block → **DNS addresses** tab;
      * optional: `<port>` — port for connecting to PostgreSQL:
        * `5432` — port for connecting directly to the PostgreSQL process;
        * `5433` — port for connecting to the selected node via the [connection pooler](/managed-databases/postgresql/connection-pooler.mdx) — reduces the load on PostgreSQL. Use only [session mode](/managed-databases/postgresql/connection-pooler.mdx#session-mode). Do not use transaction mode, as migrations will not run during Mattermost initialization.
    </TabItem>
  </Tabs>
</div>

<Formbricks />
