# How should I enable letsencrypt while discourse is beside other websites

**URL:** <https://meta.discourse.org/t/how-should-i-enable-letsencrypt-while-discourse-is-beside-other-websites/58107>\
**Category:** Self-hosting\
**Created:** [2017年二月28日 18:26 UTC](https://meta.discourse.org/t/how-should-i-enable-letsencrypt-while-discourse-is-beside-other-websites/58107 "2017-02-28T18:26:53Z")\
**Posts on this page:** 1\
**Showing post:** 8

<div class="post-metadata">

**Author:** ![fefrei](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/fefrei/32/119538_2.png) [@fefrei](https://meta.discourse.org/u/fefrei)\
**Post date:** [2017年三月1日 07:43 UTC](https://meta.discourse.org/t/how-should-i-enable-letsencrypt-while-discourse-is-beside-other-websites/58107/8 "2017-03-01T07:43:28Z")

</div>

Here’s a slightly more detailed battle plan:

- Backup `/etc/nginx`!
- Update your existing configurations to listen on port 443. That’s invalid (`nginx` will speak HTTP on port 443), but we’ll fix that once we have the certificate. Doing so will free up port 80, so your existing configs cannot conflict with getting your first cert.
- Add the first configuration snippet after the **Add HTTPS** section header in [my offline guide](https://meta.discourse.org/t/adding-an-offline-page-when-rebuilding/45238) to _either_ one of your config files, _or_ an additional one in `sites-available` that you link to in `sites-enabled`.
- `service nginx reload`
- Install Certbot and get a certificate. Follow the instructions in my guide to do so. Supply multiple domains (with multiple `-d` arguments) to Certbot so you get one cert that covers all relevant domains (`talk.zabanshenas.com` and `www.talk.zabanshenas.com`).
- When you got the cert, adapt your existing configs (that you already changed to port 443) to match the last configuration snippet in the **Add HTTPS** section header in my guide: Update the `listen` line and add the lines that configure SSL. Leave the rest as is.
- `service nginx reload`

If all went well, your sites should be served via HTTPS, and there should be an automatic redirect to HTTPS.

---

_[View the full topic](https://meta.discourse.org/t/how-should-i-enable-letsencrypt-while-discourse-is-beside-other-websites/58107)._
