설치 가이드 · 6 min read · Sep 30, 2025
우분투 18.04에 Mailtrain 뉴스레터 소프트웨어 설치하는 방법

Mailtrain은 MySQL/MariaDB 데이터베이스 백엔드를 지원하는 Node.js로 구축된 무료 오픈 소스 자가 호스팅 뉴스레터 애플리케이션입니다. Mailtrain을 사용하면 구독자를 수동으로 추가하거나 API를 통해 추가하거나 CSV 파일에서 가져올 수 있습니다. Mailtrain은 템플릿 편집기, 자동화, 사용자 정의 필드, RSS 캠페인, HTML 코드 편집기 등 다양한 기능을 제공합니다. 구독자가 많고 쉽게 관리하고 싶다면 Mailtrain이 최선의 선택입니다.
이 튜토리얼에서는 우분투 18.04 서버에서 Docker를 사용하여 Mailtrain 뉴스레터 애플리케이션을 설치하는 방법을 보여줍니다.
요구 사항
- 우분투 18.04를 실행하는 서버.
- 서버 IP를 가리키는 유효한 도메인 이름.
- 서버에 구성된 루트 비밀번호.
시작하기
시작하기 전에 시스템을 최신 버전으로 업데이트해야 합니다. 다음 명령어를 실행하여 이를 수행할 수 있습니다:
apt-get update -y
apt-get upgrade -y다음으로, 변경 사항을 적용하기 위해 시스템을 재시작합니다.
Docker 및 Docker Compose 설치
기본적으로 우분투 18.04 기본 저장소에는 최신 버전의 Docker가 없습니다. 따라서 Docker 저장소를 시스템에 추가해야 합니다.
먼저, 다음 명령어로 필요한 패키지를 설치합니다:
apt-get install curl git apt-transport-https ca-certificates -y다음으로, 다음 명령어로 Docker의 PGP 키를 다운로드하고 추가합니다:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | apt-key add -다음으로, /etc/apt/sources.list 파일을 편집하여 Docker CE 저장소를 추가합니다:
nano /etc/apt/sources.list파일의 끝에 다음 줄을 추가합니다:
deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable
작업이 끝나면 파일을 저장하고 닫습니다. 그런 다음, 저장소를 업데이트하고 다음 명령어로 Docker CE를 설치합니다:
apt-get update -y
apt-get install docker-ce -y설치가 성공적으로 완료되면 다음 명령어로 Docker 서비스의 상태를 확인할 수 있습니다:
systemctl status docker다음과 같은 출력을 볼 수 있어야 합니다:
Docker Application Container Engine
Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (running) since Thu 2019-10-24 16:15:25 UTC; 21min ago
Docs: https://docs.docker.com
Main PID: 1402 (dockerd)
Tasks: 45
CGroup: /system.slice/docker.service
?? 1402 /usr/bin/dockerd -H fd:// --containerd=/run/containerd/containerd.sock
??10312 /usr/bin/docker-proxy -proto tcp -host-ip 0.0.0.0 -host-port 3000 -container-ip 172.18.0.4 -container-port 3000
Oct 24 16:23:04 ubuntu1804 dockerd[1402]: time="2019-10-24T16:23:04.817021656Z" level=info msg="Layer sha256:b875b006eb8ffb0434ce3a26cb04c9017c
Oct 24 16:24:09 ubuntu1804 dockerd[1402]: time="2019-10-24T16:24:09.879265134Z" level=info msg="ignoring event" module=libcontainerd namespace=
Oct 24 16:24:10 ubuntu1804 dockerd[1402]: time="2019-10-24T16:24:10.065610315Z" level=warning msg="20676b10252b4a484e32a7d7534b3b386cc2a1e5efd1
Oct 24 16:25:52 ubuntu1804 dockerd[1402]: time="2019-10-24T16:25:52.649551513Z" level=info msg="Layer sha256:903ab9000f0a93e49537d5d00c5c8a8cab
Oct 24 16:26:47 ubuntu1804 dockerd[1402]: time="2019-10-24T16:26:47.428865652Z" level=info msg="Layer sha256:903ab9000f0a93e49537d5d00c5c8a8cab
Oct 24 16:27:41 ubuntu1804 dockerd[1402]: time="2019-10-24T16:27:41.603287585Z" level=info msg="Layer sha256:903ab9000f0a93e49537d5d00c5c8a8cab
다음으로, 아래와 같이 pip 명령어로 최신 버전의 docker compose를 설치합니다:
apt-get install python-pip
apt-get install docker-compose설치가 완료되면 다음 단계로 진행할 수 있습니다.
Docker로 Mailtrain 설치
먼저, 다음 명령어로 Git 저장소에서 Mailtrain의 최신 버전을 다운로드합니다:
git clone git://github.com/Mailtrain-org/mailtrain.git다음으로, mailtrain 디렉토리로 변경하고 기본 docker-compose 파일의 이름을 변경합니다:
cd mailtrain
mv docker-compose.override.yml.tmpl docker-compose.override.yml다음으로, 다음 명령어로 Mailtrain docker 컨테이너를 시작합니다:
docker-compose up -d이 명령어는 아래와 같이 mailtrain, mysql 및 redis 컨테이너를 다운로드하고 시작합니다:
Creating network "mailtrain_default" with the default driver
Creating volume "mailtrain_mailtrain-node-config" with default driver
Creating volume "mailtrain_mailtrain-node-data" with default driver
Creating volume "mailtrain_mailtrain-redis-data" with default driver
Creating volume "mailtrain_mailtrain-node-reports" with default driver
Creating volume "mailtrain_mailtrain-mysq-data" with default driver
Pulling redis (redis:3.0)...
3.0: Pulling from library/redis
f5cc0ee7a6f6: Pull complete
5fc25ed18e87: Pull complete
e025bc8872f6: Pull complete
77c68b51b836: Pull complete
7c403ece3755: Pull complete
0a653bd338f4: Pull complete
31531fd948c6: Pull complete
Digest: sha256:730b765df9fe96af414da64a2b67f3a5f70b8fd13a31e5096fee4807ed802e20
Status: Downloaded newer image for redis:3.0
Pulling mysql (mysql:5.7)...
5.7: Pulling from library/mysql
80369df48736: Pull complete
e8f52315cb10: Pull complete
cf2189b391fc: Pull complete
cc98f645c682: Pull complete
27a27ac83f74: Pull complete
fa1f04453414: Pull complete
d45bf7d22d33: Pull complete
c7d49ffebc56: Pull complete
511a8052b204: Pull complete
5d5df4c12444: Pull complete
d482603a2922: Pull complete
Digest: sha256:44b33224e3c406bf50b5a2ee4286ed0d7f2c5aec1f7fdb70291f7f7c570284dd
Status: Downloaded newer image for mysql:5.7
Building mailtrain
:
:
Removing intermediate container 20676b10252b
---> 0abdb4121f54
Step 6/9 : COPY . /app
---> c8af7560e844
Step 7/9 : EXPOSE 3000
---> Running in 3ff55179a229
Removing intermediate container 3ff55179a229
---> d83b49d4b24b
Step 8/9 : ENTRYPOINT ["bash", "/app/docker-entrypoint.sh"]
---> Running in e5baf6a1ea2e
Removing intermediate container e5baf6a1ea2e
---> c4f899a0f8f9
Step 9/9 : CMD ["node", "index.js"]
---> Running in fe94519d2bd3
Removing intermediate container fe94519d2bd3
---> 2808c2972f20
Successfully built 2808c2972f20
Successfully tagged mailtrain:latest
WARNING: Image for service mailtrain was built because it did not already exist. To rebuild this image you must use `docker-compose build` or `docker-compose up --build`.
Creating mailtrain_redis_1 ... done
Creating mailtrain_mysql_1 ... done
Creating mailtrain_mailtrain_1 ... done
이제 다음 명령어로 모든 실행 중인 컨테이너를 확인할 수 있습니다:
docker ps다음과 같은 출력을 볼 수 있어야 합니다:
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
0e837c586c39 mailtrain:latest "bash /app/docker-en…" About a minute ago Up 55 seconds 0.0.0.0:3000->3000/tcp mailtrain_mailtrain_1
49a4e69a09c6 mysql:5.7 "docker-entrypoint.s…" About a minute ago Up About a minute 3306/tcp, 33060/tcp mailtrain_mysql_1
a1449b64a196 redis:3.0 "docker-entrypoint.s…" About a minute ago Up About a minute 6379/tcp mailtrain_redis_1
Mailtrain 웹 인터페이스에 접근하기
Mailtrain 컨테이너가 이제 시작되었으며 포트 3000에서 수신 대기 중입니다. 다음으로, 웹 브라우저를 열고 URL http://your-server-ip:3000을 입력합니다. 다음 페이지에서 Mailtrain 기본 대시보드를 볼 수 있어야 합니다:

이제 로그인 버튼을 클릭합니다. 다음 페이지가 표시됩니다:

기본 사용자 이름과 비밀번호를 admin/admin으로 입력하고 로그인 버튼을 클릭합니다. 다음 페이지에서 Mailtrain 기본 대시보드를 볼 수 있어야 합니다:

Mailtrain을 위한 Nginx를 리버스 프록시로 구성하기
다음으로, 포트 3000에서 Mailtrain을 위한 리버스 프록시로 Nginx를 생성해야 합니다. 이를 위해 먼저 다음 명령어로 Nginx 웹 서버를 설치합니다:
apt-get install nginx -y다음으로, 다음 명령어로 Nginx 가상 호스트 구성 파일을 생성합니다:
nano /etc/nginx/sites-available/mailtrain.conf다음 줄을 추가합니다:
upstream mailtrain {
server 127.0.0.1:3000 weight=100 max_fails=5 fail_timeout=5;
}
server {
listen 80;
server_name example.com;
location / {
proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Server $host;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_pass http://mailtrain/;
}
}
작업이 끝나면 파일을 저장하고 닫습니다. 그런 다음, 다음 명령어로 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 가상 호스트 파일을 활성화합니다:
ln -s /etc/nginx/sites-available/mailtrain.conf /etc/nginx/sites-enabled/마지막으로, 다음 명령어로 Nginx 웹 서버를 재시작하여 구성을 적용합니다:
systemctl restart nginxLet’s Encrypt로 Mailtrain 보안 설정하기
다음으로, Let’s Encrypt 무료 SSL로 Mailtrain을 보안 설정하기 위해 Certbot 클라이언트를 설치해야 합니다. 기본적으로 최신 버전의 Certbot은 우분투 18.04 기본 저장소에 없습니다. 따라서 다음 명령어로 Certbot 저장소를 추가합니다:
add-apt-repository ppa:certbot/certbot다음으로, 저장소를 업데이트하고 다음 명령어로 Certbot을 설치합니다:
apt-get update -y
apt-get install certbot python-certbot-nginx -y설치가 완료되면, 다음 명령어를 실행하여 도메인 example.com에 대한 Let’s Encrypt 무료 SSL을 다운로드하고 Nginx가 이 인증서를 사용하도록 구성합니다.
certbot --nginx -d example.com이메일 주소를 제공하고 서비스 약관에 동의합니다. 인증서가 성공적으로 설치되면 다음과 같은 출력을 볼 수 있습니다:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
축하합니다! https://example.com를 성공적으로 활성화했습니다.
구성을 테스트해야 합니다:
https://www.ssllabs.com/ssltest/analyze.html?d=example.com
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
중요한 참고 사항:
- 축하합니다! 인증서와 체인이 다음 위치에 저장되었습니다:
/etc/letsencrypt/live/example.com/fullchain.pem
키 파일은 다음 위치에 저장되었습니다:
/etc/letsencrypt/live/example.com/privkey.pem
인증서는 2020-01-22에 만료됩니다. 향후 이 인증서의 새 버전이나 수정된 버전을 얻으려면 "certonly" 옵션으로 certbot을 다시 실행하십시오. 모든 인증서를 비대화식으로 갱신하려면 "certbot renew"를 실행하십시오.
- 계정 자격 증명이 Certbot 구성 디렉토리에 저장되었습니다 /etc/letsencrypt. 이 폴더의 안전한 백업을 지금 만들어야 합니다. 이 구성 디렉토리에는 Certbot으로 얻은 인증서와 개인 키도 포함되므로 이 폴더의 정기적인 백업이 이상적입니다.
- Certbot이 마음에 드시면 다음과 같이 작업을 지원해 주시기 바랍니다:
ISRG / Let's Encrypt에 기부하기: https://letsencrypt.org/donate
EFF에 기부하기: https://eff.org/donate-le
이제 URL https://example.com을 사용하여 Mailtrain 애플리케이션에 안전하게 접근할 수 있습니다.
결론
위의 튜토리얼에서는 우분투 18.04 서버에 Docker로 Mailtrain을 설치하는 방법을 배웠습니다. 또한 Mailtrain을 위한 Nginx를 리버스 프록시로 구성하고 Let’s Encrypt 무료 SSL로 Mailtrain을 보안 설정하는 방법도 배웠습니다. 질문이 있으면 언제든지 문의해 주세요.
새 게시물을 받은 편지함에서 받기
스팸은 없습니다. 언제든지 구독 해지 가능합니다.