# How to install a certificate in trusted

**URL:** <https://forums.balena.io/t/how-to-install-a-certificate-in-trusted/5367>\
**Category:** balenaOS\
**Created:** [February 20, 2019, 1:39pm UTC](https://forums.balena.io/t/how-to-install-a-certificate-in-trusted/5367 "2019-02-20T13:39:44Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![rpelletier](https://avatars.discourse-cdn.com/v4/letter/r/ecccb3/32.png) [@rpelletier](https://forums.balena.io/u/rpelletier)\
**Post date:** [February 20, 2019, 1:39pm UTC](https://forums.balena.io/t/how-to-install-a-certificate-in-trusted/5367/1 "2019-02-20T13:39:44Z")

</div>

I am trying to install a certificate on my devices, but I must be missing a step because it keeps saying 0 added. Any assistance would be greatly appreciated.

mkdir /usr/share/ca-certificates/extras  
cp /tmp/fortigate.crt /usr/share/ca-certificates/extras/fortigate.crt  
dpkg-reconfigure -p critical ca-certificates  
update-ca-certificates  
0 added, 0 removed; done.

This is FROM resin/raspberrypi3-debian:stretch

I successsfully installed this using the same procedure on another debian machine, although that one was jessie, I am not aware of any differences that exist with the procedure.

---

<div class="post-metadata">

**Author:** ![DistgenAl](https://avatars.discourse-cdn.com/v4/letter/d/cdc98d/32.png) [@DistgenAl](https://forums.balena.io/u/DistgenAl)\
**Post date:** [January 10, 2020, 1:07pm UTC](https://forums.balena.io/t/how-to-install-a-certificate-in-trusted/5367/4 "2020-01-10T13:07:21Z")

</div>

Did you make any progress on this? I’m coming up against a similar problem.

Cheers  
Al

---

<div class="post-metadata">

**Author:** ![hedss](https://sea2.discourse-cdn.com/balena/user_avatar/forums.balena.io/hedss/32/210_2.png) [@hedss](https://forums.balena.io/u/hedss)\
**Post date:** [January 13, 2020, 9:50am UTC](https://forums.balena.io/t/how-to-install-a-certificate-in-trusted/5367/13 "2020-01-13T09:50:12Z")

</div>

Hi,

This is probably because you’re copying the certificate to the wrong place for updates. The certificate should be copied to `/usr/local/share/ca-certificates/` (and ideally have the 0644 permissions). You don’t actually need to run `dpkg-reconfigure ca-certificates` after this, because any new certificate found in that directory is taken as a trusted root. Just run `update-ca-certificates` after adding it, and it will be added to the system store at `/etc/ssl/certs`.

If you’re using a Dockerfile, the following example should work fine:

```auto
COPY mycert.crt /usr/src/app/mycert.crt
RUN cp /usr/src/app/mycert.crt /usr/local/share/ca-certificates/ && update-ca-certificates

```

Obviously, if you’re doing this in a script at runtime, just do the same thing from whereever the location of the certificate is.

Best regards,

Heds
