Self-hosting guide
This guide takes you from an empty Linux server to a working mail server, in order. Every command is run exactly as written by the installer's own test, on a clean machine, against mail clients we did not write. If a step does not behave as described, run ./doctor (step 6) and it will tell you what is wrong.
1. What you need
- A Linux server with Docker 24 or newer and the compose plugin 2.20 or newer, a public IPv4 address, at least 3 GB of free disk (10 advised) and a synchronised clock. Also
openssl,sha256sum,awk,sortanddig(apt install dnsutils). - Ports 25, 465, 587 and 993 free for mail, and 80 and 443 free for the web. Outbound port 25 must be open: many hosting providers block it by default, so ask yours.
- A domain whose DNS you control, and a host name for the server such as
mail.example.com(not the bare domain). - A reverse-DNS (PTR) name for the server's address that matches the host name. This is set at your hosting provider, not in your DNS. Without it large providers will refuse your mail.
2. Get the installer
Self-hosting is offered by arrangement for now: write to contact@frontier-labs.in and we will send you the installer with its SHA-256. Check the file against it before you extract it:
sha256sum frontier-mail-install-<version>.tar.gz
tar xzf frontier-mail-install-<version>.tar.gz && cd frontier-mail-install-<version>
3. Point the name at the server
Before installing, create an A record for the host name pointing at the server's public IP address, and wait until it resolves.
4. Install
./install.sh --host mail.example.com --domain example.com --acme-email you@example.com --public-ip <the server's address>
The installer checks the bundle, runs a preflight that names exactly what it could not check, loads the server image and refuses to run any image other than the one the bundle pins, makes every secret and key, and starts three services. It prints paths, never a secret. Running it again is safe: every secret that exists is kept. All options, and what each does, are on the Configuration reference.
For a trial on a machine with no public name, add --tls-mode internal: it issues its own certificate, which browsers and mail clients will not trust.
5. Publish your DNS records
Open config/dns-records.txt. It lists the records for your domain: the A record (fill in the address), MX, SPF, DMARC and the two DKIM keys. Publish them at your DNS host. A DKIM value over 255 characters may need splitting into 255-character pieces if your DNS host asks.
6. Check everything
./doctor
doctor changes nothing and prints no secret. It checks that the services are healthy, that each mail port answers with its protocol's greeting, that the web certificate names your host and is not near its end, and each DNS record against what a public resolver says. For every problem it names the record or service and what to do. Its exit status is 0 when nothing failed, so it can run from cron. DNS changes can take a while to spread: run it again later.
7. Sign in and make mailboxes
Read the first password as root, from secrets/platform-password. Open https://mail.example.com, sign in as admin@example.com, and change the password under Settings ▸ Security. Under Administration ▸ Accounts create the mailboxes for your people. To host more domains, use Administration ▸ Customer domains: it shows each DNS record to publish and checks it live.
8. Connect devices
People can use the web mail, or any IMAP and SMTP client with the host name, port 993 (IMAP) and 465 or 587 (sending). Under Settings ▸ Devices the web mail builds a profile for iPhone and Mac.
To let phones and mail programs find the settings from just an address, turn on device setup: ./features on device-setup, then docker compose --env-file config/install.env up -d mail && docker compose --env-file config/install.env restart edge. It adds two more records to config/dns-records.txt: autoconfig.<your domain> (Thunderbird) and autodiscover.<your domain> (Outlook), each an A record pointing where the mail host points, or a CNAME to the mail host. Publish them, wait a minute for the edge to get a certificate for each name, and run ./doctor: it checks that both names answer with the right document. Turning it off again (./features off device-setup) removes the two sites and the two lines.
9. Optional features
./features list shows the switches and ./features on campaigns (or push, sharing) turns one on; then docker compose --env-file config/install.env up -d mail. Details are on the Configuration reference. Campaigns have their own guides: Sending campaigns and Set up a campaign sending domain.
10. Keep it healthy
- Certificates. The mail server reads its certificate when it starts, so a renewed certificate needs a restart.
config/fm-cert-restart.shdoes that only when the certificate changed; enable the timer withcp config/fm-cert-restart.{service,timer} /etc/systemd/system/ && systemctl enable --now fm-cert-restart.timer. - Backups.
./backupmakes one file holding the mail store, the secrets, the keys and the configuration. The mail server stops for the few seconds the store is copied; senders retry, nothing is lost. The file is private (0600) and holds secrets: store it as you would the server's/etc. Run it from cron and copy the files off the machine. - Restore. On a fresh machine, extract the same bundle version, then
./restore <the backup file>into the empty install anddocker compose --env-file config/install.env up -d. Restore refuses to overwrite anything that exists. - Upgrade. Extract the new bundle beside the old one and, from the new directory, run
./upgrade --from <the old directory>. It backs the old install up, carries your secrets and settings across and installs the new version. If the install fails it starts the old one again, unchanged. - Licence. Without a licence file the free size applies: 25 mailboxes and 3 domains. A licence file goes at
config/licence/licence.json. Only creating more is ever refused: reading, receiving and sending mail are never affected.
What this is and is not
One server on one machine. A cluster of three nodes is built and tested but set up by hand, not by the installer. There is no graphical installer.