Skip to content

Using "Free" Mailgun with self-hosted Ghost

Jason Kratz
Jason Kratz
1 min read

Just a couple of notes about setting up a Mailgun pay-as-you-go account to use with a self-hosted Ghost setup for things I ran into that weren't obvious to me.

Make sure to sign up for the Foundation trial for Mailgun

This lets you add a a credit card for billing and set up your own domain for sending emails. The trial is 30 days and you'll downgrade it later.

There is an option to not add a credit card at sign-up time. This only allows using a "sandbox domain" which is for testing only and only allows 5 recipients that you have to add manually.

There is no way to add a credit card to turn this into their pay-as-you-go plan. The only way is to upgrade to the Foundation plan which won't have a 30-day trial at that point and you'll pay a pro-rated amount.

Create your own domain

As noted above for Mailgun to work with Ghost seamlessly you'll need to add your own domain to the Foundation trial. Once you set this up you can send as many emails you want to as many people as you want. There may be some initial limitations while things ramp up as bulk email services like Mailgun need to make sure they're not sending out spam emails which has a negative effect on their reputation with email providers.

Transactional vs bulk emails

Transactional emails are things like the verification links that get sent out when someone signs up for your newsletter and bulk email would be the actual newsletters themselves. These are handled a bit differently in the Ghost configuration.

Bulk email settings are best set up using the Ghost admin page in the settings section under "Mailgun settings". Once you've configured your domain in Mailgun you would use the domain you set up there as well as create an API key and these values are plugged into the Mailgun settings section.

Transactional email setup depends on how you're hosting Ghost but it can either be configured via the config json file or environment variables. See here in the Ghost docs and here for an actual Mailgun example (thanks Robert!).

ghostblogging

Related Posts

Ulysses notes: Dealing with sheet dates

I use Ulysses to do most my writing, and as much as I like the user interface it has a tendency to bury things in odd ways. One example: how to display the various dates related to a sheet (i.e. created, modified, published). Thankfully, while searching for something else

♟ Back in the game...again...

In which Jason gives the whole blogging thing another go...

♟ Back in the game...again...

iA Writer and Ghost: setting the title on publish

I ran across something I wanted to share about using iA Writer's built-in Ghost publishing. I found out that while Writer's publishing to Ghost is pretty bare bones it does support setting the title of the post multiple ways: 1. The title can be set by

iA Writer and Ghost logo