Let’s Encrypt is an automated, open certificate authority that offers free TLS/SSL certificates for the public’s benefit. The service is provided by the Internet Security Research Group (ISRG). This tutorial shows how to install a Let's Encrypt SSL certificate on One-Click LAMP & LEMP apps using the certbot installation wizard. After completing this tutorial, the server will have a valid certificate and redirect all HTTP requests to HTTPS.
This tutorial assumes that you have deployed a Vultr One-Click LAMP (Apache) or One-Click LEMP (Nginx) VPS, have a domain name pointing to your server IP address, and you are logged in as root.
Install certbot with apt
.
One-Click LAMP (Apache)
# apt update && apt install certbot python-certbot-apache -y
One-Click LEMP (Nginx)
# apt update && apt install certbot python-certbot-nginx -y
Run certbot
to install the certificate. Full examples are below, here are descriptions of the command line options:
Use certbot --help
for more information. See the Certbot FAQ for more information about SAN certificates.
Run certbot for Apache.
# certbot --apache --redirect -d example.com -d www.example.com -m admin@example.com --agree-tos
Before running certbot, make sure server_name is set properly. Edit your Nginx configuration:
# nano /etc/nginx/conf.d/default.conf
Update server_name to include your domain name.
server {
server_name example.com www.example.com;
Save and exit the file.
Run certbot for Nginx.
# certbot --nginx --redirect -d example.com -d www.example.com -m admin@example.com --agree-tos
Let's Encrypt certificates are valid for 90 days. The certbot wizard updates the systemd timers and crontab to automatically renew your certificate.
Verify the timer is active.
# systemctl list-timers | grep 'certbot\|ACTIVATES'
Verify the crontab entry exists.
# ls -l /etc/cron.d/certbot
Verify the renewal process works with a dry run.
# certbot renew --dry-run
Installing a free Let's Encrypt certificate is simple with certbot. For more information, see the official certbot installation documentation.
You could earn up to $300 by adding new articles