I’m trying to install certbot on my digital ocean droplet. I’m using ubuntu 20.04 and following instructions from https://certbot.eff.org/lets-encrypt/ubuntufocal-nginx.
The error occurs when I run sudo certbot --nginx
. The error I get is:
The nginx plugin is not working; there may be problems with your existing configuration.
The error was: NoInstallationError("Could not find a usable 'nginx' binary.
Ensure nginx exists, the binary is executable, and your PATH is set correctly.")
This is my first time using digital ocean and such so please explain the solution. Thank you.
5
Answers
looks like theres problem with certbot snap package, you can try to remove it from snap, and install certbot again with apt.
you can follow this tutorial.
The accepted answer didn’t help me as my certbot was installed correctly when I upgraded from Ubuntu 18. I did, however, manage to get more useful debugging information by running the following command:
If the output of that is too verbose then remove the
-v
at the end, either way it should give you much better insight as to what the root cause of the error is.you can use options to specify the path to the ‘nginx’ binary and conf directory (it seems that certbot expects
nginx.conf
file in nginx’s installation directory if you do not specify it manually)I had this problem on CentOS 7 and Nginx was probably installed from Epel.
Renew was working from command line but not from cronjob. I found this in letsencrypt logs:
Could not find a usable 'nginx' binary
So I tried what @Jerther said in a comment, specified
--nginx-ctl
. First I got the nginx path with:which nginx
then I used that returned path/usr/sbin/nginx
in the crontab command.So in my crontab I replaced:
/usr/bin/certbot renew
with
/usr/bin/certbot --nginx-ctl /usr/sbin/nginx renew
Thanks so much @Jerther and @adrianTNT,
That fixed the problem! I’ve change
instead of
CentOs 7
Renew was working from command line but not from cronjob, now it works!