Open-source alternative
Replace Gmail with Mailflare / Stalwart
The best open-source alternative to Gmail is Mailflare or Stalwart, self-hosted on Railway. Apex mail you run. Mailflare is the Cloudflare Workers mailbox already on the office stack; Stalwart is the all-in-one IMAP/JMAP/SMTP server.
Estimated save $1,380 a year.
Open the stackStart on Railway
How Gmail compares
| Gmail | Mailflare / Stalwart | |
|---|---|---|
| Pricing model | Per-user subscription (Business Starter includes Gmail) | Open-source or fair-code license; you pay the host |
| Hosting | Vendor cloud | Self-hosted on Railway or any VPS |
| Rough monthly cost | $7/user/mo billed yearly (Business Starter); $8.40/user/mo flexible source | Hosting only — no SaaS seat meter in this repo |
- Mailflare
Email, calendar, and booking on Cloudflare Workers
- Stalwart
All-in-one mail and collaboration server (IMAP, JMAP, SMTP)
FAQ
- Is it free?
- The Mailflare / Stalwart licenses are open source or fair-code. You still pay hosting (Railway or any VPS) and any APIs the stack calls. There is no Gmail seat or task bill on this path.
- Can I migrate from Gmail?
- Yes. Start with the workflows or data you actually use, then cut over. The Mailflare / Stalwart stack page has the agent prompt and the cost table; most teams rebuild the slice that matters and leave old Gmail links until they expire.
- How do I deploy it?
- Open the Mailflare / Stalwart stack, copy the agent prompt, and deploy on Railway (one service, PORT, and a volume when the app needs disk). Stalwart wants a public IP, MX, and a volume — a VPS or a Railway service with DNS you control. Mailflare stays on Cloudflare (see the Mailflare office stack). Do not put two MX stories on the same hostname.
- What does this replace?
- Gmail. The published small-team estimate on this stack is $1,380 a year.
Related pages
Stack of the Week
Get one stack a week that replaces a SaaS bill.