Single server (k3s)
The single-server installer turns one Linux machine into a complete RapidMX server with one command. Under the hood it installs k3s, a small Kubernetes distribution, and then the same Helm chart as the Kubernetes option, so you get automatic certificates, Postfix that picks up new domains on its own, and in-place upgrades, without having to run a cluster yourself.
Use it for a rented VPS, a dedicated server or a machine in your office. If you already run Kubernetes, use the Helm chart directly instead.
What you need
- A Debian, Ubuntu or RHEL-family Linux server with
sudoand about 8 GiB of memory - The DNS records from Before you deploy, and ports
25,80and443open - No Docker running on the same server. It conflicts with k3s, and the script stops if it finds it.
What the script installs
In order, and only what isn't already there:
- k3s, without its bundled Traefik. Its admin kubeconfig stays readable by root only; the user who ran the
script gets a private copy in
~/.kube/config. - Helm.
- cert-manager, with Gateway API support, for Let's Encrypt certificates (skipped with
--tls false). - Envoy Gateway, and one shared Gateway with a listener per host name.
- nginx on the host, forwarding ports 80 and 443 to the Gateway with the PROXY protocol, so the server sees each
visitor's real address. Any existing
httpserver block listening on port 80 is commented out, and restored by--uninstall. - OpenBao and External Secrets, which hold the release's secrets and the certificate authority for encrypted
mail (skipped with
--openbao false). See Secrets and OpenBao. - The RapidMX chart, as a release named
rapidmxin the namespacerapidmx, with Postfix answering on port 25 asmail.example.com.
It also opens ports 25, 80, 443 and the TURN ports (3478 TCP and UDP, 5349 TCP, 49152-49252 UDP) in firewalld or ufw
when either is active. It records what it installed in /var/lib/rapidmx-installer/state, so --uninstall removes
only that.
Install
-
Point
mail.example.comandauth.example.comat the server's public address. -
Download the script:
curl -fsSLO https://raw.githubusercontent.com/rapidmx/server/main/single_node_install.shchmod +x single_node_install.sh -
Run it with your domain and an email address for Let's Encrypt:
It takes several minutes and prints each step as it goes.
-
Wait for the final message:
Installation complete.The server is at https://mail.example.com, with sign-in at https://auth.example.com.Postfix listens on port 25 as mail.example.com and knows example.com. Add each domain in the admin console, ... -
Read the
adminaccount's password:kubectl -n rapidmx get secret rapidmx-authserver-service-secrets -o jsonpath='{.data.default_accounts}' \| base64 -d | tr -d '\\' | sed -n 's/.*"password":"\([^"]*\)".*/\1/p' -
Open
https://mail.example.comand continue with First-time setup.
:::tip Good to know
- The certificates are requested during the install and issued once both names point at the server. You can add the
DNS records afterwards;
kubectl -n rapidmx get certificateshows when they're ready. - To try it without a public domain, use a name that ends in
.local, such as--domain example.local. It serves plain HTTP; add both names to your hosts file, as the script reminds you. :::
Options
| Option | What it does |
|---|---|
--domain example.com | Your mail domain (required) |
--email [email protected] | The Let's Encrypt account address (default admin@<domain>) |
--mail-host / --auth-host | Change mail / auth to another label or a whole host name, for example --mail-host webmail |
--mail-domains a.com,b.com | The domains Postfix knows when it starts (default: --domain). Domains you add in the admin console later need no restart or re-run. |
--tls false | No certificates: plain HTTP, for testing |
--openbao false | Keep secrets in Kubernetes Secrets instead of OpenBao |
--gateway shared / --gateway chart | shared (the default): one Gateway made by the script, which the release's routes attach to. chart: the chart makes a Gateway for each of its hosts. |
--version <version> | Install a specific release (default: the release the script was published with) |
--skip-k3s | Use the cluster kubectl already reaches instead of installing k3s |
--uninstall --yes | Remove what the script installed, including the mail data. --uninstall alone removes nothing. See Uninstalling. |
--help | List everything |
Some environment variables change what the script installs:
| Variable | What it does |
|---|---|
CHART | The chart to install (default oci://ghcr.io/rapidmx/charts/server), for example ./helm for a local checkout. --version is ignored then. |
OPENBAO_ADDRESS | An OpenBao this cluster already runs, used instead of installing one |
OPENBAO_VERSION, EXTERNAL_SECRETS_VERSION | The OpenBao chart and External Secrets release to install |
K3S_VERSION, CERT_MANAGER_VERSION, ENVOY_GATEWAY_VERSION | The pinned releases of those components (defaults v1.36.5+k3s1, v1.21.2 and v1.9.1) |
After the install
- Secrets. With OpenBao (the default), the release's secrets live in the vault and upgrades don't need them. The
vault's unseal key and root token are in the
openbao-keysSecret in theopenbaonamespace. Back that Secret up: without it nothing in the vault can be recovered. See Backup and restore. - Without OpenBao, the script prints how to read
global.jwt.secretandglobal.mailIngestSecretback from the cluster. You need them to runhelm upgradeyourself. Re-running the script reuses them automatically. - Re-running the script is safe. It keeps every secret and re-checks nginx, the Gateway and the other pieces, which
makes it a good way to upgrade: run it again with
--version. - More domains. Add them in the admin console and publish the DNS records it shows. Postfix accepts, sends and signs mail for them within seconds.
Next steps
- First-time setup
- Backup and restore
- Video calls: the TURN relay, if people will join calls from restrictive networks