Configure Ghost Mail with Gmail SMTP Server

Sending transactional emails from a self-hosted Ghost instance requires you to configure the mail manually. Transactional emails refer to emails containing password resets, member invitations, signup and login links.

If you have a Gmail account, you can use the Gmail SMTP server for free to send up to 500 emails per day (at the time of writing this article). That's more than enough for most Ghost publications.

Setup an app password in Gmail

You need to generate an "app password" to use the free Gmail SMTP server. Navigate to the "App Passwords" page and follow these steps:

  • enter your password
  • select "Other (Custom name)"
  • enter a name for your app
  • press the button "GENERATE"

The "App Passwords" page in Gmail

Configure Ghost to use the Gmail SMTP server

Once you have the password, navigate to the folder where your Ghost instance lives and open the config.production.json file. Next, add the following piece of code:

"mail": {
    "transport": "SMTP",
    "options": {
      "service": "Google",
      "host": "smtp.gmail.com",
      "port": 587,
      "auth": {
        "user": "<your-email>",
        "pass": "<your-password>"
      }
    }
  },

Don't forget to replace the "user" and "pass" fields with your information. After that, save the file and restart your Ghost instance for the changes to take effect. Use the command ghost restart to restart it.

Ghost folder on DigitalOcean

If you are hosting your Ghost publication on DigitalOcean, you can find the config.production.json file in the /var/www/ghost folder.

Bulk vs transactional emails

It's important to mention that you need different settings and a dedicated email service to send bulk emails. Bulk emails allow you to send newsletter issues to the publication members.

If you want to host your Ghost publication on DigitalOcean, this article will help you get started with Ghost on DigitalOcean droplet.