47

I'm actually working on a webapp, I use Reactjs for the frontend and Golang for the backend. Those 2 programs are hosted separately on 2 VMs on Google-Compute-Engine. I want to serve my app through https so I choose to use Nginx for serving the frontend in production. Firstly I made my config file for Nginx:

#version: nginx/1.14.0 (ubuntu)
server {
     listen 80 default_server;
     listen [::]:80 default_server;

     root /var/www/banshee;
     server_name XX.XXX.XX.XXX; #public IP of my frontend VM

     index index.html;

     location / {
       try_files $uri /index.html =404;
     }
   }

For this part everything works as expected but after that I want to serve my App over https following this tutorial. I installed the packages software-properties-common,python-certbot-apache and certbot but when I tried

sudo cerbot --nginx certonly

I get the following message:

gdes@frontend:/etc/nginx$ sudo certbot --nginx certonly
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Could not choose appropriate plugin: The requested nginx plugin does not appear to be installed
The requested nginx plugin does not appear to be installed

I made some searches on Google and here and I still can't figure out which plugin is missing or an other way to fix this.

Does someone have an idea tohelp me ?

Thanks a lot :)

5 Answers 5

156

I was trying to create Let's Encrypt certificate using certbot for my sub-domain and had the following issue. Command:

ubuntu@localhost:~$ certbot --nginx -d my_subdomain.website.com -d my_subdomain2.website.com

Issue:

The requested Nginx plugin does not appear to be installed

Solution:

Ubuntu 20+

ubuntu@localhost:~$ sudo apt-get install python3-certbot-nginx

Earlier Versions

ubuntu@localhost:~$ sudo apt-get install python-certbot-nginx

3
  • 23
    In Ubuntu 20.04 the package name is python3-certbot-nginx Nov 1, 2020 at 21:43
  • You you installed via pip, you can alternatively do pip install certbot-nginx
    – Charles L.
    Dec 21, 2020 at 21:45
  • The solution for Ubuntu 20+ worked on Ubuntu 18 as well.
    – margenn
    Jun 19, 2021 at 14:15
19

You will need to replace

apt install python-certbot-nginx

by

apt install python3-certbot-nginx
0
7

You can install the Certbot nginx plugin with the following commands:

add-apt-repository ppa:certbot/certbot
apt update
apt install python-certbot-nginx
2
  • Thanks, it's working, but the installation keeps failing when I do sudo certbot --nginx certonly I think it's because my app doesn't have any DNS
    – G.D
    Nov 12, 2018 at 9:30
  • 2
    Yes, the domain name needs to resolve to the server running certbot in order to verify that you own the domain. Nov 12, 2018 at 21:32
2

You have to re-install a python3 version of Lets Encrypt's certbot.

Run

sudo apt-get install python3-certbot-nginx
0

On Debian 10, certbot returns a "could not find a usable nginx binary" issue because, "/usr/sbin" is missing from the PATH. Add /usr/sbin to the PATH

export PATH=/usr/sbin:$PATH

Then certbot can make a certificate for nginx

certbot --nginx -d <server name> --post-hook "/usr/sbin/service nginx restart"

As explained on the debian wiki page for letsencrypt.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.