1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

Mattermost セルフホスティング方法 (最短)

Last updated at Posted at 2025-03-23

Mattermost

  • slack クローン
  • OSS

Discord と比較して

メリット

  • (Discord と同様に) Markdown 記法で書ける

デメリット

あくまでデフォルト設定, 現時点 (2025/3/23) での話

  • webp アニメーションのプレビュー機能はなし (ダウンロードしないと再生できない)
  • 画像を複数アップロードしたとき, いい感じに並べてプレビューしてくれない (↓のように並べて表示される)
    {7D1FC93F-8C12-45ED-82C6-57C3904255AC}.png

インストール

  • 今回は apt でインストール
    • mattermost 本体に加えて postgres のセットアップも必要
  • docker 版も動作確認したが, WebUI の上部にちょくちょくよくわからないエラーが出るという現象が発生したため, こちらは使用しない.
    {27DD6725-A6E4-4D49-89B3-0892DA9881F1}.png
  • 今回は postgres と mattermost は同じサーバーにインストール

実行環境

  • OS: Ubuntu Server 24.04 LTS
  • CPU: 4 vCPU, Skylake 世代
  • RAM: DDR4, 8GB
  • SSD: 32GB (SATA)
  • hostname: mattermost

インストール手順

DB インストール

公式ドキュメント:

① postgres インストール

sudo apt install postgresql

バージョン 16 がインストールされる.

② データベースとユーザーの作成

sudo -u postgres psql
CREATE DATABASE mattermost;
\connect mattermost
CREATE USER mmuser WITH PASSWORD 'mmuser-password';
GRANT ALL PRIVILEGES ON DATABASE mattermost to mmuser;
ALTER DATABASE mattermost OWNER TO mmuser;
GRANT USAGE, CREATE ON SCHEMA PUBLIC TO mmuser;
\q

pg_hba.conf をドキュメントに従って修正する

{236E9FA0-87E7-4565-9563-B14549EEE667}.png

sudo systemctl reload postgresql.service

③ 疎通確認

psql --dbname=mattermost --username=mmuser --password

Mattermost インストール

公式ドキュメント:

① import the new public key

curl -sL -o- https://deb.packages.mattermost.com/pubkey.gpg |  gpg --dearmor | sudo tee /usr/share/keyrings/mattermost-archive-keyring.gpg > /dev/null

② add the Mattermost Server repositories

curl -o- https://deb.packages.mattermost.com/repo-setup.sh | sudo bash -s mattermost

③ mattermost インストール

sudo apt install mattermost -y

10.6.1 がインストールされた.

セットアップ

① デフォルト設定ファイルをコピペして, 必要箇所を修正する.

sudo install -C -m 600 -o mattermost -g mattermost /opt/mattermost/config/config.defaults.json /opt/mattermost/config/config.json

postgres 接続設定の修正が必須.

"SqlSettings": {
  ...
  "DataSource": "postgres://mmuser:mmuser-password@localhost:5432/mattermost?...",
  ...
}

② mattermost 起動

sudo systemctl start mattermost.service

動作確認

にアクセスして, サインイン画面が出れば完了.

{BF340DE3-75BA-4F3C-B07A-496D9FB5B8DC}.png

1
1
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
1
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?