
Deploy Mailtrain V2(Beta) on Your Own Server
Mailtrain is a self hosted newsletter application built on Node.js (v10+) and MySQL (v8+) or MariaDB (v10+).
Want to deploy Mailtrain V2(Beta) on your server faster? Try Senate with one-command setup, automatic HTTPS and monitoring.
What is Mailtrain V2(Beta)?
Mailtrain is a self hosted newsletter application built on Node.js (v10+) and MySQL (v8+) or MariaDB (v10+).
Self-Host Mailtrain V2(Beta)
Follow these steps to deploy on your own server.
Install Docker
Skip this step if Docker is already installed on your server.
curl -fsSL https://get.docker.com | sh
Configure
Customize the settings below. Defaults work for most cases.
General
Deploy
Copy the configuration and run it on your server.
services:
mailtrain:
image: mailtrain/mailtrain:latest
environment:
MONGO_HOST: mailtrain-mongo
MYSQL_HOST: mailtrain-db
MYSQL_PASSWORD: ""
REDIS_HOST: mailtrain-redis
URL_BASE_PUBLIC: https://mailtrain-${mailtrain_lists}-appname.your-domain.com
URL_BASE_SANDBOX: https://mailtrain-${mailtrain_sandbox}-appname.your-domain.com
URL_BASE_TRUSTED: https://mailtrain.your-domain.com
WWW_PROXY: "true"
volumes:
- mailtrain-files:/app/server/files
depends_on:
- mailtrain-db
- mailtrain-redis
- mailtrain-mongo
mailtrain-$$cap_mailtrain_lists-appname:
image: caprover/nginx-reverse-proxy:1-ef5ffcb
environment:
UPSTREAM_HTTP_ADDRESS: http://mailtrain:3004
depends_on:
- mailtrain
mailtrain-$$cap_mailtrain_sandbox-appname:
image: caprover/nginx-reverse-proxy:1-ef5ffcb
environment:
UPSTREAM_HTTP_ADDRESS: http://mailtrain:3003
depends_on:
- mailtrain
mailtrain-db:
image: mariadb:10.5.4
environment:
MYSQL_DATABASE: mailtrain
MYSQL_PASSWORD: ""
MYSQL_ROOT_PASSWORD: ""
MYSQL_USER: mailtrain
volumes:
- mailtrain-db-data:/var/lib/mysql
mailtrain-mongo:
image: mongo:4.4.0-rc11
volumes:
- mailtrain-mongo-data:/data/db
mailtrain-redis:
image: redis:alpine3.12
volumes:
- mailtrain-redis-data:/data
volumes:
mailtrain-files: {}
mailtrain-db-data: {}
mailtrain-mongo-data: {}
mailtrain-redis-data: {}
Then run:
docker compose up -d
Access
Once started, access your app at http://localhost:3000
Why Self-Host Mailtrain V2(Beta)?
Full Data Ownership
Your data stays on your servers. No third-party access.
No Monthly Fees
Pay only for your server. No per-seat or usage charges.
Complete Control
Customize, backup, and scale on your own terms.
Privacy & Compliance
Meet GDPR, HIPAA, or internal security requirements.
Technical Details
Docker Image
mailtrain/mailtrain:${mailtrain_version}Want to go faster?
Try Senate! Senate handles Docker, HTTPS, updates, and monitoring for you. Deploy any of our 300+ apps with a single command.
Install on any Linux server:
sh -c "$(curl -sSL https://get.senate.sh)"