# How to add mail into docker compose ghost

**URL:** <https://forum.ghost.org/t/how-to-add-mail-into-docker-compose-ghost/48533>\
**Category:** Self-hosting\
**Created:** [July 1, 2024, 6:16pm UTC](https://forum.ghost.org/t/how-to-add-mail-into-docker-compose-ghost/48533 "2024-07-01T18:16:53Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![karlo\_nwilhelm](https://avatars.discourse-cdn.com/v4/letter/k/5f9b8f/32.png) [@karlo\_nwilhelm](https://forum.ghost.org/u/karlo_nwilhelm)\
**Post date:** [July 1, 2024, 6:16pm UTC](https://forum.ghost.org/t/how-to-add-mail-into-docker-compose-ghost/48533/1 "2024-07-01T18:16:53Z")

</div>

How do I configure mail, transport, mail options, etc in docker compose?  
It’s my first time using it so I need some help.

Basically how to add this into docker compose:  
“mail”: {  
“transport”: “SMTP”,  
“options”: {  
“service”: “Mailgun”,  
“auth”: {  
“user”: “[no-reply@google.com](mailto:no-reply@google.com)”,  
“pass”: “12312312312123”  
}  
}  
},

---

<div class="post-metadata">

**Author:** ![jannis](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/jannis/32/39718_2.png) [@jannis](https://forum.ghost.org/u/jannis)\
**Post date:** [July 1, 2024, 7:03pm UTC](https://forum.ghost.org/t/how-to-add-mail-into-docker-compose-ghost/48533/2 "2024-07-01T19:03:35Z")

</div>

The most common approach is setting them as environment variables:

> **[Configuration - Adapt your publication to suit your needs](https://ghost.org/docs/config/#running-ghost-with-config-env-variables)**
>
> Find out how to configure your Ghost publication or override Ghost's default behaviour with robust config options, including mail, storage, scheduling and more!

Based on your example, it would look like this:

```auto
mail__transport=SMTP
mail __options__ service=Mailgun
mail __options__ auth__user=no-reply@google.com
mail __options__ auth__pass=12312312312123
```
