OwnMaily Docs

Domain and DNS

Going to Production

A domain is required for production use. Without one, email links either point to a bare IP address (which looks suspicious) or to localhost (which breaks entirely). This guide walks through pointing a subdomain to your server.

What you need

  • A domain name you own and have access to the DNS settings for
  • The public IP address of your server

You can use any subdomain - mail.yourdomain.com is the most common choice, but send.yourdomain.com, newsletter.yourdomain.com, or anything else works fine.

Create an A record

Log into your domain registrar or DNS provider (Namecheap, Cloudflare, Route53, etc.) and add an A record pointing your chosen subdomain to your server's IP address.

Here is what the record should look like:

Type:  A
Name:  mail          (or the subdomain you chose)
Value: 1.2.3.4       (your server's IP address)
TTL:   Auto (or 300)

Cloudflare example

  1. Go to your Cloudflare dashboard and select your domain
  2. Click DNS in the left sidebar
  3. Click Add record
  4. Set type to A, name to mail, and IPv4 address to your server IP
  5. Set the proxy status to DNS only (grey cloud, not orange) - the orange proxy will interfere with SSL and direct connections
  6. Save

Namecheap example

  1. Go to Namecheap and select your domain
  2. Click Manage, then Advanced DNS
  3. Under Host Records, click Add New Record
  4. Set type to A Record, host to mail, and IP to your server IP
  5. Save

DNS propagation

After adding the record, it takes some time to propagate across DNS servers worldwide. This is usually a few minutes, but can take up to 48 hours in rare cases.

You can check whether the record has propagated by running this on your local machine:

dig mail.yourdomain.com

When the answer section shows your server IP, you are good to proceed. If it still shows nothing, wait a few minutes and try again.

Update your Installation URL

Once DNS is propagated and your domain resolves to your server, update the Installation URL in OwnMaily to use your domain.

The easiest way is inside the app itself: go to Settings > General and update the Installation URL field to https://mail.yourdomain.com. Save the change and it takes effect immediately - no restart needed.

Use https:// not http:// - even before SSL is set up. OwnMaily will function over HTTP for now, but once SSL is in place you want the stored URL to already be correct.

Alternatively, if you prefer to edit config files directly, you can update the INSTALLATION_URL variable in ~/ownmaily/.env and restart the stack:

cd ~/ownmaily
docker compose up -d

Continue to the SSL guide to complete your production setup.

Tip: If you are using Cloudflare and have the orange cloud proxy enabled, you may run into issues with SSL certificate provisioning. Switch to DNS-only mode (grey cloud) for the subdomain record while setting up OwnMaily. You can re-enable the proxy later if you want Cloudflare's CDN in front.