Issue with setting up Mailgun with Ghost and Digital Ocean

I just created a new site with my custom domain and wanted to set up Mailgun. I keep on following the instructions on how to set it up but then when I try to restart ghost using my ghost-mgr I keep running into the following error.

ghost-mgr@username:/var/www/ghost$ ghost doctor

✔ Checking system Node.js version - found v16.17.0
ℹ Ensuring user is not logged in as ghost user [skipped]
ℹ Checking if logged in user is directory owner [skipped]
✔ Checking current folder permissions
✖ Validating config
✔ Checking content folder ownership
✖ Checking memory availability
✔ Checking binary dependencies
✔ Checking free space
One or more errors occurred.

1) Validating config

Error detected in the production configuration.
Message: Config file is not valid JSON

2) SystemError

Message: You are recommended to have at least 150 MB of memory available for smooth operation. It looks like you have ~70.265625 MB available.

Debug Information:
    OS: Ubuntu, v22.04.1 LTS
    Node Version: v16.17.0
    Ghost Version: 5.25.1
    Ghost-CLI Version: 1.23.1
    Environment: production
    Command: 'ghost doctor'

Try running ghost doctor to check your system for known issues.

You can always refer to for troubleshooting.

My config.production.json file looks like below:

  "mail": {
    "transport": "SMTP",
    "options": {
     "service": "Mailgun",
     "host": "",
     "port": 587,
     "auth": {
     "user": "",
     "pass": "password"

I am not sure how can I fix the error, I keep going back to the config file to try to fix it but I can’t see what the issue is. The information is the same as mailgun.

The error says plainly that your config is not valid JSON. Using an online JSON validator to help spot the error. Make sure to post your entire JSON file there, not just part of it (and obscure your password field like you did here). Here’s one site you can use:

You also don’t have enough memory, so you may need to upgrade the instance size you are renting.

1 Like