Skip to content

Deployment

Ra's al Ghul edited this page Aug 9, 2026 · 1 revision

Deployment

Docker Compose

After running npm run setup:

docker compose up -d --build
docker compose ps
docker logs -f mail-bridge

The Compose deployment publishes:

  • 3090 for the HTTP webhook and health endpoint
  • 2525 for the optional trusted SMTP relay

Runtime data is mounted from ./data, and private material is mounted from ./secrets.

Run from source

Node.js 22 or newer is required:

npm install
npm start

When running outside Docker, update DATA_DIR, SECRETS_DB_PATH, MAILBRIDGE_PRIVATE_KEY_PATH, and certificate paths because the generated defaults use container paths under /app.

Cloudflare Tunnel

Set CLOUDFLARED_ENABLED=true only when the Mailbridge container should run the tunnel. Set CLOUDFLARED_TUNNEL_TOKEN to the tunnel token and route the public hostname to http://mail-bridge:3090 or the appropriate service address.

If cloudflared runs separately, leave the in-container tunnel disabled.

Health check

curl http://127.0.0.1:3090/health

Expected response: OK.

Do not expose SMTP port 2525 publicly. Docker Desktop and Linux bridge networks may present different source addresses, so verify logs before changing the allowlist.

Clone this wiki locally