/mailgun, ghost, email

Configure Mailgun on self hosted Ghost blog

Mailgun is a fantastic, free service which allows you to send, receive and track emails effortlessly. It's dead easy to integrate with your self hosted Ghost blog.

Mailgun configuration

  1. Log in to your Mailgun account.
  2. Go to "Domains" section.
  3. Click on "Add New Domain" and add a subdomain you want to send emails from.
  4. Follow on page instructions to add all the DNS entries.
  5. Once DNS changes propagate, verify your domain within Mailgun.

Ghost configuration

  1. SSH to your server and edit config.production.json file in your Ghost root directory.
    Your "mail" section should look like this:
      "mail": {
        "transport": "SMTP",
        "options": {
          "service": "Mailgun",
          "host": "smtp.eu.mailgun.org",
          "auth": {
            "user": "postmaster@your_domain.com",
            "pass": "1234567890"
    Notice host entry within options. Official Ghost documentation does not mention it. If your Mailgun domain is set up in the US region, you don't need that line. However, if you've set up your domain in the EU region, you'll need to add it in. Otherwise you'll get an error that your username and password were not recognised.
  2. Save changes and restart Ghost.
    ghost restart
  3. Log in to your Ghost admin.
  4. Go to "Labs".
  5. Click "Send" in "Test email configuration" section.
    The "Send" button should turn green and you should receive a test email confirming your configuration works.