How to install nginx plugin?

I follow install guide so cloning https://github.com/letsencrypt/letsencrypt
I should install letsencrypt-nginx but find no doc to do it.
And this is confirmd by letsencrypt-auto --nginx which detects letsencrypt-nginx not installed.
So where is the doc to install it ?

Thanks
PC

The only method I discovered was to use the manual method. Were you able to figure anything out?

The webroot method works quite well.

Add to your config:

location ~ .well-known/acme-challenge/ {
    root /var/www/letsencrypt;
    default_type text/plain;
}

Then you can use --webroot --webroot-path /var/www/letsencrypt for all your domains.

1 Like

Yes, this is the good way with :

/path/to/letsencrypt/letsencrypt-auto --config www.myweb.fr.conf certonly

with www.myweb.fr.conf :
(here I have removed the comments)

rsa-key-size = 4096
email = myemail@mywweb.fr
domains = www.myweb.fr
text = True
authenticator = webroot
webroot-path = /tmp/letsencrypt-auto

and as you indicate in nginx config for http://www.myweb.fr :

location ~ .well-known/acme-challenge/ {
root /tmp/letsencrypt-auto;
default_type text/plain;
}

I have created /tmp/letsencrypt-auto directory but maybe it is not necessary.
I have executed letsencrypt-auto from a sudoer but not as root.

As it has not been clear for me, I add that the purpose of webroot is to easily allow letsencrypt to check that you are the “authority” for the site you are asking a certificate for.

nginx config as mentioned. Make sure, every location / for any subdomain in your nginx config has this snippet.
I have no full example here, as my configs are too complicated to make a good example.

The commandline was:

letsencrypt certonly --email your@mail -d domain -d www.domain --webroot --webroot-path /var/www/letsencrypt/

this makes sure, you do not need to adapt the webroot-path for each domain and the config snippet is always the same.

Meanwhile, cli letsencrypt has been renamed to certbot. Use the following command to install the nginx plugin:

$ sudo apt install python-certbot-nginx
1 Like

TLDR; instructions for installing certbot (including the nginx plugin) for any server on any platform.


For some OSes (CentOS/RHEL 7, CentOS 6, OpenBSD, any Ubuntu version, others…) certbot has to be installed from a non-standard repository (maintained by EFF’s team) to get the nginx plugin, which has to be installed separately. Otherwise you’re stuck with apache or webroot.

For example, on Ubuntu 16.04 (or 18.04 or 14.04):

apt install software-properties-common
add-apt-repository universe
add-apt-repository ppa:certbot/certbot
apt update
apt install certbot python-certbot-nginx python-certbot-nginx-doc

Adding the repository brought on a log of changes to python on my system.

I also ended up with python3-certbot-nginx, python3-pyparsing, and from installing the doc package I needed fonts-font-awesome fonts-lato libjs-modernizr sphinx-rtd-theme-common.


EFF also has a generic downloadable script for nginx.

I did tried to install this plugin, however, the error message indicated that the php7.2 failed to install, but I installed the latest version which is 7.4 so does the latest will work with Certbot or it won’t?

Use https://github.com/acmesh-official/acme.sh and sleep quiet !

PC

1 Like