# Unable to renew Let's encrypt certificate

**URL:** https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192
**Category:** Self-hosting
**Tags:** letsencrypt
**Created:** [February 5, 2024, 2:11pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192 "2024-02-05T14:11:36Z")
**Posts on this page:** 9
**Page:** 1

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [February 5, 2024, 2:11pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/1 "2024-02-05T14:11:36Z")

</div>

Hello,

Today the certificat of my discourse installation expired.

I have tried to renew it by following those commands :

```plaintext
ssh root@your.discourse.server
cd /var/discourse/shared/standalone
cp -r ssl ssl_backup
rm ssl/*
cd /var/discourse
./launcher rebuild app

```

After execution, i can see that new files are available in the directory **/var/discourse/shared/standalone/ssl** however this new certificate is not loaded by the web site.

Any idea how to solve this problem ?

---

<div class="post-metadata">

### Author: ![merefield](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/merefield/32/176214_2.png) [@merefield](https://meta.discourse.org/u/merefield)
#### Post date: [February 5, 2024, 2:13pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/2 "2024-02-05T14:13:50Z")

</div>

> [@peyrusse](#):
>
> cp -r ssl ssl\_backup  
> rm ssl/\*

These steps are usually unnecessary - the build script on its own will update your certificate as required.  
I wonder if your deletion of the contents of the directory is affecting the build process?

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 5, 2024, 2:52pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/3 "2024-02-05T14:52:45Z")

</div>

Are you trying to use a custom certificate rather than the one provided by let’s encrypt?

DId you follow [Allow SSL / HTTPS for your Discourse Docker setup](https://meta.discourse.org/t/allow-ssl-https-for-your-discourse-docker-setup/13847) (which isn’t recommended anymore) or just a [standard install](https://meta.discourse.org/t/142537?silent=true)?

Are you using cloudflare or something else that might be interfering with the certificate renewal?

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [February 5, 2024, 2:58pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/4 "2024-02-05T14:58:33Z")

</div>

It’s a certificate provided by let’s encrypt, no cloudfare at all.

---

<div class="post-metadata">

### Author: ![pfaffman](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/pfaffman/32/120154_2.png) [@pfaffman](https://meta.discourse.org/u/pfaffman)
#### Post date: [February 5, 2024, 4:06pm UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/5 "2024-02-05T16:06:42Z")

</div>

You’ll need to go into the container (`./launcher enter app`) and try to run the command by hand.

```plaintext
cd /root/acme.sh && LE_WORKING_DIR="${LETSENCRYPT_DIR}" ./acme.sh --upgrade --auto-upgrade

```

You could try that.

Is something wrong with your DNS? Common wisdom is that it’s always DNS. What’s your hostname?

---

<div class="post-metadata">

### Author: ![frictionel](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/frictionel/32/299701_2.png) [@frictionel](https://meta.discourse.org/u/frictionel)
#### Post date: [February 6, 2024, 1:41am UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/6 "2024-02-06T01:41:05Z")

</div>

I had that very same problem a few months ago. I‘ve tried everything I could find on meta but in the end a simple restart of the server solved it for me.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [February 6, 2024, 6:58am UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/7 "2024-02-06T06:58:58Z")

</div>

I did this 🙂

- Reboot Server : No changes
- root@VM-Discourse-01-app:/var/www/discourse# cd /root/acme.sh && LE\_WORKING\_DIR=“${LETSENCRYPT\_DIR}” ./acme.sh --upgrade --auto-upgrade  
[Tue 06 Feb 2024 06:53:56 AM UTC] Already uptodate!  
[Tue 06 Feb 2024 06:53:56 AM UTC] Upgrade success!

But when i launch discourse i can see on the url that the certificate is not set.

---

<div class="post-metadata">

### Author: ![peyrusse](https://avatars.discourse-cdn.com/v4/letter/p/8dc957/32.png) [@peyrusse](https://meta.discourse.org/u/peyrusse)
#### Post date: [February 7, 2024, 9:31am UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/8 "2024-02-07T09:31:46Z")

</div>

It finally works. It was my port 80 from my Azure environment that was closed so the challenge response when generating the certificate was failing … thanks for you help.

---

<div class="post-metadata">

### Author: ![system](https://sea3.discourse-cdn.com/meta/user_avatar/meta.discourse.org/system/32/443519_2.png) [@system](https://meta.discourse.org/u/system)
#### Post date: [March 8, 2024, 9:32am UTC](https://meta.discourse.org/t/unable-to-renew-lets-encrypt-certificate/294192/9 "2024-03-08T09:32:43Z")

</div>

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
