# 哪些环境变量是必需的？

**URL:** <https://meta.discourse.org/t/which-environment-variables-are-mandatory/201575>\
**Category:** Self-hosting\
**Tags:** unsupported-install\
**Created:** [2021年八月24日 18:38 UTC](https://meta.discourse.org/t/which-environment-variables-are-mandatory/201575 "2021-08-24T18:38:53Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![tom-richter](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/tom-richter/32/232089_2.png) [@tom-richter](https://meta.discourse.org/u/tom-richter)\
**Post date:** [2021年八月24日 18:38 UTC](https://meta.discourse.org/t/which-environment-variables-are-mandatory/201575/1 "2021-08-24T18:38:54Z")

</div>

你好，我想在 [render.com](http://render.com) 上部署 Discourse：[https://render.com/docs/deploy-discourse。我想知道哪些环境变量是必须的。](https://render.com/docs/deploy-discourse%E3%80%82%E6%88%91%E6%83%B3%E7%9F%A5%E9%81%93%E5%93%AA%E4%BA%9B%E7%8E%AF%E5%A2%83%E5%8F%98%E9%87%8F%E6%98%AF%E5%BF%85%E9%A1%BB%E7%9A%84%E3%80%82)

我是否需要设置 SMTP 相关变量，如 DISCOURSE\_SMTP\_ADDRESS、DISCOURSE\_SMTP\_DOMAIN、DISCOURSE\_SMTP\_PASSWORD、DISCOURSE\_SMTP\_PORT 或 DISCOURSE\_SMTP\_USER\_NAME？

如果我只设置了 `DISCOURSE_ADMIN_EMAIL=info@mydomain.com`、`CUSTOM_DOMAIN=forum.mydomain.com` 和 `DISCOURSE_ADMIN_PASSWORD`，就会收到以下错误：

```plaintext
Delivered mail topic/12@forum.mydomain.com (48.6ms)
Job exception: Broken pipe

```

看起来 Discourse 尝试向一个不存在的邮箱地址 `topic/12@forum.foodplanet.info` 发送邮件。这是否意味着 SMTP 环境变量是必需的？`topic/12` 这个名称是从哪里来的？

---

<div class="post-metadata">

**Author:** ![jomaxro](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/jomaxro/32/126216_2.png) [@jomaxro](https://meta.discourse.org/u/jomaxro)\
**Post date:** [2021年八月24日 18:40 UTC](https://meta.discourse.org/t/which-environment-variables-are-mandatory/201575/2 "2021-08-24T18:40:32Z")

</div>

嗨，Tom，是的，SMTP 变量是必需的，因为 Discourse 需要发件邮箱才能正常运行。

---

<div class="post-metadata">

**Author:** ![Falco](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/falco/32/179432_2.png) [@Falco](https://meta.discourse.org/u/Falco)\
**Post date:** [2021年八月24日 18:43 UTC](https://meta.discourse.org/t/which-environment-variables-are-mandatory/201575/3 "2021-08-24T18:43:44Z")

</div>

Render 安装由其团队提供支持，您可以通过以下方式联系他们：

> [@Discourse One-Click Self-Hosting: Quicker and Easier than Official Install](https://meta.discourse.org/t/discourse-one-click-self-hosting-quicker-and-easier-than-official-install/184873/4?u=falco):
>
> @justin Render will continue to provide full support for this install method. Users can email [support@render.com](mailto:support@render.com) or post in our Discourse community at [https://community.render.com](https://community.render.com). @Falco the price can technically be lower if you select smaller plans for the individual components, but we’ve found that the suggested setup is the lowest price for a production-ready, hassle-free Discourse experience.
