PostMTA
Deployment Guide

Deploy in Under
30 Minutes

Two ways to deploy: use the interactive script with LLM auto-healing for a guided setup, or follow the manual steps for full control over every configuration detail.

Interactive ScriptLLM Auto-HealingManual GuidesystemdProduction Ready
Quick Start

Interactive Deployment

The interactive deployment script handles everything: dependencies, configuration, building, systemd services, Nginx, TLS, firewall, and testing.

One-Command Setup

sudo bash deployment/interactive-deploy.sh

Run as root or with sudo for full system setup. The script prompts for every configuration value, detects and installs missing dependencies, builds all binaries, configures services, and runs health checks.

What the Script Configures

Install path and API port
PostgreSQL database and user
Redis connection and password
JWT secret (auto-generated)
Domain name for Nginx
TLS via Let's Encrypt (optional)
UFW firewall rules
Systemd service files
Log rotation (30-day)
KumoMTA endpoint (mock or real)
Dashboard enable/disable
Master agent interval
Slack/email alerts
LLM auto-healing (optional)

Auto-Healing & Resumability

healing

LLM-Powered Auto-Healing

Each step retries up to 3 times with exponential backoff. Optionally, Qwen2.5-Coder-0.5B analyzes failures and generates automatic fixes.

restart_alt

Stateful Resumption

If the script is interrupted (SSH disconnect, timeout, etc.), it resumes from the last completed step. State is stored in /opt/kumomta/.deploy-state.

visibility_off

Zero-Trace LLM

If LLM auto-healing is enabled, the model and binary are downloaded during deployment and automatically removed after successful setup — zero trace left on the server.

Manual

Manual Installation Guide

Step-by-step manual installation for full control over the deployment process.

1

System Requirements

Ubuntu 24.04 LTS, 4 vCPU, 8 GB RAM, 100 GB SSD. PostgreSQL 16, Redis 7, Go 1.22+, Node.js 20 LTS.

2

Install Dependencies

Install curl, wget, git, build-essential, postgresql, redis-server, nginx, ufw, certbot, fail2ban, unzip via apt-get.

3

Install Go & Node.js

Download Go 1.22+ from golang.org and Node.js 20 LTS from nodesource.com. Add both to PATH.

4

Clone Repository

Clone the repository to /opt/kumomta. Create kumomta system user with home directory.

5

Create Environment File

Configure DATABASE_URL, REDIS_URL, JWT_SECRET (32+ chars), CORS_ALLOWED_ORIGINS, KUMOMTA_ENDPOINT.

6

Setup PostgreSQL

Create kumomta role and database, enable pgcrypto extension, apply database/schema.sql.

7

Setup Redis

Enable and start redis-server. Optionally set a password in /etc/redis/redis.conf.

8

Build API Server

cd api && go build -o kumomta-api -ldflags='-s -w' . Verify with curl /health.

9

Build Dashboard

cd dashboard && npm install && npm run build. Test on port 3000.

10

Build Master Agent

cd master-agent && go build -o kumomta-agent -ldflags='-s -w' .

11

Configure Nginx

Create reverse proxy config. Routes /api/, /health, /track/, /metrics to API, / to dashboard.

12

Setup TLS Certificates

Run certbot --nginx -d yourdomain.com for Let's Encrypt certificates with auto-renewal.

13

Install systemd Services

Copy service files from deployment/systemd/. Enable and start all three services (API, Dashboard, Agent).

14

Configure Log Rotation

Copy deployment/logrotate/kumomta to /etc/logrotate.d/. 30-day retention with daily rotation.

15

Configure Firewall

Enable UFW, deny incoming by default, allow ports 22, 80, 443, 587, 465.

16

Verify & Test

Check /health endpoint, run deep-regression (112 tests), failover tests, create admin user.

Need Help Deploying?

Our team can help you design, deploy, and optimize your email infrastructure. From initial setup to production tuning — we are here to help.