How to use certbot to renew certificate

How to Use Certbot to Renew Certificate

The Certbot tool is popular among Linux users to install the SSL certificates for particular websites on the Linux operating systems. It also helps renew the already installed certificates. Therefore, we are implementing this article to install a Certbot to renew the certificates in Ubuntu 20.04 system. Let’s get going with the system update in the shell. The shell application must be opened using “Ctrl+Alt+T”. Ensure the “apt” package is already configured to use within the “update” query as shown. The system root password would be required to continue processing this system update:

How to use certbot to renew certificate 1

Install
Sponsored
Certbot Using Snapd

The first way to install Certbot is using the “snapd” package of the Ubuntu 20.04 system. It’s the latest way to install Certbot. So we must install the “snapd” package first in our system. For this, we are using the system’s “apt” package again within the installation command along with the keyword “snapd”. It will be mounted upon being presented:

How to use certbot to renew certificate 2

You must ensure that your system has the latest version of “snapd” configured. For this, you have to utilize the “core” command to the installation of snap in the shell terminal. You have to use the “refresh” command to update the installed version of snap to the latest one. You may have a look at the instructions working below. It will start downloading the “core” snap package from the “stable” channel:

How to use certbot to renew certificate 3

After the download, the core package will be installed, and it will show you if any update is available for the installed version. In our case, we have already configured the latest one:

How to use certbot to renew certificate 4

Now, we have to use a simple “snap” package within our installation command to install the “certbot” classic version on our system. It will start downloading the “certbot”:

How to use certbot to renew certificate 5

After a while, the Certbot will be installed using the “snapd” in the Ubuntu 20.04 Linux system:

How to use certbot to renew certificate 6

Install Certbot Using Pip

Before going further, we need to install some prerequisites before installing domains and environments on the Ubuntu 20.04 system. You must install the Python package along with its dependencies on Ubuntu 20.04. This might be done with our system “apt” package, as shown below. The process will start to install Python and its environment:

How to use certbot to renew certificate 7

Affirm the installation process by tapping “y” on the keyboard:

How to use certbot to renew certificate 8

You must install the main domain you want to use here. Let’s say you are using “nginx” or apache. So, we need to install nginx via the “install” command with apt package followed by the short word “nginx-core”. It will start installing nginx on your system:

How to use certbot to renew certificate 9

Sustain the installation by pressing “y”:

How to use certbot to renew certificate 10

Presently, it’s a phase to build a virtual atmosphere first. Use the stated below Python 3 command first. Follow up the process by querying the upgrade command for “pip” shown in the image. It will start collecting and downloading “pip” on our system. After that, the pip package will be installed as the newest version, and we are good to go.

$ sudo python3 –m venv /opt/certbot/

How to use certbot to renew certificate 11

After the Python and “pip” installation, we have to make use of “pip” to install the Certbot and “nginx” domain in our system. The command for this installation is stated in the shown image. It will collect the data for Certbot and certbot-nginx, download and install both on our system:

See also  Ubuntu Weekly Newsletter Issue 730

How to use certbot to renew certificate 12

Sponsored

At last, it will show you the range of packages installed by using this single command as shown below:

How to use certbot to renew certificate 13

After all the installations, we need to link the Certbot and ensure it’s running as shown below:

How to use certbot to renew certificate 14

Install Certbot Manually

If none of the methods work for you, try a manual way to install Certbot. Try querying the “apt” package installation command along with the keyword “certbot”. The secret code for the presently logged-in account user would be required to do so. Add your password and hit the “Enter” button to continue. It will start getting dependencies as shown:

How to use certbot to renew certificate 15

Within the installation process, it will require your affirmation to continue the installation of the Certbot. You must tap “y” to continue it without any hesitation:

How to use certbot to renew certificate 16

The installation will be continued smoothly. After a while, the process of Certbot installation will be completed, and the last processing lines for Certbot are shown below:

How to use certbot to renew certificate 17

Before doing anything, we are simply applying the renewal command to force the certificate to renew using the newly installed Certbot software. This command uses the keyword “renew” along with the flag “—force-renewal” to do the renewal forcefully. In return, it will ask for your sudo password once again. You have to add your secret code and press the “Enter” key from your keyboard. In return, it will start saving the debugging information of the encryption. The output for this command shows us that not a single renewal has been done because we don’t have any certificate installed yet on our system. So, we need to install the certificate first:

See also  Generative AI on a GPU-Instance with Ubuntu on AWS: Part 1 – Image Generation

How to use certbot to renew certificate 18

Install Certificate

You need to install the certificate for a particular domain, i.e., nginx installed just now. Use the “certbot” instruction using the “—nginx” flag. It might request you to enter your email first:

How to use certbot to renew certificate 19

After adding an email, you affirm that you agree with the terms. Press “y”:

How to use certbot to renew certificate 20

Again tap “y”, and you will be registered:

How to use certbot to renew certificate 21

In last, you have to add your domain web-server name and press Enter:

How to use certbot to renew certificate 22

Your certificate will be installed for a particular server. You can now use the “renew” command to renew the certificate using the Certbot tool:

How to use certbot to renew certificate 23

Conclusion

At last, we are done using the Certbot tool to renew a particular certificate for a particular domain. We have started with the different methods of installing certbot on the Ubuntu 20.04 system, such as pip and snapd. After that, we have established the main domain server and a certificate. In addition, we have cast-off the Certbot “renew” query to renovate the certificate. We hope you found this article helpful. Check out other Linux Hint articles for more tips and tutorials.


Discover more from Ubuntu-Server.com

Subscribe to get the latest posts sent to your email.

Comments

No comments yet. Why don’t you start the discussion?

    Leave a Reply