Outwright Alpha, iPhone and iPad GitHub

Your own mail server, without the usual pain

15 November 2026

I don't want my mail at a big tech company like Google or Microsoft. I don't want it at my ISP either. I want to host it myself and be in control of my data. But self-hosting mail is often considered a bad idea, and for good reasons: mail from a home-made server lands in spam, the setup is a stack of programs that each need their own configuration, and when something breaks there is nobody to call.

Most of those reasons come from one part of the job: sending. Receiving and storing mail is easy to do well on your own. Sending it so that Gmail and Outlook trust it is the hard part, and it is the part you can hand to someone else without giving up your mailbox.

This post is the setup we use ourselves, with every choice made for you and the reason behind it. It fits a household and a small company, club or association alike; where they differ, the post says so. It assumes someone is comfortable on a Linux command line. A disclosure up front: we make Outwright, the mail app recommended at the end.

Why self-hosted mail has a bad name

Set up a fresh server, point your domain at it and send a message to a friend on Gmail. One of three things happens: it bounces, it lands in spam, or it never leaves your server. The reasons:

All five are about sending. So we don't send from our own server: outgoing mail goes through a relay, a service whose whole job is to be trusted by the big mail providers. Incoming mail still arrives directly at your server, and your mailboxes never leave it.

The choices

1. Hetzner, because it is in the EU

Hetzner is a German hosting company with data centres in Germany and Finland. Your mail sits on a server under EU law, run by a company that is not in the business of reading it. A small cloud server costs a few euros a month. Pick a location in Germany or Finland when you create it.

2. Stalwart, because it is easy to set up

A classic mail server is several programs wired together: one to receive mail, one to store it, a spam filter, and something else again for calendars and contacts. Stalwart is one program that does all of it: SMTP, IMAP, JMAP, CalDAV, CardDAV and spam filtering. It is open source, written in Rust, and it tells you exactly which DNS records to publish for your domain.

3. One Debian VM, only for mail

Mail gets a server of its own. Nothing else running on it means nothing else can break it or expose it, and you can rebuild or move it without touching anything else. Debian is stable and needs little attention. Stalwart runs directly on it, installed by its own script; with nothing else on the machine there is no need for containers.

4. SMTP2GO for sending

SMTP2GO is the relay. Its free plan covers 1,000 messages a month and 200 a day, with up to five sending domains, and it doesn't expire. That is plenty for a household and for most small companies and associations; if you outgrow it, a paid plan raises the limits without changing anything else. Newsletters to all your members or customers belong in a newsletter service, not in this relay.

SMTP2GO is a New Zealand company, so your outgoing mail passes through a provider outside the EU. We looked for an EU relay first. The ones we found either put a logo in every message on their free and cheapest plans, run on a US cloud, or have a free plan too small for everyday use. SMTP2GO is small, independent and not big tech, and that is the trade we chose. For low volume, Lettermint is a fully EU alternative.

Whichever relay you use, it carries your outgoing mail and can read it, as every mail server on the way can. It never holds your mailbox.

5. Outwright on the phone

Outwright is our mail, calendar and contacts app for iOS, in alpha. It speaks the open standards (IMAP, SMTP, CalDAV and CardDAV) to your own server and finds that server from your address alone, using DNS records the setup publishes. Any other standards-based mail app works with this setup too.

The setup

1. Get a domain

Your address lives on your domain, so the domain is what makes you independent: with it, you can change server, relay or mail app and keep the same address. Buy one from any domain registrar; to keep this part in the EU too, INWX in Germany and Loopia in Sweden both let you search for a free name and point the domain at other nameservers, which the setup needs. A domain costs from about ten euros a year, and registrars often run offers where the first year costs one euro or just a few cents.

The examples use example.org for your domain and mail.example.org for the server. Replace both with your own.

2. Open two accounts

3. Create the server

In the Hetzner Cloud console, create a server with Debian, in Germany or Finland, with your SSH key. A small plan with 2 to 4 GB of memory is enough for a household or a small organisation, and you can resize the server later without reinstalling.

Before you press Create, open our setup script, fill in the six values at the top (your domain, the people who get an account, the Hetzner token and the three SMTP2GO values) and paste the whole script into the Cloud config field. At its first start the server sets itself up:

The script is short and plain enough to read before you run it, and you should. On a Debian server somewhere else, run it as root without a Hetzner token; it then sets up Stalwart and tells you which DNS records to publish yourself.

4. Point your domain at it

When the server is up, read what the script left for you:

ssh root@<server address> cat /root/mail-setup.txt

It holds the passwords and the next two steps. At your registrar, set the domain's nameservers to the Hetzner ones it lists. Once they are in place, Stalwart publishes the rest of the records and fetches its certificate by itself, and you can press Verify for the domain in SMTP2GO. Store the passwords in your password manager and give each person theirs.

In the web admin at https://mail.example.org/admin, shared addresses such as info@ or board@ can be aliases on one person's account, or a group that several people read. In an organisation, give a second person administrator access, so the mail never depends on one person.

5. Send a test message

Send a message to an outside address and look for it in SMTP2GO's activity list. It should say Delivered.

6. Check that the world trusts you

7. Bring your old mail along

Stalwart imports mail from Google Takeout, from Microsoft 365 and Exchange, and from any IMAP server. Its migration guide covers each. Switch the MX record once the import is done; mail that arrives at the old provider in between can be fetched with one more IMAP import.

8. Back it up

Turn on Hetzner's backups for the server, which keeps a copy of the whole machine for the last seven days, and add a backup of Stalwart's data to somewhere outside Hetzner. A mail server you can't restore doesn't put you in control.

9. Add the accounts on the phones

Each person adds their own account in Outwright, with their address and password. It reads the SRV records the setup published and finds IMAP, SMTP, calendars and contacts on mail.example.org by itself.

You stay in control

Every part of this can be replaced. The relay is one setting in Stalwart and a few DNS records: if SMTP2GO changes its terms, or a good EU relay comes along, you move in an afternoon and nobody you write to notices. The server can move to another host by restoring a backup and changing the A record. Your address stays the same through all of it, because the domain is yours.

That is the difference from Gmail or Microsoft, where leaving means moving everything and starting over with a new address. Here you rent the parts and own the whole.

PS: The same setup works on a physical server in your house. We don't recommend that, for many reasons, but the rationale is for another post.