# SMTP configuration for docker container

**URL:** <https://community.grafana.com/t/smtp-configuration-for-docker-container/16370>\
**Category:** Configuration\
**Tags:** docker\
**Created:** [April 15, 2019, 8:36am UTC](https://community.grafana.com/t/smtp-configuration-for-docker-container/16370 "2019-04-15T08:36:34Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![maxwebbi](https://avatars.discourse-cdn.com/v4/letter/m/f0a364/32.png) [@maxwebbi](https://community.grafana.com/u/maxwebbi)\
**Post date:** [April 15, 2019, 8:36am UTC](https://community.grafana.com/t/smtp-configuration-for-docker-container/16370/1 "2019-04-15T08:36:34Z")

</div>

Hi,  
i’m running grafana in a docker container on my raspberry pi 3+ with the grafana/grafana-arm32v7-linux image. So far, so good. Now I want to use the alert system for sending an e-mail when there’s something wrong. For this setup I know i need to configure the SMTP in grafana. How can I do it? I think I have to edit the .ini file but I’m not sure how does that work in a docker container.

---

<div class="post-metadata">

**Author:** ![endersonmaia](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/endersonmaia/32/6056_2.png) [@endersonmaia](https://community.grafana.com/u/endersonmaia)\
**Post date:** [April 15, 2019, 12:42pm UTC](https://community.grafana.com/t/smtp-configuration-for-docker-container/16370/2 "2019-04-15T12:42:23Z")

</div>

If you’re working with containers you can set the `.ini` via docker volume mapping our you can set the environment variables that maps to `.ini` parameters.

- [https://grafana.com/docs/installation/configuration/#using-environment-variables](https://grafana.com/docs/installation/configuration/#using-environment-variables)
- [https://grafana.com/docs/installation/docker/#default-paths](https://grafana.com/docs/installation/docker/#default-paths)

If you can’t configure via volume, you can set the environment variables like this :

```auto
docker run \
  -d \
  -p 3000:3000 \
  --name grafana \
  -e "GF_SMTP_ENABLED=true" \
  -e "GF_SMTP_HOST=smtp.example.com" \
  -e "GF_SMTP_USER=myuser" \
  -e "GF_SMTP_PASSWORD=mysecret" \
  grafana/grafana:5.1.0

```

Take a look ate docker documentation about environment variables and volumes.

- [https://docs.docker.com/engine/reference/run/#env-environment-variables](https://docs.docker.com/engine/reference/run/#env-environment-variables)
- [https://docs.docker.com/storage/volumes/](https://docs.docker.com/storage/volumes/)

---

<div class="post-metadata">

**Author:** ![svetb](https://sea2.discourse-cdn.com/grafana/user_avatar/community.grafana.com/svetb/32/3307_2.png) [@svetb](https://community.grafana.com/u/svetb)\
**Post date:** [April 28, 2021, 3:06pm UTC](https://community.grafana.com/t/smtp-configuration-for-docker-container/16370/4 "2021-04-28T15:06:05Z")

</div>

> **[Configuration](https://grafana.com/docs/grafana/next/administration/configuration/#configure-with-environment-variables)**
>
> Configuration documentation
