Install Certbot on ubuntu 20.04

I've been following a couple of tutorials to add ssl to my server (node application).

I tried installing Certbot with the following line on by Ubuntu 20.04 server:

sudo add-apt-repository ppa:certbot/certbot

but got a warning and no install:

This is the PPA for packages prepared by Debian Let's Encrypt Team and backported for Ubuntu.                                                                         
Note: Packages are only provided for currently supported Ubuntu releases.
More info: https://launchpad.net/~certbot/+archive/ubuntu/certbot
Press [ENTER] to continue or Ctrl-c to cancel adding it.*

After searching the net, there is mention of not using PPA, but to use an earlier standalone version - also mention of using snap - But I cannot find a concrete answer. I am using Express and not nginX.

Could someone suggest how to install, please?

Update

Ran sudo snap install certbot.

Result:

error: This revision of snap "certbot" was published using classic confinement and thus may perform
   arbitrary system changes outside of the security sandbox that snaps are usually confined to,
   which may put your system at risk.
   If you understand and want to proceed repeat the command including --classic.

They have gotten rid of the apt it is now snap install certbot --classic


You can use APT, PIP or SNAP to install on Focal / Ubuntu 20.04

(APT works - at least for now.)

But, do not use more than one install method, or mix them.

It sounds like you may have mixed install methods.
You may need to purge everything and start over?

Run these to clean up & delete Certbot first.
If you have certificate(s) already created you will need to recreate them.
Warning: The following lines will delete certbot and files completely!

 sudo apt remove certbot* --purge  
 sudo apt-add-repository --remove ppa:certbot/certbot  
 sudo apt update  
 sudo snap remove certbot  
 sudo -H pip3 uninstall certbot*  
 pip3 uninstall certbot*  
 sudo rm -rf /etc/letsencrypt

Just ignore any errors (not founds).
That should cover all bases - both system-wide and user only.

Now decide how you want to install it.
PICK ONE AND ONLY ONE. Do not mix installation methods.

Snap

Installing snaps is easy enough, but I personally dislike using it. I prefer using python pip (as of right now). Snap would be my second choice.

Snap is well documented for Ubuntu Focal on the Certbot site already as the default installation method.

Pip

If you choose pip, you need to do this (for system-wide/root use):

 sudo apt install python3-pip
 sudo -H pip3 install certbot

This will create /etc/letsencrypt/ folder structure and default files.

The Certbot executable will be in /usr/local/bin/certbot - make sure it's in your path.
You will probably also need to setup auto renew and possibly add a plugin.
There are more detailed instructions here.

Apt

sudo apt show certbot

Package: certbot
Version: 0.40.0-1ubuntu0.1
Priority: extra
Section: universe/web
Source: python-certbot
Origin: Ubuntu

( https://packages.ubuntu.com/focal/certbot )

The APT version has always been many versions behind.
This is no exception.
The current APT version is at v0.40.0 -> (Released Nov 5, 2019).
The current PIP and SNAP versions are v1.19.0 (as of Oct 1 2021).

I recommend using something a bit newer than what APT offers. Since Certbot deals with security/SSL and sometimes the LetsEncrypt/Certbot folks make changes you definitely may want to update to immediately. You may not be able to do that if you use the APT version. And as far as I know you cannot use the Certbot PPA for Ubuntu Focal/20, either.

So, stick with pip -or- snap as your installation method.


To install the latest version of a github certbot works on Ubuntu 20.04

sudo curl -o- https://raw.githubusercontent.com/vinyll/certbot-install/master/install.sh | bash

Happy Coding!