Claude Code, Cursor, Codex or any coding agent with shell access can install mailrust on your server for you. It runs the same installer you would and gives you the first-run link at the end.
Paste this into your agent
Replace the server and the domain with yours.
Install mailrust on my server: ssh root@SERVER_IP. The mail address will be mail.example.com, its DNS A record points to the server. Follow https://mailrust.com/docs/getting-started/agent-install.md step by step and give me the first-run link at the end.
Without a domain, say so: mailrust will run behind your web server instead.
Steps for the agent
- Check the server.
uname -mprintsx86_64,systemctl --versionworks, and you are root (id -uprints0). - Pick the mode.
- Nothing listens on ports 80 and 443 (
ss -tlnp | grep -E ':(80|443) 'prints nothing) and the person gave a domain whose A record points to this server: HTTPS by itself. - nginx, Caddy or a hosting panel already uses those ports: behind the web server.
- Nothing listens on ports 80 and 443 (
- Install.
- HTTPS by itself:
curl -fsSL https://mailrust.com/install.sh | sh -s -- --domain mail.example.com --email you@example.com - Behind the web server:
Then proxy the domain tocurl -fsSL https://mailrust.com/install.sh | sh127.0.0.1:8420, keeping theHostheader and the client's address. Examples for nginx and Caddy: HTTPS and proxies.
- HTTPS by itself:
- Check.
systemctl is-active mailrustprintsactive.curl -fsS -o /dev/null https://mail.example.com/loginsucceeds (behind a web server, checkhttp://127.0.0.1:8420/loginfirst). - Hand over the first-run link. Run
sudo -u mailrust mailrust setup-linkand give the link to the person. They open it in the browser and create the administrator: do not open it yourself.
What the agent must not do on its own
- Change DNS records, open firewall ports or restart other services: ask the person first. With HTTPS by itself, ports 80 and 443 must be open in the firewall (ufw, firewalld, the provider's panel).
- Install over an existing mailrust without asking: running the installer again updates the program and keeps the data, which is safe, but the person should know.
After the install
- Connect a mailbox: Connect a mailbox.
- Let the agent work with the mail over MCP: AI agents.
- Update later with
sudo mailrust update: Updates.
If something fails
- No certificate. The A record does not point here yet, or port 80 is closed. Look at
journalctl -u mailrust -n 50. - Port already in use. Install behind the web server instead.
- Anything else: Troubleshooting.