설치 가이드 · 8 min read · Oct 12, 2025

Ubuntu 20.04에 Mattermost 팀 메시징 시스템 설치하는 방법

Mattermost는 채팅, 파일 공유, 검색 및 통합을 위해 사용되는 오픈 소스 및 자체 호스팅 메시징 애플리케이션입니다. 모든 팀 커뮤니케이션을 한 곳에 모으는 Slack 채팅의 대안입니다. React와 Golang으로 작성되었으며, 백엔드에서 PostgreSQL 또는 MySQL 데이터베이스를 사용합니다. 푸시 알림, 무제한 검색 기록, 사용자 정의 이모지, 웹훅 및 명령, 액티브 디렉토리, 다중 노드 데이터베이스 배포 지원, 포럼, 토론 게시판 등 다양한 기능을 제공합니다.

이 튜토리얼에서는 Ubuntu 20.04에서 Nginx 및 Let’s Encrypt SSL을 사용하여 Mattermost를 설치하는 방법을 보여줍니다.

사전 요구 사항

  • Ubuntu 20.04를 실행하는 서버.
  • 서버 IP에 포인팅된 유효한 도메인 이름.
  • 서버에 구성된 루트 비밀번호.

시작하기

먼저, 시스템 패키지를 최신 버전으로 업데이트하는 것이 좋습니다. 다음 명령어를 실행하여 업데이트할 수 있습니다:

apt-get update -y

모든 패키지가 업데이트되면, 다음 명령어를 실행하여 필요한 다른 종속성을 설치합니다:

apt-get install curl wget vim git unzip gnupg2 -y

모든 필수 패키지를 설치한 후, 다음 단계로 진행할 수 있습니다.

MariaDB 설치 및 구성

Mattermost는 데이터베이스 백엔드로 MySQL/MariaDB를 사용합니다. 따라서 MariaDB 서버는 서버에 설치되어야 합니다. 설치되지 않은 경우, 다음 명령어로 설치할 수 있습니다:

apt-get install mariadb-server -y

MariaDB 서버를 설치한 후, 다음 명령어로 MariaDB에 로그인합니다:

mysql

로그인 후, 다음 명령어로 Mattermost용 데이터베이스와 사용자를 생성합니다:

MariaDB [(none)]> CREATE DATABASE mattermostdb;  
MariaDB [(none)]> CREATE USER 'mattermost'@'%' IDENTIFIED BY 'password';

다음으로, 다음 명령어로 Mattermost에 모든 권한을 부여합니다:

MariaDB [(none)]> GRANT ALL PRIVILEGES ON mattermostdb.* TO 'mattermost'@'%';

다음으로, 권한을 플러시하고 다음 명령어로 MariaDB 셸에서 나옵니다:

MariaDB [(none)]> FLUSH PRIVILEGES;  
MariaDB [(none)]> EXIT;

MariaDB 데이터베이스 구성이 완료되면, 다음 단계로 진행할 수 있습니다.

Mattermost 설치 및 구성

먼저, 공식 웹사이트에서 Mattermost의 최신 버전을 다운로드해야 합니다. 다음 명령어로 다운로드할 수 있습니다:

wget https://releases.mattermost.com/5.24.2/mattermost-5.24.2-linux-amd64.tar.gz

다운로드가 완료되면, 다음 명령어로 다운로드한 파일을 추출합니다:

tar -xvzf mattermost-5.24.2-linux-amd64.tar.gz

다음으로, 추출한 디렉토리를 /opt로 복사합니다:

cp -r mattermost /opt

다음으로, Mattermost용 데이터 디렉토리를 생성합니다:

mkdir /opt/mattermost/data

다음으로, Mattermost를 실행할 별도의 사용자를 생성해야 합니다. 다음 명령어로 생성할 수 있습니다:

useradd --system --user-group mattermost

다음으로, 다음 명령어로 mattermost 디렉토리의 소유권을 mattermost로 변경하고 적절한 권한을 부여합니다:

chown -R mattermost:mattermost /opt/mattermost  
chmod -R g+w /opt/mattermost

다음으로, Mattermost 기본 구성 파일을 편집하고 데이터베이스 설정 및 사이트 URL을 정의합니다.

nano /opt/mattermost/config/config.json

필요에 따라 다음 줄을 변경합니다:

    "SiteURL": "https://mattermost.linuxbuz.com",

    "DriverName": "mysql",
    "DataSource": "mattermost:password@tcp(localhost:3306)/mattermostdb?charset=utf8mb4,utf8\u0026readTimeout=30s\u0026writeTimeout=30s",

작업이 완료되면 파일을 저장하고 닫습니다.

Mattermost용 Systemd 서비스 파일 생성

다음으로, Mattermost 서비스를 관리하기 위해 systemd 서비스 파일을 생성해야 합니다. 다음 명령어로 생성할 수 있습니다:

nano /lib/systemd/system/mattermost.service

다음 줄을 추가합니다:

[Unit]
Description=Mattermost
After=network.target
After=mysql.service
Requires=mysql.service

[Service]
Type=notify
User=mattermost
Group=mattermost
ExecStart=/opt/mattermost/bin/mattermost
TimeoutStartSec=3600
Restart=always
RestartSec=10
WorkingDirectory=/opt/mattermost
LimitNOFILE=49152

[Install]
WantedBy=mariadb.service

파일을 저장하고 닫은 후, 다음 명령어로 systemd 데몬을 다시 로드합니다:

systemctl daemon-reload

다음으로, 다음 명령어로 Mattermost 서비스를 시작하고 시스템 재부팅 시 자동으로 시작되도록 설정합니다:

systemctl start mattermost  
systemctl enable mattermost

다음으로, 다음 명령어로 Mattermost 서비스의 상태를 확인합니다:

systemctl status mattermost

다음과 같은 출력을 받아야 합니다:

? mattermost.service - Mattermost
     Loaded: loaded (/lib/systemd/system/mattermost.service; disabled; vendor preset: enabled)
     Active: active (running) since Sat 2020-08-01 09:12:52 UTC; 17s ago
   Main PID: 4106 (mattermost)
      Tasks: 20 (limit: 2353)
     Memory: 85.9M
     CGroup: /system.slice/mattermost.service
             ??4106 /opt/mattermost/bin/mattermost
             ??4198 plugins/com.mattermost.nps/server/dist/plugin-linux-amd64

Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.131499,"caller":"mlog/sugar.go:19","msg":"Sent notification of ne>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.1841655,"caller":"jobs/workers.go:73","msg":"Starting workers"}
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.1842792,"caller":"bleveengine/bleve.go:267","msg":"UpdateConf Ble>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.1930475,"caller":"jobs/schedulers.go:74","msg":"Starting schedule>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.20063,"caller":"app/web_hub.go:83","msg":"Starting websocket hubs>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.2099638,"caller":"app/license.go:37","msg":"License key from http>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.2205582,"caller":"app/server.go:525","msg":"Starting Server..."}
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.2208374,"caller":"app/server.go:594","msg":"Server is listening o>
Aug 01 09:12:52 ubuntu2004 mattermost[4106]: {"level":"info","ts":1596273172.2211802,"caller":"commands/server.go:106","msg":"Sending systemd >
Aug 01 09:12:52 ubuntu2004 systemd[1]: Started Mattermost.

이 시점에서 Mattermost는 실행 중이며 포트 8065에서 수신 대기하고 있습니다.

Nginx를 리버스 프록시로 구성

다음으로, Mattermost에 대한 리버스 프록시로 Nginx를 구성해야 합니다. 먼저, 다음 명령어로 Nginx 패키지를 설치합니다:

apt-get install nginx -y

설치가 완료되면, 다음 명령어로 Nginx 가상 호스트 구성 파일을 생성합니다:

nano /etc/nginx/sites-available/mattermost.conf

다음 줄을 추가합니다:

upstream mattermost {
   server localhost:8065;
   keepalive 32;
}

proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=mattermost_cache:10m max_size=3g inactive=120m use_temp_path=off;

server {
   listen 80;
   server_name mattermost.linuxbuz.com;

   location ~ /api/v[0-9]+/(users/)?websocket$ {
       proxy_set_header Upgrade $http_upgrade;
       proxy_set_header Connection "upgrade";
       client_max_body_size 50M;
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       client_body_timeout 60;
       send_timeout 300;
       lingering_timeout 5;
       proxy_connect_timeout 90;
       proxy_send_timeout 300;
       proxy_read_timeout 90s;
       proxy_pass http://mattermost;
   }

   location / {
       client_max_body_size 50M;
       proxy_set_header Connection "";
       proxy_set_header Host $http_host;
       proxy_set_header X-Real-IP $remote_addr;
       proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
       proxy_set_header X-Forwarded-Proto $scheme;
       proxy_set_header X-Frame-Options SAMEORIGIN;
       proxy_buffers 256 16k;
       proxy_buffer_size 16k;
       proxy_read_timeout 600s;
       proxy_cache mattermost_cache;
       proxy_cache_revalidate on;
       proxy_cache_min_uses 2;
       proxy_cache_use_stale timeout;
       proxy_cache_lock on;
       proxy_http_version 1.1;
       proxy_pass http://mattermost;
   }
}

파일을 저장하고 닫은 후, 다음 명령어로 가상 호스트 구성을 활성화합니다:

ln -s /etc/nginx/sites-available/mattermost.conf /etc/nginx/sites-enabled/mattermost.conf

다음으로, 다음 명령어로 Nginx에 구성 오류가 있는지 확인합니다:

ginx -t

다음과 같은 출력을 받아야 합니다:

nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
nginx: configuration file /etc/nginx/nginx.conf test is successful

마지막으로, 다음 명령어로 Nginx 서비스를 재시작하여 변경 사항을 적용합니다:

systemctl restart nginx

Let’s Encrypt SSL로 Mattermost 보안 설정

먼저, Let’s Encrypt SSL을 관리하기 위해 시스템에 Certbot 클라이언트를 설치해야 합니다. 다음 명령어로 설치할 수 있습니다:

apt-get install python3-certbot-nginx -y

Certbot 설치 후, 다음 명령어를 실행하여 웹사이트에 대한 Let’s Encrypt SSL을 설치합니다.

certbot --nginx -d mattermost.linuxbuz.com

유효한 이메일 주소를 제공하고 서비스 약관에 동의하라는 메시지가 표시됩니다:

Saving debug log to /var/log/letsencrypt/letsencrypt.log
Plugins selected: Authenticator nginx, Installer nginx
Enter email address (used for urgent renewal and security notices) (Enter 'c' to
cancel): [email protected]

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Please read the Terms of Service at
https://letsencrypt.org/documents/LE-SA-v1.2-November-15-2017.pdf. You must
agree in order to register with the ACME server at
https://acme-v02.api.letsencrypt.org/directory
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(A)gree/(C)ancel: A

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Would you be willing to share your email address with the Electronic Frontier
Foundation, a founding partner of the Let's Encrypt project and the non-profit
organization that develops Certbot? We'd like to send you email about our work
encrypting the web, EFF news, campaigns, and ways to support digital freedom.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
(Y)es/(N)o: Y
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for mattermost.linuxbuz.com
Waiting for verification...
Cleaning up challenges
Deploying Certificate to VirtualHost /etc/nginx/sites-enabled/mattermost.conf

다음으로, HTTP 트래픽을 HTTPS로 리디렉션할지 여부를 선택합니다:

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
1: No redirect - Make no further changes to the webserver configuration.
2: Redirect - Make all requests redirect to secure HTTPS access. Choose this for
new sites, or if you're confident your site works on HTTPS. You can undo this
change by editing your web server's configuration.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2

2를 입력하고 Enter를 눌러 도메인에 Let’s Encrypt SSL을 설치합니다. 설치가 완료되면 다음과 같은 출력을 보게 됩니다:

Redirecting all traffic on port 80 to ssl in /etc/nginx/sites-enabled/mattermost.conf

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Congratulations! You have successfully enabled https://mattermost.linuxbuz.com

You should test your configuration at:
https://www.ssllabs.com/ssltest/analyze.html?d=mattermost.linuxbuz.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

IMPORTANT NOTES:
 - Congratulations! Your certificate and chain have been saved at:
   /etc/letsencrypt/live/mattermost.linuxbuz.com/fullchain.pem
   Your key file has been saved at:
   /etc/letsencrypt/live/mattermost.linuxbuz.com/privkey.pem
   Your cert will expire on 2020-10-30. To obtain a new or tweaked
   version of this certificate in the future, simply run certbot again
   with the "certonly" option. To non-interactively renew *all* of
   your certificates, run "certbot renew"
 - Your account credentials have been saved in your Certbot
   configuration directory at /etc/letsencrypt. You should make a
   secure backup of this folder now. This configuration directory will
   also contain certificates and private keys obtained by Certbot so
   making regular backups of this folder is ideal.
 - If you like Certbot, please consider supporting our work by:

   Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
   Donating to EFF:                    https://eff.org/donate-le

 - We were unable to subscribe you the EFF mailing list because your
   e-mail address appears to be invalid. You can try again later by
   visiting https://act.eff.org.

Mattermost 웹 인터페이스에 접근

이제 웹 브라우저를 열고 URL https://mattermost.linuxbuz.com을 입력합니다. Mattermost 가입 화면으로 리디렉션됩니다: Mattermost 로그인

이메일 주소, 이름, 비밀번호를 제공하고 계정 생성 버튼을 클릭합니다. 다음 화면이 표시됩니다: Mattermost 팀 커뮤니케이션

팀 생성 버튼을 클릭합니다. 다음 화면이 표시됩니다: 팀 이름

팀 이름을 제공하고 다음 버튼을 클릭합니다. 다음 화면이 표시됩니다: 팀 URL

팀 URL을 제공하고 완료 버튼을 클릭합니다. Mattermost 환영 화면이 표시됩니다: Mattermost 대시보드

튜토리얼 건너뛰기 버튼을 클릭합니다. 다음 화면에서 Mattermost 대시보드를 볼 수 있습니다: Mattermost 채팅

결론

이 가이드에서는 Ubuntu 20.04 서버에 Mattermost 팀 메시징 애플리케이션을 설치하는 방법을 배웠습니다. 또한 Nginx를 리버스 프록시로 구성하고 Let’s Encrypt SSL로 보안 설정하는 방법을 배웠습니다. 이제 Mattermost 서비스를 탐색하고 팀과 함께 작업할 수 있습니다.

Share: X/Twitter LinkedIn

새 게시물을 받은 편지함에서 받기

스팸은 없습니다. 언제든지 구독 해지 가능합니다.