# Failed to send magic link email - running in Docker

**URL:** <https://forum.ghost.org/t/failed-to-send-magic-link-email-running-in-docker/36586>\
**Category:** Self-hosting\
**Created:** [February 22, 2023, 2:22am UTC](https://forum.ghost.org/t/failed-to-send-magic-link-email-running-in-docker/36586 "2023-02-22T02:22:17Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![zs450](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/zs450/32/23233_2.png) [@zs450](https://forum.ghost.org/u/zs450)\
**Post date:** [February 22, 2023, 2:22am UTC](https://forum.ghost.org/t/failed-to-send-magic-link-email-running-in-docker/36586/1 "2023-02-22T02:22:18Z")

</div>

I’ve set up Ghost in Docker on a Synology NAS.

I’ve set up a Mailgun account and added the private API Key to my Ghost instance.

When I attempt to register I get the “Failed to send magic link email” error.

I’ve seen comments referring suggesting to add the mailgun configuration to my docker-compose.yml and either I don’t have one or I’m not looking in the correct place for it.

At this point I’m not sure how to find the file that I need to modify to add my mailgun settings. Any help would be appreciated.

---

<div class="post-metadata">

**Author:** ![mjw](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/mjw/32/30781_2.png) [@mjw](https://forum.ghost.org/u/mjw)\
**Post date:** [February 22, 2023, 9:52am UTC](https://forum.ghost.org/t/failed-to-send-magic-link-email-running-in-docker/36586/2 "2023-02-22T09:52:04Z")

</div>

The API is used for bulk email whereas transactional email uses SMTP. Therefore, set up email in your config.production.json, most likely using Docker environment variables, and be sure that port 587 (ideally) or 465 are open for relaying email.

---

<div class="post-metadata">

**Author:** ![markstos](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/markstos/32/18182_2.png) [@markstos](https://forum.ghost.org/u/markstos)\
**Post date:** [February 22, 2023, 11:44am UTC](https://forum.ghost.org/t/failed-to-send-magic-link-email-running-in-docker/36586/3 "2023-02-22T11:44:52Z")

</div>

Search the forum for Mailgun SMTP to see how to also use Mailgun for transactional emails.
