Simple script for setting up Let's Encrypt SSL on AWS Lightsail instances
-
Fresh AWS Lightsail Linux installation
-
This script was primary written for WordPress instances (Certified by Bitnami and Automattic)
lightsail-ssl.sh [domain] [email]
-
[domain] FQDN domain name pointing to the instance where this script is run
-
[email] Email address where Let's Encrypt will send notifications when the SSL certificate is expiring
[domain] and [email] arguments are optional if they are not provided the script will ask for them.
Connect to your instance using SSH
Run the following command in the terminal. This will download the script and set up Let's Encrypt.
wget -O - https://raw.githubusercontent.com/suhajda3/lightsail-ssl/main/lightsail-ssl.sh | sudo bash
Functions - in order - that the script does:
- Update the Linux OS
- Install / update lego
- Request Let's Encrypt certificate
- Set up automatic Let's Encrypt certificate renewal
- Display WordPress login credentials
You can run the script as many times as you like to update your system.
My blog post Running WordPress on AWS describes in detail how to use this script.
Feel free to open an issue (or even better, send a Pull Request) to contribute. Contributions are always welcomed! 😄
Please consider donating. 🙏