Let's encrypt SSL for nodejs in lightsail resource missing

Viewed 480

I can find how to install SSL using let's encrypt on wordpress/Nginx/LAMP but not for Nodejs installation. I need help with installing SSL certificate for my nodejs server application which I have installed on aws Lightsail. How can I do that as there is no resource I can find for nodejs installation on lightsail?

1 Answers

I had this same issue and while I love Certbot, it is not an option for the NodeJS instance on AWS (at least as of August 2021) which uses Bitnami. After lots of searching, I was able to get the process working with the instructions found on this documentation page:

https://docs.bitnami.com/general/how-to/generate-install-lets-encrypt-ssl/

Before you do this (or any SSL tutorial), create a snapshot of your instance in case you need to roll back. 503 errors are common with this type of thing.

SSH into your AWS instance and start with the following command:

sudo /opt/bitnami/bncert-tool

You may see a message that says you'll need to update– if so, choose y and run the above command again. Follow the instructions carefully. For example, if you only enter your domain name, it'll ask if you want to add the www. to it as well. It'll then ask to set up http => https, no-www => www and www => no-www redirects– pay close attention to which you are enabling.

Don't forget to restart Apache afterwords:

sudo /opt/bitnami/ctlscript.sh restart apache

Hopefully that works for you! Most of the instructions and documentation for setting up an SSL certificate for AWS Lightsail instances of NodeJS are sparse, presumptive, and either way too brief or include so many unnecessary details they cause more confusion than they solve. Best of luck to anyone who finds this in the future– hope this helps!

Related