Let's Encrypt is an automated, free TLS/SSL certificate authority provided by the Internet Security Research Group (ISRG). This article explains how to install a Let's Encrypt SSL certificate on an Ubuntu 20.04 cloud server, applicable for both Apache and Nginx web servers. Once installed, the web server will possess a valid SSL certificate and will be able to redirect HTTP requests to HTTPS.
Ensure snapd is up to date:
$ sudo snap install core; sudo snap refresh core
Remove any residual Certbot:
$ sudo apt-get remove certbot
Install Certbot using snap:
$ sudo snap install --classic certbot
Create a symlink for Certbot:
$ sudo ln -s /snap/bin/certbot /usr/bin/certbot
Run Certbot to install the SSL certificate. The options and their meanings for the Certbot command are as follows:
Additional help can be obtained using the certbot --help command.
1.Installing SSL Certificate on Apache:
# certbot --apache --redirect -d example.com -d www.example.com -m admin@example.com --agree-tos
2.Installing SSL Certificate on Nginx:
# nano /etc/nginx/conf.d/default.conf
Change the server_name to the actual domain name:
server {
server_name example.com www.example.com;
Execute the installation command:
# certbot --nginx --redirect -d example.com -d www.example.com -m admin@example.com --agree-tos
The validity of Let's Encrypt certificates is 90 days. Certbot will update the system's crontab to implement automatic certificate renewal.
Verify the timer status:
# systemctl list-timers | grep 'certbot\|ACTIVATES'
Confirm the status of the scheduled task:
# ls -l /etc/cron.d/certbot
Ensure the renewal is functioning properly:
# certbot renew --dry-run
The above are the methods to install a Let's Encrypt certificate using Certbot. For more information, refer to the official Certbot documentation.
23-02-2024 02:02:07
22-02-2024 03:19:32
22-02-2024 03:16:03
22-02-2024 03:14:03
22-02-2024 03:11:58