# 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:** 1\
**Showing post:** 2

<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/)

---

_[View the full topic](https://community.grafana.com/t/smtp-configuration-for-docker-container/16370)._
