Deploy Mailpit

Mailpit 1.31 email testing server with SMTP, web UI and REST API.

Deploy Mailpit

Just deployed

/data

Deploy and Host Mailpit on Railway

Mailpit is an email and SMTP testing tool for developers. Applications send mail to its SMTP server instead of real inboxes, and you inspect every message in a fast web UI with HTML previews, headers, attachments, link checks and spam scores. A REST API lets integration tests assert on sent emails.

About Hosting Mailpit

This template deploys Mailpit v1.31.2 from the official image as a single service. Messages are stored in SQLite on a Railway volume, so they survive redeploys, and the store keeps the newest 5,000 messages. The web UI and API are protected with a generated login. SMTP requires authentication too, with a separate generated password. Services on Railway send over the private network on port 1025, and external apps use the Railway TCP proxy. Mailpit never delivers mail to real recipients, so it is safe for staging environments and fits on the Hobby plan.

Common Use Cases

  • Catching outgoing email from staging and preview environments
  • Asserting on sent emails in end-to-end and integration tests through the API
  • Checking HTML rendering, links and spam scores before a campaign

Dependencies for Mailpit Hosting

  • axllent/mailpit:v1.31.2 (official image)
  • A Railway volume at /data for the SQLite database
  • A Railway TCP proxy for SMTP from outside Railway

Deployment Dependencies

Implementation Details

ServiceImageNetworkingStorage
mailpitaxllent/mailpit:v1.31.2public UI on 8025; private SMTP 1025; TCP proxy to 1025volume at /data

Point your app's SMTP settings at Mailpit:

SMTP_HOST=${{mailpit.SMTP_HOST}}   # private; port 1025
SMTP_USER=smtp
SMTP_PASSWORD=${{mailpit.MP_SMTP_PASSWORD}}
VariableDefaultPurpose
MP_UI_AUTHadmin:Web UI and API login
MP_SMTP_AUTHsmtp:SMTP login
MP_MAX_MESSAGES5000Older messages are deleted beyond this

Notes:

  • SMTP runs without TLS (MP_SMTP_AUTH_ALLOW_INSECURE=true), which is fine for test mail on the private network. Avoid sending real personal data through the TCP proxy.

This is a community-maintained deployment package and does not imply affiliation with or endorsement by the Mailpit project or its maintainers.

Why Deploy Mailpit on Railway?

Railway is a singular platform to deploy your infrastructure stack. Railway will host your infrastructure so you don't have to deal with configuration, while allowing you to vertically and horizontally scale it.

By deploying Mailpit on Railway, you are one step closer to supporting a complete full-stack application with minimal burden. Host your servers, databases, AI agents, and more on Railway.


Template Content

More templates in this category

View Template
Rocky Linux
Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀

codestorm
47
View Template
Foundry Virtual Tabletop
A Self-Hosted & Modern Roleplaying Platform

Lucas
71
View Template
Letta Code Remote
Run a Letta Code agent 24/7. No inbound ports, just deploy.

Letta
51