# Want to change SMTP Server hosted in a Docker Container

**URL:** <https://forum.ghost.org/t/want-to-change-smtp-server-hosted-in-a-docker-container/29973>\
**Category:** Self-hosting\
**Created:** [May 6, 2022, 6:12am UTC](https://forum.ghost.org/t/want-to-change-smtp-server-hosted-in-a-docker-container/29973 "2022-05-06T06:12:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Lakshmi\_Narasimman\_V](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lakshmi_narasimman_v/32/17605_2.png) [@Lakshmi\_Narasimman\_V](https://forum.ghost.org/u/Lakshmi_Narasimman_V)\
**Post date:** [May 6, 2022, 6:12am UTC](https://forum.ghost.org/t/want-to-change-smtp-server-hosted-in-a-docker-container/29973/1 "2022-05-06T06:12:50Z")

</div>

I have hosted my Ghost Site in a Docker container. How can I change the SMTP server settings? I’m using Elastic Email.

---

<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:** [May 6, 2022, 8:55am UTC](https://forum.ghost.org/t/want-to-change-smtp-server-hosted-in-a-docker-container/29973/2 "2022-05-06T08:55:22Z")

</div>

Edit `config.production.json` and enter the credentials.

I assume you know how to connect into your ghost docker, and have the following information to hand to populate the settings.

```auto
   "mail": {
      "transport": "SMTP",
      "options": {
         "service": "",
         "host": “",
         "port": ,
         "secureConnection": true,
         "auth": {
            "user": "",
            "pass": ""
         }
      }
   }
   ,

```

---

<div class="post-metadata">

**Author:** ![Lakshmi\_Narasimman\_V](https://sea1.discourse-cdn.com/flex015/user_avatar/forum.ghost.org/lakshmi_narasimman_v/32/17605_2.png) [@Lakshmi\_Narasimman\_V](https://forum.ghost.org/u/Lakshmi_Narasimman_V)\
**Post date:** [May 6, 2022, 2:02pm UTC](https://forum.ghost.org/t/want-to-change-smtp-server-hosted-in-a-docker-container/29973/3 "2022-05-06T14:02:08Z")

</div>

I’ve already tried this, nothing happened. I changed the configuration file, saved and ran `ghost-cli restart`, but I get an error that, I need to be a non root user. When I created a non root user and run this command, it throws another error, like `An error occurred. Message: 'EACCES: permission denied, open '/var/lib/ghost/.ghostpid''`. When i restart the container, everything is gone. i have persistant storage as well.
