# How to: Install Let’s Encrypt certificates

**URL:** https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075
**Category:** Tutorials
**Tags:** obsolete, french, english
**Created:** [December 5, 2015, 11:18pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075 "2015-12-05T23:18:00Z")
**Posts on this page:** 20
**Page:** 5

<div class="post-metadata">

### Author: ![malmsey](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/9dc877/32.png) [@malmsey](https://forum.yunohost.org/u/malmsey)
#### Post date: [June 22, 2016, 7:04pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/82 "2016-06-22T19:04:16Z")

</div>

My nginx error log contains the following:

```
stack traceback:
coroutine 0:
        [C]: in function 'assert'
        /usr/share/lua/5.1/json/decode/state.lua:151: in function 'set_value'
        /usr/share/lua/5.1/json/decode.lua:84: in function 'decode'
        /usr/share/ssowat/config.lua:21: in function 'get_config'
        /usr/share/ssowat/access.lua:20: in function </usr/share/ssowat/access.lua:1>, client: [my IP], server: malmseyserv.lndyn.com, reque$
2016/06/19 23:58:46 [error] 562#0: *4 lua entry thread aborted: runtime error: /usr/share/lua/5.1/json/decode/state.lua:151: Value set when one already in slot

```

Does anyone know what that means?

---

<div class="post-metadata">

### Author: ![rgarrigue](https://forum.yunohost.org/user_avatar/forum.yunohost.org/rgarrigue/32/184_2.png) [@rgarrigue](https://forum.yunohost.org/u/rgarrigue)
#### Post date: [June 22, 2016, 9:06pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/83 "2016-06-22T21:06:21Z")

</div>

Hi

For information, I followed those step using the new letsencrypt script, [certbot](https://certbot.eff.org/#debianjessie-nginx)

/etc/ssowat/conf.json.persistent is

```
{
    "redirected_urls": {},
    "unprotected_urls" : [ 
        "my.domain/.well-known/acme-challenge" 
    ]
}

```

/etc/nginx/conf.d/my.domain.d/certbot.conf is

```
location '/.well-known/acme-challenge' {
    default_type "text/plain";
    root /etc/letsencrypt/webroot;
}

```

Then rougthly

```
sudo su
apt-get install certbot -t jessie-backports -y
mkdir /etc/letsencrypt/webroot
service nginx restart
cd /etc/yunohost
cp -r certs certs.backup
certbot certonly -d my.domain
# webroot into /etc/letsencrypt/webroot
cd /etc/yunohost/certs/my.domain
rm crt.pem key.pem
ln -sf /etc/letsencrypt/live/my.domain/privkey.pem key.pem
ln -sf /etc/letsencrypt/live/my.domain/fullchain.pem crt.pem
chown root:metronome /etc/letsencrypt/live /etc/letsencrypt/archive
chmod g+rx /etc/letsencrypt/live /etc/letsencrypt/archive

```

Last is automatical renewal with /etc/systemd/system/letsencrypt.service

```
[Unit]
Description=Renews letsencrypt certificates with certbot
After=network.target

[Service]
Type=oneshot
WorkingDirectory=/etc/letsencrypt
ExecStart=/usr/bin/certbot renew

```

And a timer /etc/systemd/system/letsencrypt.timer

```
[Unit]
Description=letsencrypt timer

[Timer]
OnCalendar=daily  
Persistent=true  
Unit=letsencrypt.service

[Install]
WantedBy=basic.target  

```

Last but not least, you need to reload nginx after a certificate renewal

```
mkdir /etc/systemd/system/letsencrypt.service.d

```

And /etc/systemd/system/letsencrypt.service.d/nginx.conf

```
[Service]
ExecStartPost=/bin/systemctl reload nginx

```

A simple test

```
date
systemctl restart letsencrypt.service
journalctl -xn

```

Here’s my result

```
mercredi 22 juin 2016, 23:00:29 (UTC+0200)
juin 22 23:01:17 yunohost.my.domain certbot[17723]: -------------------------------------------------------------------------------
juin 22 23:01:17 yunohost.my.domain certbot[17723]: Processing /etc/letsencrypt/renewal/my.domain.conf
juin 22 23:01:17 yunohost.my.domain certbot[17723]: -------------------------------------------------------------------------------
juin 22 23:01:17 yunohost.my.domain certbot[17723]: The following certs are not due for renewal yet:
juin 22 23:01:17 yunohost.my.domain certbot[17723]: /etc/letsencrypt/live/my.domain/fullchain.pem (skipped)
juin 22 23:01:17 yunohost.my.domain certbot[17723]: No renewals were attempted.

```

Thanks @CaptainSqrt2 for the steps, this [article](https://www.shivering-isles.com/lets-encrypt-renew-all-your-certs-using-systemd/) for the systemd stuff and letsencrypt

---

<div class="post-metadata">

### Author: ![aoz](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@aoz](https://forum.yunohost.org/u/aoz)
#### Post date: [June 26, 2016, 7:27am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/84 "2016-06-26T07:27:21Z")

</div>

I am running Yunohost 2.2 and I installed letsencrypt 3 months ago using the web API.

I received last week a notification telling that my letsencrypt certificates have to be renewed (actually, I created them April 14th, so they are valid until July 13th):

> ```
> /etc/cron.weekly/certificateRenewer:
> Checking myDomain.fr certificate ...
> > Needs to be renewed. Attempting to ...
> > An error occured, an email was sent.
> 
> ```

But it didn’t worked:

> ## Here is the log of what happened Consider also checking /var/log/letsencrypt/
> 
> Upgrading certbot-auto 0.7.0 to 0.8.1…  
> Replacing certbot-auto…  
> Creating virtual environment…  
> Installing Python packages…  
> Installation succeeded.  
> **Requested domain is not a FQDN**

Any idea about what occurred? Thanks!

---

<div class="post-metadata">

### Author: ![aoz](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@aoz](https://forum.yunohost.org/u/aoz)
#### Post date: [July 3, 2016, 8:50pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/85 "2016-07-03T20:50:56Z")

</div>

Has anybody succeeded the SSL certificate renewal?

---

<div class="post-metadata">

### Author: ![tomdereub](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@tomdereub](https://forum.yunohost.org/u/tomdereub)
#### Post date: [July 4, 2016, 9:15am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/86 "2016-07-04T09:15:07Z")

</div>

Hi!  
I’ve installed Let’s Encrypt with the app on yunohost 2.3, then I’ve moved to 2.4, and my certificates were ok. But now the renewal has failed:

```
/etc/cron.weekly/certificateRenewer:
Checking domain.tld certificate ...
 > Needs to be renewed. Attempting to ...
rm: impossible de supprimer « /tmp/cron-cert-renewer.log »: Aucun fichier ou dossier de ce type
 > An error occured, an email was sent.
mail: invalid option -- 'r'
usage: mail [-dEIinv] [-a header] [-b bcc-addr] [-c cc-addr] [-s subject] to-addr ...
       mail [-dEIiNnv] -f [name]
       mail [-dEIiNnv] [-u user]

```

Is there a way to repair this, or is it better to remove Let’s encrypt certificates and re-install manually like @rgarrigue did?

Thanks!

---

<div class="post-metadata">

### Author: ![aoz](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@aoz](https://forum.yunohost.org/u/aoz)
#### Post date: [July 4, 2016, 12:58pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/87 "2016-07-04T12:58:05Z")

</div>

I finally renewed my certs by uninstalling then installing Let’s Encrypt via the web admin interface.

---

<div class="post-metadata">

### Author: ![tomdereub](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@tomdereub](https://forum.yunohost.org/u/tomdereub)
#### Post date: [July 6, 2016, 7:52am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/88 "2016-07-06T07:52:30Z")

</div>

I renewed my certs by uninstalling and installing again too. Let’s Encrypt app worked well on yunohost 2.4 for me.  
But when I uninstalled the app, I had problems with the original certs that weren’t set up correctly, and so nginx didn’t start. I just put them back manually using the backup in the folder /etc/yunohost/certs/domain.tld/domain.tld.beforeLetsEncrypt

Thanks for the app, it’s so easy to use! Now I’m just waiting for the next renewal, to see if it works.

---

<div class="post-metadata">

### Author: ![Zinkie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/zinkie/32/345_2.png) [@Zinkie](https://forum.yunohost.org/u/Zinkie)
#### Post date: [July 12, 2016, 8:29am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/89 "2016-07-12T08:29:32Z")

</div>

Has --something changed recently with updates? I ask because a bunch of us all seem to have had the same issue come up at the same time recently.

My authentication URL’s just give 403’s or refused connection errors.

---

<div class="post-metadata">

### Author: ![Zinkie](https://forum.yunohost.org/user_avatar/forum.yunohost.org/zinkie/32/345_2.png) [@Zinkie](https://forum.yunohost.org/u/Zinkie)
#### Post date: [July 13, 2016, 7:24am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/90 "2016-07-13T07:24:54Z")

</div>

@aoz / @tomdereub - It sounds like you both solved this by uninstalling the certs manually and then installing the Let’s Encrypt Yunohost app. How did you do these steps? Did you just delete the certificate files?

---

<div class="post-metadata">

### Author: ![aoz](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/a/d9b06d/32.png) [@aoz](https://forum.yunohost.org/u/aoz)
#### Post date: [July 13, 2016, 9:10am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/91 "2016-07-13T09:10:07Z")

</div>

Not manually.  
I used the web admin interface to uninstall then re-install Let’s Encrypt app.

---

<div class="post-metadata">

### Author: ![tomdereub](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@tomdereub](https://forum.yunohost.org/u/tomdereub)
#### Post date: [July 13, 2016, 11:49pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/92 "2016-07-13T23:49:40Z")

</div>

For me, I’ve uninstalled the app via the web admin interface too, but then I had nginx not working anymore, with certificates problems. So I had to copy the saved certificates present here : `/etc/yunohost/certs/domain.tld/domain.tld.beforeLetsEncrypt` (ca.pem ; crt.pem ; key.pem) to the folder `/etc/yunohost/certs/domain.tld`.  
This made all working again with old certificates. Then I installed the app, and all worked automatically. I’m just waiting for the next certificates renewal to see if it’s working.

---

<div class="post-metadata">

### Author: ![srhodes](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@srhodes](https://forum.yunohost.org/u/srhodes)
#### Post date: [July 24, 2016, 3:09pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/93 "2016-07-24T15:09:46Z")

</div>

I also received the error “Requested domain is not a FQDN”, my domains all being in the form [example.com](http://example.com) (no subdomain). I ran “/opt/yunohost/letsencrypt/letsencrypt-auto renew” manually and all certificates were renewed.

---

<div class="post-metadata">

### Author: ![srhodes](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/s/76d3ee/32.png) [@srhodes](https://forum.yunohost.org/u/srhodes)
#### Post date: [July 24, 2016, 3:12pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/94 "2016-07-24T15:12:21Z")

</div>

In the process of the above manual certificate renewal, I also noticed that removing a domain via the admin interface does not remove the domain from the letsencrypt configuration. That needs to be done manually.

---

<div class="post-metadata">

### Author: ![Aleks](https://forum.yunohost.org/user_avatar/forum.yunohost.org/aleks/32/1704_2.png) [@Aleks](https://forum.yunohost.org/u/Aleks)
#### Post date: [July 25, 2016, 2:13pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/95 "2016-07-25T14:13:50Z")

</div>

Hi guys,

> [@aoz](#):
>
> **Requested domain is not a FQDN**
> 
> Any idea about what occurred? Thanks!

> [@srhodes](#):
>
> I also received the error “ **Requested domain is not a FQDN** ”

If you encounter this error, please check this fix from @juju : [Follow up bchackward incompatibility in certbot. · YunoHost-Apps/letsencrypt\_ynh@798565d · GitHub](https://github.com/YunoHost-Apps/letsencrypt_ynh/commit/798565d2884bac87407f271864ba9f0181cecc8d) to be applied on `/etc/cron.weekly/certificateRenewer`

---

<div class="post-metadata">

### Author: ![nonooo](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/n/96bed5/32.png) [@nonooo](https://forum.yunohost.org/u/nonooo)
#### Post date: [July 28, 2016, 12:08pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/96 "2016-07-28T12:08:11Z")

</div>

I can confirm that it has worked fine for me (yunohost 2.4)

---

<div class="post-metadata">

### Author: ![MarcusMoeller](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/m/47e85d/32.png) [@MarcusMoeller](https://forum.yunohost.org/u/MarcusMoeller)
#### Post date: [July 30, 2016, 3:23pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/97 "2016-07-30T15:23:02Z")

</div>

Within the renewal script you are using an option ‘-r’ to specify the From address. This option is not available.

You might want to change it to something like:

-a “From: ${EMAIL\_ALERT\_FROM}”

---

<div class="post-metadata">

### Author: ![jodumont](https://forum.yunohost.org/user_avatar/forum.yunohost.org/jodumont/32/2179_2.png) [@jodumont](https://forum.yunohost.org/u/jodumont)
#### Post date: [September 23, 2016, 11:18am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/98 "2016-09-23T11:18:00Z")

</div>

I try several time to install Let’s Encrypt  
It Failed to restart nginx  
– I need to restart it by hand  
and at the end info for let’s encrypt show : URL https://

I have few subdomain

---

<div class="post-metadata">

### Author: ![bastien](https://forum.yunohost.org/user_avatar/forum.yunohost.org/bastien/32/250_2.png) [@bastien](https://forum.yunohost.org/u/bastien)
#### Post date: [September 23, 2016, 9:30pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/99 "2016-09-23T21:30:03Z")

</div>

Thanks @CaptainSqrt2 for linking to the fix. You saved me an evening of debugging 🙂

---

<div class="post-metadata">

### Author: ![tomdereub](https://forum.yunohost.org/letter_avatar_proxy/v4/letter/t/c57346/32.png) [@tomdereub](https://forum.yunohost.org/u/tomdereub)
#### Post date: [October 4, 2016, 6:59am UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/100 "2016-10-04T06:59:33Z")

</div>

Merci @CaptainSqrt2, et @juju aussi du coup, ça a marché nikel pour moi, le renouvellement c’est fait !  
Et merci aussi @MarcusMoeller pour les envois de mails !

---

<div class="post-metadata">

### Author: ![maxime](https://forum.yunohost.org/user_avatar/forum.yunohost.org/maxime/32/82_2.png) [@maxime](https://forum.yunohost.org/u/maxime)
#### Post date: [October 8, 2016, 8:28pm UTC](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075/101 "2016-10-08T20:28:47Z")

</div>

Juste un petit mot pour remercier tous ceux qui ont participé à cela.

Ca marche niquel !

Merci encore 😉

[Previous page](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075.md?page=4)

[Next page](https://forum.yunohost.org/t/how-to-install-let-s-encrypt-certificates/1075.md?page=6)
