Setting up a Free SSL LetsEncrypt Certificate for Lightsail and renewing/updating

  • Posted on Tuesday, February 27, 2018

Hello everyone in this quick tutorial we wanted to take you through how to setup a free ssl certificate with LetsEncrypt.

First please follow our Lightsail tutorial here

Step One: SSH into your instance and run.

sudo su
cd ~
mkdir tmp

Step Two: Install Letsencrypt

chmod a+x certbot-auto

Step Three: Run the script

./certbot-auto certonly --webroot -w /home/bitnami/htdocs/ -d

Step Four: Delete two files to be replaced by the newly created ones

cd /opt/bitnami/apache2/conf/
rm server.crt
rm server.key

Step Five: Create links for the newly created files

sudo ln -s /etc/letsencrypt/live/ /opt/bitnami/apache2/conf/server.crt
sudo ln -s /etc/letsencrypt/live/ /opt/bitnami/apache2/conf/server.key

Now very important restart Apache

sudo /opt/bitnami/ apache restart

!Important to renew simply run in your tmp folder.

./certbot-auto renew

To force renew your LetsEncrypt Certificate run

./certbot-auto renew --force-renew

Extra if you would like to force https

sudo vim /opt/bitnami/apache2/conf/bitnami/bitnami.conf

Add the text below here:

< VirtualHostĀ default:80 >
DocumentRoot "/opt/bitnami/apache2/htdocs"

RewriteEngine On
RewriteCond %{HTTPS} !=on
RewriteRule ^/(.*) https://%{SERVER_NAME}/$1 [R,L]

Now very important restart Apache

sudo /opt/bitnami/ apache restart

Remove banner

sudo /opt/bitnami/apps/wordpress/bnconfig --disable_banner 1

Get Started Now

We distribute millions of videos via our service every month

Sign Up