The first step to using Let's Encrypt to obtain an SSL certificate is to install the Certbot software on your server.

Install Certbot and its Nginx plugin#

Open the terminal and run these commands:

apt update apt install certbot python3-certbot-nginx

Confirming Nginx's Configuration:

nano /etc/nginx/sites-available/default

Find the existing server_name line. It should look like this:

... server_name example.com www.example.com; ...

Then check the configuration and reload nginx:

nginx -t systemctl reload nginx

start certbot progress to activate the website by:

certbot --nginx -d example.com -d www.example.com

Now, we are done! Your website is secured. Certbot also installs a timer that renews the certificate automatically; you can test it with:

certbot renew --dry-run