Skip to main content

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:

  1. A Linux VPS or bare-metal server meeting the requirements below.
  2. A registered domain name (for example example.com).
  3. Access to your DNS provider panel (such as Cloudflare, Hetzner DNS, Route 53, or your domain registrar).

Server Requirements​

ComponentMinimumRecommended
CPU2 vCPU (x86_64 or arm64)4 vCPU
Memory (RAM)4 GB8 GB
Storage20 GB SSD50 GB+ SSD (grows with mailbox data)
IP Address1 static public IPv4 address1 static public IPv4 + PTR (rDNS) matching your hostname
Memory sizing

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)ServiceNotes
25SMTPServer-to-server inbound mail (must not be blocked by your VPS host)
465SMTPSImplicit TLS mail submission
587SMTP SubmissionSTARTTLS authenticated mail submission
110, 995POP3 / POP3SStandard and implicit-TLS POP3
143, 993IMAP / IMAPSSTARTTLS and implicit-TLS IMAP
80, 443HTTP / HTTPSUnified front door (gateway), webmail, EWS, ActiveSync, DAV, JMAP, MTA-STS, ACME
4190ManageSieveServer-side filter management
Check outbound and inbound port 25

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 (making mail.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 (making admin.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:

  1. First mail domain (empty to skip) [example.com]: Enter the primary domain that will host email accounts (press Enter to accept example.com).
  2. 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 example admin.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).
  3. 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.
  4. Accept the Let's Encrypt terms (https://letsencrypt.org/repository/)? yes/no [no]: Type yes and press Enter to enable automatic ACME TLS certificates (requires mail.example.com to already resolve to this server).
  5. Publish MTA-STS in testing mode for example.com? yes/no [no]: Type yes if mta-sts.example.com already resolves to this server, or leave no and enable MTA-STS after publishing your DNS records.
Non-interactive installation

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:

  1. The postmaster password (printed only once):
postmaster@example.com password (shown once, stored nowhere): <generated-password>

Save this password immediately in a password manager.

  1. 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
  1. 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.

  1. Log in to the Cloudflare Dashboard, select your domain (example.com), and open DNS -> Records.
  2. Set Proxy status to DNS only (gray cloud) on every mail-related A and CNAME record (mail, admin, autodiscover, autoconfig, mta-sts). Cloudflare's orange proxy breaks SMTP/IMAP/POP3 connections and TLS-ALPN-01 ACME challenges.
  3. Add each record type from /root/hermex-dns-<domain>.txt:
    • MX record: Name @, Mail server mail.example.com, Priority 10.
    • TXT records:
      • SPF: Name @, Content v=spf1 mx ~all.
      • DKIM: Name hermex._domainkey, Content v=DKIM1; k=rsa; p=... (copy the full line without quotes).
      • DMARC: Name _dmarc, Content v=DMARC1; p=quarantine; rua=mailto:postmaster@example.com.
      • DAV discovery paths: Name _caldavs._tcp with Content path=/dav, and Name _carddavs._tcp with Content path=/dav.
      • If MTA-STS is active: Name _mta-sts (v=STSv1; id=...) and Name _smtp._tls (v=TLSRPTv1; rua=...).
    • CNAME records (all DNS only / gray cloud): autodiscover, autoconfig, admin (and mta-sts when MTA-STS is enabled) pointing to mail.example.com. If you later add a second domain (other.com), also add CNAME mail.other.com -> mail.example.com.
    • SRV records: In Cloudflare, select type SRV, fill Name (for example _imaps._tcp), Priority 0, Weight 0, Port (993, 995, 587, 443, or 4190), and Target mail.example.com.
  4. Leave BIMI (default._bimi) optional unless you host a compliant SVG Tiny PS brand logo.

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.

Back up /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.