Configure how your AgenticMail Enterprise instance is accessed on the internet — subdomains, custom domains, CORS, tunnels, and migration.
For everyone: This page controls how people reach your AgenticMail dashboard. By default, it runs on your local machine (localhost). To let your team and agents access it from anywhere, you can set up a free subdomain (yourcompany.agenticmail.io), connect your own custom domain (agents.yourcompany.com), or deploy via a Cloudflare Tunnel.
For technical users: The Domain & Deployment page manages DNS registration/verification, subdomain allocation on agenticmail.io, CORS origin policies, Cloudflare Tunnel lifecycle, and deployment key issuance for disaster recovery. The page queries /domain/status, /domain/cors, and /tunnel/status on load and provides forms for domain registration, subdomain changes, and tunnel management.
| Status | Meaning |
|---|---|
| verified | Domain ownership confirmed. Ready for use. |
| pending_dns | Waiting for DNS records to propagate and verify. |
| not configured | No custom domain set up. |
| Type | Example | DNS Record | Notes |
|---|---|---|---|
| Subdomain | agents.yourcompany.com | CNAME | Recommended — easier setup, doesn't affect main site. |
| Root/Apex | yourcompany.com | A record | Entire domain dedicated to AgenticMail. Requires A record (most providers don't support CNAME at apex). |
Shows the URL you're currently accessing the dashboard from (window.location.origin). This is the URL your team uses. If it shows localhost, the instance is only accessible from your machine.
A free subdomain on agenticmail.io — for example, yourcompany.agenticmail.io. This gives you a public URL without needing your own domain.
Click "Change" to update. Validation rules:
Use your own domain for a professional, branded deployment.
agents.yourcompany.com (just the domain, not a URL).agents.yourcompany.com instead of the root domain — it's easier to set up and doesn't affect your main website.
After registering a domain, you need to add two DNS records:
| Field | Value |
|---|---|
| Type | TXT |
| Host / Name | _agenticmail-verify.yourdomain.com |
| Value | The challenge string shown in the dashboard |
For subdomains (CNAME):
| Field | Value |
|---|---|
| Type | CNAME |
| Host / Name | Your domain |
| Value | yoursubdomain.agenticmail.io or your server hostname |
For root domains (A Record):
| Field | Value |
|---|---|
| Type | A |
| Host / Name | Your domain (or @) |
| Value | Your server's IP address |
The deployment section offers five methods to expose your local instance to the internet:
| Method | Difficulty | Description |
|---|---|---|
| Cloudflare Tunnel Recommended | Easy | Keep running locally, securely exposed via your domain. No port forwarding needed. Automatic HTTPS. |
| VPS / Server | Easy | Deploy to DigitalOcean, Hetzner, AWS, or any Linux server. |
| Docker | Medium | Run as a Docker container on any host. |
| Railway | Easy | One-click deploy to Railway.app. |
| Fly.io | Medium | Deploy to Fly.io edge network. |
The recommended method. Your app stays on your machine; Cloudflare Tunnel creates a secure connection to their network. Steps:
CORS (Cross-Origin Resource Sharing) controls which websites can make API requests to your server.
CORS is auto-updated when you change your subdomain or custom domain. For manual control, go to Settings → Network & Firewall.
After registering a domain, a deployment key is shown once. This key is required to recover your domain if you migrate to a new server.
Recovery command:
npx @agenticmail/enterprise recover --domain your.domain.com
To move your entire deployment to a new machine:
~/.agenticmail/.env from the old machine (contains DATABASE_URL, JWT_SECRET, VAULT_KEY, PORT).mkdir -p ~/.agenticmail~/.agenticmail/.env~/.agenticmail/branding/ folder if you have custom branding (logo, favicon, login background).npx @agenticmail/enterprise@latest startcloudflared tunnel login on the new machine, then redeploy from the dashboard.VAULT_KEY, encrypted credentials (agent email passwords, API keys) cannot be decrypted. You would need to re-enter them.
| Purpose | Command |
|---|---|
| Initial setup | npx @agenticmail/enterprise setup |
| Start server | npx @agenticmail/enterprise start |
| Verify DNS | npx @agenticmail/enterprise verify-domain |
| Recover on new server | npx @agenticmail/enterprise recover --domain your.domain.com |
| Method | Endpoint | Description |
|---|---|---|
| GET | /domain/status | Get domain registration and verification status |
| POST | /domain/register | Register a new custom domain |
| POST | /domain/change | Change to a different custom domain |
| POST | /domain/verify | Check DNS verification status |
| DELETE | /domain | Remove custom domain |
| POST | /domain/subdomain | Set/change agenticmail.io subdomain |
| GET | /domain/cors | Get CORS allowed origins |
| GET | /tunnel/status | Cloudflare Tunnel status |
| POST | /tunnel/install | Install cloudflared |
| POST | /tunnel/stop | Stop running tunnel |
| Variable | Purpose |
|---|---|
DATABASE_URL | Database connection — all data lives here |
JWT_SECRET | Keeps login sessions valid across restarts |
AGENTICMAIL_VAULT_KEY | Decrypts stored credentials |
PORT | Server port (default: 3200) |
TRANSPORT_ENCRYPTION_KEY | Custom key for API transport encryption. If not set, falls back to ENCRYPTION_KEY, then JWT_SECRET. Used to encrypt all API responses in transit (dashboard ↔ server). |
ENCRYPTION_KEY | General-purpose encryption key. Used as fallback for transport encryption if TRANSPORT_ENCRYPTION_KEY is not set. |
TRANSPORT_ENCRYPTION_KEY → ENCRYPTION_KEY → JWT_SECRET (in order of priority). SSE/EventSource streams are excluded automatically since they cannot send custom headers.
agents.yourcompany.com is easier to set up than a root domain.dig or nslookup to verify records before clicking "Verify DNS Now."DNS propagation can take up to 48 hours. Verify your records are correct with dig TXT _agenticmail-verify.yourdomain.com. Ensure there are no typos in the challenge value.
After changing the subdomain, you must update DNS to point the new subdomain to your server, then access the dashboard from the new URL. The old URL will stop working.
Ensure cloudflared is installed and logged in (cloudflared tunnel login). Check that the configured port matches your server's actual port. Review cloudflared logs for errors.
Add your dashboard URL to the allowed origins in Settings → Network & Firewall. CORS is auto-updated when you change subdomain/domain, but manual additions may be needed for custom setups.
Don't include https:// — enter only the domain (e.g., agents.yourcompany.com).
If you've lost the deployment key and need to recover, contact support. As a workaround, you can remove the domain and re-register it, but you'll need to update DNS records again.