Ghost Email Setup: SMTP, Mailgun and DNS Records

Ghost sends two kinds of email, and they are set up in two different places. Transactional mail, such as member sign-in links and staff invitations, goes through any SMTP server. Newsletters go through Mailgun. Neither is included in a Hosting for Ghost plan, so this is the first thing to arrange after the site is running. This guide covers both, the DNS records that help mail arrive, and what to check when it does not.

What needs email, and what does not

FeatureNeeds SMTPNeeds Mailgun
Member sign-in links (magic links)YesNo
Staff invitationsYesNo
Password resetsYesNo
New-device codes for staffYes, when staff device verification is onNo
Newsletters to membersNoYes
Publishing posts to the websiteNoNo
Staff signing in with a passwordNoNo

The consequence is simple. With no email at all, the site works, staff can sign in with a password, and visitors can read everything public. What stops working is anything that depends on a message arriving. A site that lets members sign up but cannot mail them a link is a trap for your readers, so either add SMTP or close sign-up until you have.

Step 1: Choose an SMTP provider

Any SMTP service will do for transactional mail, and volumes are small: one message per sign-in, invitation or reset. When you choose, check three things: it supports port 587 with STARTTLS, port 465 with TLS or port 2525; it lets you send from your own domain; and it gives you DNS records to prove that domain is yours. Provider prices and free allowances change, so compare current offers rather than relying on a figure from us.

Step 2: Add the settings to the site

Ghost reads its mail configuration from environment settings. On a Hosting for Ghost server they go in the panel's Deployment Settings, and on a self-built Compose file they go under environment. The names are the same either way:

  • mail__transport, set to SMTP
  • mail__from, the address that appears as the sender, on your own domain
  • mail__options__host and mail__options__port, from your provider
  • mail__options__secure, true for port 465 and false for 587 or 2525
  • mail__options__auth__user and mail__options__auth__pass, your credentials

Our image adds two protections here. Mail is encrypted or it is not sent: if you use SMTP without the secure flag, the image requires STARTTLS, so a server that does not offer it receives nothing rather than your password in clear text. And staff device verification, the emailed code on a new device, is turned on when SMTP is configured and off when it is not, so an owner is never locked out for want of a mail server. After you change the settings, the site restarts to pick them up.

Step 3: Publish the DNS records

Mail from a domain you own should prove it is legitimate. Three DNS record types do that, and your email provider gives you the exact values; copy them, do not invent them.

SPF

A TXT record that lists which servers may send mail for your domain. If the sending server is not on the list, a receiving server has grounds to distrust the message.

DKIM

A signature. Your provider signs each message with a private key, and you publish the matching public key in DNS. A receiver checks the signature to confirm the message was not altered and really came from your domain.

DMARC

A policy that tells receivers what to do when SPF or DKIM fails: nothing, quarantine, or reject. Many people start with a monitoring-only policy and tighten it once they know all their legitimate mail passes.

These records live at your DNS provider, the same place where you will later add a record for your domain, as described in the custom domain guide. Your email provider usually shows a verified status when it can see them. Wait for it before you send a real message.

Step 4: Send a test

Invite a second staff user or request a member sign-in link to your own address. Look in the inbox and the spam folder. If the message arrives and is not marked as suspicious, the transactional side is done. If the panel's Ghost tools show a warning such as mail-not-configured or members-signup-without-mail, the settings are missing or sign-up is open without a way to send links. Fix the settings or turn sign-up off with the "who may sign up" tool.

Step 5: Add Mailgun for newsletters

Newsletters are bulk mail, and Mailgun is the only bulk provider Ghost supports. Plain SMTP cannot send them. Enter your account when you deploy, in Deployment Settings, or in Ghost Admin. What Deployment Settings say wins over Ghost Admin:

  1. Create a Mailgun account and add a sending domain you own.
  2. Publish the DNS records Mailgun shows you and wait until it reports the domain as verified.
  3. Enter the Mailgun domain, region and API key in Deployment Settings, or in the email newsletter settings of Ghost Admin.
  4. Send a first newsletter to a small test segment before the full list.

Menu names and positions change between Ghost releases, so follow the current Ghost documentation for the exact path. Mailgun's sandbox domain is limited in daily volume and is meant for testing. A real list needs a verified domain, and the price depends on your list size, so check Mailgun's current pricing. The budget side is in the cost guide.

Troubleshooting

No mail arrives at all

Check the sender first: mail__from should be an address on a domain your provider has verified. Then check the host, port and credentials. Then check the port: some servers and networks block outbound mail ports, and port 25 is warned about for good reason. Switch to 587, 465 or 2525.

The SMTP server gets nothing and no error appears

If the provider does not offer STARTTLS on the port, the image refuses to send unencrypted. Use a port that offers encryption, or set the secure flag for port 465.

Mail arrives in spam

Recheck the records. SPF, DKIM and DMARC missing or mismatched are the usual cause. Send from an address on the domain that carries them, not from a free mailbox address.

Members cannot sign in

Confirm that SMTP works with a staff invitation, then confirm the site address is right. Sign-in links are built from the site's address, which changes when you add a custom domain. If you have not finished that, see the custom domain guide.

Newsletters do not send

That is a Mailgun problem, not an SMTP one. Check that the Mailgun domain is verified, the region and API key are correct, and the account is not still in sandbox limits.

Where to go next

If you are still choosing a setup, how to self-host Ghost shows the same mail variables in a Compose file, and the section home lists the plans. The sizing page, Ghost server requirements, explains why mail is not part of any plan.

See the plans for Hosting for Ghost on Flux.

Frequently Asked Questions

Does Ghost work without any email setup?

The site works and staff can sign in with a password. What does not work is anything that depends on mail: members cannot receive sign-in links, and invitations and password resets cannot be sent. If you have no email set up, close member sign-up or keep Ghost as a staff-only site.

Why do I need both SMTP and Mailgun?

They do different jobs. Transactional mail (sign-in links, staff invitations, password resets, new-device codes) goes through any SMTP server. Newsletters are bulk mail, and Mailgun is the only bulk provider Ghost supports, so plain SMTP cannot send them.

Which SMTP ports can I use?

Port 587 with STARTTLS, port 465 with TLS, or port 2525. Port 25 is not a good choice, and our image logs a warning about it. Some providers block outbound ports, so check that yours allows the one you pick.

Why does my SMTP server get nothing?

On our image, mail is sent encrypted or not at all. If the server does not offer STARTTLS on the port you chose, the message is refused rather than sent in clear text with your password. Use a port and provider that offer encryption.

Are SPF, DKIM and DMARC required?

Technically no, but without them large mailbox providers are more likely to place your mail in spam or reject it. Your email provider tells you the exact records to publish.

Where do I add Mailgun?

When you deploy, later in Deployment Settings, or in the email newsletter settings of Ghost Admin. What Deployment Settings say wins over Ghost Admin.

Ghost is a trademark of Ghost Foundation (https://ghost.org). Flux is not affiliated with or endorsed by Ghost Foundation.

Hosting for Ghost on the decentralized cloud

Dedicated resources, a synced MySQL database, HTTPS and your own domain. From $6.99/month.

Hosting for Ghost on Flux

Publish. Email. Earn. On your own site.

A product of Flux

Ghost is a trademark of Ghost Foundation (https://ghost.org). Flux is not affiliated with or endorsed by Ghost Foundation.

© 2026 InFlux Technologies. All rights reserved. v1.20.0