---
title: "Deploy mailstead"
description: "Resend-backed self-hosted email portal with inbox and admin."
category: "Other"
url: https://railway.com/deploy/mailstead
---

# Deploy mailstead

Resend-backed self-hosted email portal with inbox and admin.

**[Deploy mailstead on Railway](https://railway.com/template/mailstead)**

Machine-readable deploy manifest (JSON, validated by TemplateCI): https://railway.com/deploy/mailstead/manifest.json

- **Creator:** Bayt
- **Category:** Other

## Template content

### mailstead

- **Source:** https://github.com/mabounassif/mailstead
- **Start command:** `python -m mailstead.run`
- **Health check:** /healthz
- **Public domain:** Yes

## Documentation

# Deploy and Host Mailstead on Railway

Self-hosted email portal for small teams, backed by [Resend](https://resend.com) for delivery and inbound mail.

## About Hosting

Mailstead runs as a single Docker service with a **persistent volume at `/data`** (SQLite database and mail blobs). A background worker process handles inbound webhooks, outbound sends, and scheduled jobs. Attach a Railway public domain; `PUBLIC_URL` is set from `RAILWAY_PUBLIC_DOMAIN`.

## Why Deploy

- **Own your mail UI** without running a full mail stack (Postfix, Dovecot, etc.)
- **Resend** handles deliverability and inbound receiving; Mailstead stores and presents mail
- **Admin + per-user mailboxes** for 10–50 users
- **Ops dashboard** at `/ops/` for storage and worker health

## Common Use Cases

- Team shared hosting on your domain via Resend
- Internal notifications inbox with a simple web client
- Staging or production portal next to your app on Railway

## Dependencies for

### Deployment Dependencies

| You provide | Purpose |
|-------------|---------|
| `RESEND_API_KEY` | Resend API (send + receive APIs) |
| `MAIL_DOMAIN` | Domain verified in Resend |
| `ADMIN_RECOVERY_EMAIL` | Password reset delivery |

Generated at deploy: `SECRET_KEY`, `APP_ENCRYPTION_KEY`, `BOOTSTRAP_TOKEN`. Optional: `DATABASE_URL` for Postgres instead of SQLite on `/data`.

## First deploy

1. Deploy and wait until **healthcheck** passes (`/healthz` recommended on Railway).
2. Open `https:///setup/` once (token is in service variables).
3. Create users and mailboxes in **Admin** (`/admin/`).
4. Configure Resend DNS for `MAIL_DOMAIN` and register webhooks (scheduled job or admin).

## Volume

Do not remove the `/data` volume unless you intend to wipe mail storage.

## Health

- Liveness: `/healthz`
- Readiness: `/readyz` (includes worker heartbeat)

## Source

[GitHub: mabounassif/mailstead](https://github.com/mabounassif/mailstead)


## Similar templates

- [Rocky Linux](https://railway.com/deploy/rocky-linux) — Hosted Rocky Linux 9 workspace with SSH and persistent storage. 🚀
- [Foundry Virtual Tabletop](https://railway.com/deploy/X5tR6G) — A Self-Hosted & Modern Roleplaying Platform
- [Letta Code Remote](https://railway.com/deploy/letta-code-remote) — Run a Letta Code agent 24/7. No inbound ports, just deploy.

Open this page in a browser: https://railway.com/deploy/mailstead
