Self-host Mail server (mox, experimental) with Levelrail
Experimental. Needs APP_EXPERIMENTAL=mail on the control plane: without it this template is hidden and cannot be installed. Install with the MAIL_FIRST_DOMAIN setting (templates install mail-mox --env MAIL_FIRST_DOMAIN=example.com). MAIL_HOSTNAME (the FQDN other servers connect to) defaults to mail. that domain and MAIL_ADMIN_EMAIL to postmaster@ that domain. Ports 25, 465, 587 and 993 are published on the host with a private bind by default. After install, open them with the CLI command mail ports open --confirm (or Open mail ports on the Mail page): that makes only those four ports public and allows them in the host firewall, then set up DNS. Webmail and the account UI are on port 8025 (private, no admin pages). The admin API and metrics are never published; never make them public. TLS: the first start makes a self-signed certificate (valid for localhost only, made by mox itself) so the server comes up with no manual steps. Replace it before sending real mail: put your certificate and key in the config volume and set MAIL_TLS_CERT_FILE and MAIL_TLS_KEY_FILE (paths under /mox/config, for example certs/cur.pem and certs/cur.key). Existing files at those paths are never overwritten. A changed certificate needs a container restart. Relay mode: set MAIL_SMARTHOST_HOST (and port, user, password) to send through a provider. Changing it needs a restart. The admin password is the generated secret SERVICE_PASSWORD_MAILADMIN. Back up the config and data volumes together. Deliverability depends on reverse DNS, SPF, DKIM and a clean IP; see the mail template guide. Licence: MIT.
- Memory256 MiB
- Archarm64
- Services1
Needs setup: set MAIL_FIRST_DOMAIN before the first start.
How to self-host Mail server (mox, experimental)
-
Pull the images
One image is pulled on your server.
Show images
r.xmox.nl/mox:v0.0.17@sha256:8889e7b48fdd5b0b07b51dd11a6d06536334ec442652f2ffb1e1df3a9d45074e
-
Create the app
One service starts in a single Compose app, with 2 named volume mounts for your data, on ports 8081, 25, 465, 587, 993.
-
Fill in the secrets
1 secret is generated and stored encrypted, 8 settings are preset, you provide 1 value.
-
Open it
Without a domain the app gets an sslip.io address; add --domain SERVICE=HOST to use your own.
Mail server (mox, experimental) requirements
- Memory
- About 256 MiB
- Architectures
- amd64 image published, arm64 image published
- Ports
- 8081, 25, 465, 587, 993
- Domain
- Optional, an sslip.io address is used without one
- Settings
- 1 to fill in
- License
- not yet recorded
- Listed. It is in the catalog but not verified. Back up the data volume before changing an image tag.
- Host ports. It publishes ports 8081, 25, 465, 587, 993 on the host, so open them in the VPS firewall only if you want that.
Install Levelrail first
On a server with Levelrail running, run the command above, or open the dashboard: Apps, New app, Browse templates, then Mail server (mox, experimental). New to Levelrail? Install it on a fresh VPS first.
docker pull ghcr.io/glincker/levelrail:latest Then levelrail-cli login --device. See Getting started and the Mail server (mox, experimental) docs page.
Deploy Mail server (mox, experimental) your way
Every format below deploys the same pinned images. Pick the one that fits how you work.
Deploy Mail server (mox, experimental) from the CLI
levelrail-cli templates install mail-mox --name my-mail-mox --env MAIL_FIRST_DOMAIN=VALUE Deploy Mail server (mox, experimental) with the API
curl -X POST -H "Authorization: Bearer $TOKEN" -H "Content-Type: application/json" \
https://levelrail.example.com/api/v1/service-templates/mail-mox/install \
-d '{
"name": "my-mail-mox",
"env": { "MAIL_FIRST_DOMAIN": "VALUE" }
}' Mail server (mox, experimental) configuration
Mail server (mox, experimental) services
| Service | Image | Ports | Volumes |
|---|---|---|---|
| mox | r.xmox.nl/mox:v0.0.17@sha256:8889e7b48fdd5b0b07b51dd11a6d06536334ec442652f2ffb1e1df3a9d45074e | 8081, 25, 465, 587, 993 | mail_config -> /mox/configmail_data -> /mox/data |
Mail server (mox, experimental) environment variables
| Variable | Service | Value |
|---|---|---|
| MAIL_ADMIN_EMAIL | mox | Preset by the template |
| MAIL_ADMIN_PASSWORD | mox | Generated at deploy |
| MAIL_FIRST_DOMAIN | mox | You must set this |
| MAIL_HOSTNAME | mox | Preset by the template |
| MAIL_SMARTHOST_HOST | mox | Preset by the template |
| MAIL_SMARTHOST_PASSWORD | mox | Preset by the template |
| MAIL_SMARTHOST_PORT | mox | Preset by the template |
| MAIL_SMARTHOST_USER | mox | Preset by the template |
Show all 10 variables
- MAIL_TLS_CERT_FILEmoxPreset by the template
- MAIL_TLS_KEY_FILEmoxPreset by the template
Ports and volumes
- Ports
- 8081, 25, 465, 587, 993
- Volumes
- 2 named mounts: mail_config -> /mox/config, mail_data -> /mox/data
Mail server (mox, experimental) FAQ
How much memory does Mail server (mox, experimental) need?
The catalog lists about 256 MiB of memory for Mail server (mox, experimental).
Does Mail server (mox, experimental) run on arm64?
For Mail server (mox, experimental), an arm64 image is published; amd64 is image published.
Does Mail server (mox, experimental) need configuration before it starts?
Yes. Mail server (mox, experimental) has required settings: MAIL_FIRST_DOMAIN.
Which ports does Mail server (mox, experimental) use?
Mail server (mox, experimental) listens on ports 8081, 25, 465, 587 and 993 inside the stack.
Where does Mail server (mox, experimental) keep its data?
In named volumes: mail_config mounted at /mox/config and mail_data mounted at /mox/data.
Can I deploy Mail server (mox, experimental) on Dokploy or Dokku?
The services and pinned images on this page can be run on any Docker host. The public Dokploy templates list we compared does not have an entry with the same id for Mail server (mox, experimental), so on Dokploy you would use a Docker Compose application with the file from this page. Dokku deploys container images with its own commands, so the pinned image r.xmox.nl/mox:v0.0.17@sha256:8889e7b48fdd5b0b07b51dd11a6d06536334ec442652f2ffb1e1df3a9d45074e is what you deploy there.