Installing Let's Encrypt for HTTPS

Follow

If you would like to use Let's Encrypt, a free encryption service for Countly server, this document explains how to generate, install and update your certificate on your Countly instance.

Visit Let’s Encrypt and install certbot

The first step is to go Certbot page and install your certification bot (certbot) which will guide you towards generation of your certification.

Here, select Nginx as platform and then Ubuntu, CentOS or Red Hat Enterprise Linux based on the Linux distribution you use.

Now, on the next page, run commands as instructed (e.g using wget, apt or yum) so it installs Certbot. And setup certification for your site via the instructions.

If the default method doesn't work

Depending on the method of installation, run Certbot command directly on the console with root credentials. If it doesn't work, try standalone mode.

# certbot --authenticator standalone --installer nginx -d {yourdomain.com} -d  {yourdomain.com} --pre-hook "service nginx stop" --post-hook "service nginx start"

Configuration options

Now, edit Countly Nginx configuration based on the Countly document in this link. You also can redirect HTTP requests to HTTPs based on instructions given in the same document.

The next step is setting certificate files for auto-renewal (here we set to 30 days periodically). In order to do this, add a cron job as shown below.

0 0 */30 * *  /usr/bin/certbot renew --quiet --post-hook "/usr/sbin/service nginx restart"

This way, the certificate will renew every 30 days.

With this last step, you are done. Restart Countly server and enjoy.

Was this article helpful?
0 out of 0 found this helpful

Looking for help?