Single-Node Server Installation
This guide walks you through installing hermEX on a single clean Linux server from start to finish, including hardware and network prerequisites, interactive installer prompts, DNS record setup, DKIM activation, and service verification. For a multi-server deployment sharing MariaDB across backend pods, see Multi-Node Installation.
1. Prerequisites
Before you connect to the server, prepare these three items:
- A Linux VPS or bare-metal server meeting the requirements below.
- A registered domain name (for example
example.com). - Access to your DNS provider panel (such as Cloudflare, Hetzner DNS, Route 53, or your domain registrar).
Server Requirements
| Component | Minimum | Recommended |
|---|---|---|
| CPU | 2 vCPU (x86_64 or arm64) | 4 vCPU |
| Memory (RAM) | 4 GB | 8 GB |
| Storage | 20 GB SSD | 50 GB+ SSD (grows with mailbox data) |
| IP Address | 1 static public IPv4 address | 1 static public IPv4 + PTR (rDNS) matching your hostname |
install.sh installs MariaDB 11.8 (directory, policies, outbound relay spool, and centralized system_logs), ClamAV (clamd + freshclam), and the 14 hermEX daemons. ClamAV alone uses roughly 1.2 GB of RAM for its signature database, so servers under 4 GB RAM may hit out-of-memory kills during signature loads.
Supported Operating Systems
install.sh checks the distribution and architecture before installing packages:
- RHEL 9, AlmaLinux 9, Rocky Linux 9 (
amd64/arm64) - Debian 12 (
amd64/arm64) - Ubuntu 22.04 LTS, Ubuntu 24.04 LTS (
amd64/arm64)
Required Firewall Ports
install.sh automatically opens these TCP ports in firewalld or ufw when active. If your cloud provider uses an external firewall or security group, allow inbound traffic on all of them:
| Port (TCP) | Service | Notes |
|---|---|---|
25 | SMTP | Server-to-server inbound mail (must not be blocked by your VPS host) |
465 | SMTPS | Implicit TLS mail submission |
587 | SMTP Submission | STARTTLS authenticated mail submission |
110, 995 | POP3 / POP3S | Standard and implicit-TLS POP3 |
143, 993 | IMAP / IMAPS | STARTTLS and implicit-TLS IMAP |
80, 443 | HTTP / HTTPS | Unified front door (gateway), webmail, EWS, ActiveSync, DAV, JMAP, MTA-STS, ACME |
4190 | ManageSieve | Server-side filter management |
Many cloud providers block TCP port 25 by default on new accounts. Request port 25 unblocking and configure a matching PTR (reverse DNS) record for your server IP pointing to your mail hostname (for example mail.example.com) before sending mail to external providers.
2. Pre-Create the Server Hostname DNS Record
To enable automatic Let's Encrypt TLS certificates during installation, point your mail server hostname to the server IP before running install.sh.
Create an A record in your DNS panel:
- Type:
A - Name:
mail(makingmail.example.com) - Value: Your server's public IPv4 address
- Proxy status (Cloudflare): DNS only (gray cloud)
If you plan to expose the Admin Panel on a dedicated hostname (recommended over SSH-only access), also create a CNAME record:
- Type:
CNAME - Name:
admin(makingadmin.example.com) - Target:
mail.example.com - Proxy status (Cloudflare): DNS only (gray cloud)
Wait 1 to 2 minutes and verify that mail.example.com resolves to your server IP before continuing.
3. Connect via SSH and Run install.sh
Connect to your server as root:
ssh root@YOUR_SERVER_IP
Download install.sh and run the interactive installer with your server's fully qualified mail hostname:
curl -fsSLO https://raw.githubusercontent.com/KilimcininKorOglu/hermEX/main/install.sh
chmod +x install.sh
sudo ./install.sh install --hostname mail.example.com
Interactive Prompts Explained
At the start of install.sh, the script asks up to five questions up front and then installs unattended:
- First mail domain (empty to skip) [
example.com]: Enter the primary domain that will host email accounts (press Enter to acceptexample.com). - Publish the admin panel under this host name (empty: SSH tunnel only) [
admin.example.com]: Enter the hostname for the Admin Panel web UI (for exampleadmin.example.com), or delete the default and press Enter to access the Admin Panel strictly through an SSH tunnel (ssh -L 8608:127.0.0.1:8608). - Let's Encrypt contact email (empty to keep the self-signed certificate) [
postmaster@example.com]: Address sent to Let's Encrypt for TLS certificate expiration notices. - Accept the Let's Encrypt terms (
https://letsencrypt.org/repository/)? yes/no [no]: Typeyesand press Enter to enable automatic ACME TLS certificates (requiresmail.example.comto already resolve to this server). - Publish MTA-STS in testing mode for
example.com? yes/no [no]: Typeyesifmta-sts.example.comalready resolves to this server, or leavenoand enable MTA-STS after publishing your DNS records.
You can pass every option as CLI flags instead of answering prompts:
sudo ./install.sh install \
--hostname mail.example.com \
--domain example.com \
--admin-hostname admin.example.com \
--acme-email postmaster@example.com \
--agree-tos
4. What the Installer Shows at Completion
Once MariaDB, ClamAV, all 14 systemd units (hermex-*), firewall rules, your first domain, and postmaster@example.com are created, install.sh prints three critical blocks:
- The
postmasterpassword (printed only once):
postmaster@example.com password (shown once, stored nowhere): <generated-password>
Save this password immediately in a password manager.
- The full DNS record table (also saved on the server at
/root/hermex-dns-<domain>.txt):
TYPE NAME VALUE
MX example.com 10 mail.example.com
TXT example.com v=spf1 mx ~all
TXT hermex._domainkey.example.com v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0BAQEF...
TXT _dmarc.example.com v=DMARC1; p=quarantine; rua=mailto:postmaster@example.com
TXT default._bimi.example.com v=BIMI1; l=https://example.com/bimi/logo.svg
CNAME autodiscover.example.com mail.example.com
CNAME autoconfig.example.com mail.example.com
SRV _autodiscover._tcp.example.com 0 0 443 mail.example.com
SRV _imaps._tcp.example.com 0 0 993 mail.example.com
SRV _pop3s._tcp.example.com 0 0 995 mail.example.com
SRV _submission._tcp.example.com 0 0 587 mail.example.com
SRV _caldavs._tcp.example.com 0 0 443 mail.example.com
SRV _carddavs._tcp.example.com 0 0 443 mail.example.com
TXT _caldavs._tcp.example.com path=/dav
TXT _carddavs._tcp.example.com path=/dav
SRV _sieve._tcp.example.com 0 0 4190 mail.example.com
SRV _jmap._tcp.example.com 0 0 443 mail.example.com
CNAME admin.example.com mail.example.com
If MTA-STS was enabled, the output also includes:
CNAME mta-sts.example.com mail.example.com
TXT _mta-sts.example.com v=STSv1; id=<policy-id>
TXT _smtp._tls.example.com v=TLSRPTv1; rua=mailto:postmaster@example.com,https://mail.example.com/tlsrpt
- Next steps reminder prompting you to publish DNS records, run
enable-dkim, and back up/etc/hermex/config.json.
5. Publish the DNS Records
Choose your DNS provider instructions below and create every record printed in /root/hermex-dns-<domain>.txt.
- Cloudflare
- Any DNS Provider
- Log in to the Cloudflare Dashboard, select your domain (
example.com), and open DNS -> Records. - Set Proxy status to DNS only (gray cloud) on every mail-related
AandCNAMErecord (mail,admin,autodiscover,autoconfig,mta-sts). Cloudflare's orange proxy breaks SMTP/IMAP/POP3 connections and TLS-ALPN-01 ACME challenges. - Add each record type from
/root/hermex-dns-<domain>.txt:- MX record: Name
@, Mail servermail.example.com, Priority10. - TXT records:
- SPF: Name
@, Contentv=spf1 mx ~all. - DKIM: Name
hermex._domainkey, Contentv=DKIM1; k=rsa; p=...(copy the full line without quotes). - DMARC: Name
_dmarc, Contentv=DMARC1; p=quarantine; rua=mailto:postmaster@example.com. - DAV discovery paths: Name
_caldavs._tcpwith Contentpath=/dav, and Name_carddavs._tcpwith Contentpath=/dav. - If MTA-STS is active: Name
_mta-sts(v=STSv1; id=...) and Name_smtp._tls(v=TLSRPTv1; rua=...).
- SPF: Name
- CNAME records (all DNS only / gray cloud):
autodiscover,autoconfig,admin(andmta-stswhen MTA-STS is enabled) pointing tomail.example.com. If you later add a second domain (other.com), also addCNAME mail.other.com -> mail.example.com. - SRV records: In Cloudflare, select type SRV, fill Name (for example
_imaps._tcp), Priority0, Weight0, Port (993,995,587,443, or4190), and Targetmail.example.com.
- MX record: Name
- Leave BIMI (
default._bimi) optional unless you host a compliant SVG Tiny PS brand logo.
Add each record from /root/hermex-dns-<domain>.txt using your DNS panel's standard form:
- MX record: Host
@(root domain), Priority10, Targetmail.example.com. - TXT records: Add
@(SPF),hermex._domainkey(DKIM),_dmarc(DMARC),_caldavs._tcp(path=/dav),_carddavs._tcp(path=/dav), and optionally_mta-stsand_smtp._tls. Note that some panels strip or keep trailing dots on FQDN targets automatically. - CNAME records: Point
autodiscover,autoconfig,admin, andmta-ststomail.example.com. - SRV records: Create each
_service._tcprecord with Priority0, Weight0, the exact port number from the output table (443,993,995,587, or4190), and Targetmail.example.com. - Disable any HTTP/CDN proxy in front of mail subdomains so Let's Encrypt TLS-ALPN-01 (
443) and direct mail protocols reach your server directly.
6. Enable DKIM and Verify Everything
Once your DKIM TXT record resolves in public DNS (usually within 1 to 2 minutes on Cloudflare), enable DKIM signing and verify DNS, TLS certificates, and daemons on the server:
# Enable DKIM outbound signing once hermex._domainkey resolves
sudo hermex-admin enable-dkim example.com
# Run live DNS diagnostics (MX, SPF, DKIM, DMARC, SRV, MTA-STS)
sudo hermex-admin check-dns example.com
# Verify all 14 daemons are active and healthy
sudo hermex-admin status
# Check issued ACME TLS certificates
sudo hermex-admin list-tls-certs
If you did not enable MTA-STS during installation because mta-sts.example.com did not yet resolve, enable it now after publishing mta-sts.example.com CNAME mail.example.com:
sudo hermex-admin set-mtasts testing
sudo systemctl restart hermex-gateway.service
sudo hermex-admin dns-records example.com
Publish the _mta-sts and _smtp._tls TXT records printed by the final command in your DNS panel.
/etc/hermex/config.json off the server/etc/hermex/config.json contains key_secret, which encrypts all stored DKIM private keys and TLS certificates in MariaDB, as well as the database password. Store an encrypted offline copy of /etc/hermex/config.json immediately.
Next Step
Your server and primary administrator (postmaster@example.com) are live. Continue to Quick Exchange Setup to configure an Organization, domain branding, users, delegates, aliases, mailing lists, meeting rooms, external contacts, and public folders in the Admin Panel.
For scaling across multiple servers with a shared MariaDB cluster, see Multi-Node Installation. To convert an existing single-node deployment to multiple pods and migrate populated mailboxes live, see Single-to-Multi Migration. For Active-Passive failover pods and Expand-and-Contract zero-downtime upgrades, see High Availability, Active-Passive Pods & Rolling Updates.