# Setting up Let's Encrypt for multisite

**URL:** <https://meta.discourse.org/t/setting-up-lets-encrypt-for-multisite/44980>\
**Category:** Self-hosting\
**Created:** [19 במאי,‏ 2016,‏ 5:13pm UTC](https://meta.discourse.org/t/setting-up-lets-encrypt-for-multisite/44980 "2016-05-19T17:13:47Z")\
**Posts on this page:** 1\
**Showing post:** 10

<div class="post-metadata">

**Author:** ![fuerst](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fuerst/32/120729_2.png) [@fuerst](https://meta.discourse.org/u/fuerst)\
**Post date:** [17 ביוני,‏ 2016,‏ 9:35am UTC](https://meta.discourse.org/t/setting-up-lets-encrypt-for-multisite/44980/10 "2016-06-17T09:35:42Z")

</div>

I recommend using [Nginx Proxy](https://github.com/jwilder/nginx-proxy) together with the [LetsEncrypt companion container for nginx-proxy](https://github.com/JrCs/docker-letsencrypt-nginx-proxy-companion). This setup allows me to run many containerized web apps at ports 80 or 443 as well as automatic certificate renewal.

Besides starting both containers the only configuration you need is to add 3 environment variables to a Docker container. Example for Discourse (in _/var/discourse/containers/app.yml_):

```plaintext
  DISCOURSE_HOSTNAME: 'discourse.mydomain.tld'
  VIRTUAL_HOST: 'discourse.mydomain.tld'
  LETSENCRYPT_HOST: 'discourse.mydomain.tld'
  LETSENCRYPT_EMAIL: 'your_mailbox@mydomain.tld'

```

Nginx Proxy needs the containers to expose their port to be proxied which you do like this in your app.yml:

```plaintext
expose:
  - "80" # fwd host port 80 to container port 80 (http)

```

---

_[View the full topic](https://meta.discourse.org/t/setting-up-lets-encrypt-for-multisite/44980)._
