Generating a Free Let’s Encrypt SSL Certificate

3 min readUpdated December 6, 2025

A step-by-step guide to creating a free SSL certificate from Let's Encrypt.

First, update the system package lists and repositories:

bash
sudo apt-get -y update && sudo apt-get -y dist-upgrade

Install CertBot:

bash
sudo apt-get -y install certbot

Next, install additional packages.

For Nginx:

bash
sudo apt-get -y install python3-certbot-nginx

For Apache2:

bash
sudo apt-get -y install python3-certbot-apache

#Certificate generation

Please note that the web server must be running.

For Nginx:

bash
certbot certonly --nginx -d yoursite.com

For Apache2:

bash
certbot certonly --apache -d yoursite.com

If you cannot start the web server, use the following command:

bash
certbot certonly --standalone -d yoursite.com

Use the following command to automatically renew the SSL certificate:

bash
certbot renew

From now on, the validity of your certificate will be checked automatically every day.

Did not find the answer? We are online 24/7.Contact support