How to install Nginx plugin on Mac

Please fill out the fields below so we can help you better. Note: you must provide your domain name to get help. Domain names for issued certificates are all made public in Certificate Transparency logs (e.g. crt.sh | example.com), so withholding your domain name here does not increase secrecy, but only makes it harder for us to provide help.

My domain is: I don't have a domain

I ran this command: I'm trying to install multiple docker containers including an Nginx container which has a prerequisite of creating a pem key and uses Certbot with an Nginx plugin in the documentation.
I installed certbot with home-brew.
I'm not able to find any way to install the required Nginx plugin.
I read the question asked 6 years ago and the responses.
I don't understand the manual method or whether it would apply to a home-brew installed certbot instance.
The apt method will not work in the current Mac OS.
This site is linked by a stack exchange referring to manual instructions to add the Nginx plugin but that link return a 404 error at this site (lets encrypt).

It produced this output: sudo certbot --nginx certonly

Saving debug log to /var/log/letsencrypt/letsencrypt.log

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.")

Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more details.

My web server is (include version):

The operating system my web server runs on is (include version):

My hosting provider, if applicable, is:

I can login to a root shell on my machine (yes or no, or I don't know):

I'm using a control panel to manage my site (no, or provide the name and version of the control panel):

The version of my client is (e.g. output of certbot --version or certbot-auto --version if you're using Certbot):

Hi @rberge and welcome to the LE community forum :slight_smile:

I'm confused :confused: ...

If you don't have a domain, how do you expect to obtain a cert?

That said, Mac O/S is rather non-standard about where it places services.
[or perhaps you haven't installed nginx on the Mac]
On Macs, in general, I've found that it may be much simpler to use --webroot authentication.

2 Likes

Then you will be unable to get a cert from Let's Encrypt.

If there's no way to tell that container not to create a cert with certbot, you'll need to not use that container--as noted above, you need a domain in order to get a certificate from Let's Encrypt.

I'll admit to not being super Docker-savvy, but isn't (part of) the point of Docker that all the relevant software would be included in the container? If that's the case, Certbot, its plugins, and Nginx would all be there. You shouldn't be installing anything (other than Docker itself) on the Mac, and you wouldn't be able to run any of the relevant software without entering the appropriate container first.

Of course it won't; macOS isn't Debian.

3 Likes

Hi danb, appreciate your response.
I mentioned the apt-get because it was in the other issues. Just reporting that I tried it.
I don’t have a domain because I am following a set up of instructions to create containers and no mention Is made at any point of a domain. It sounds like I have to read the instructions again and/or read between the lines

The instructions are for ubuntu and are to add a certificate and key in PEM format.

2 Likes

While it is technically possibile to create certificates for an IP address, usually one uses certificates to secure a hostname instead of an IP address. Also, Let's Encrypt currently does not support adding IP addresses to their certificates, just hostnames.

1 Like

What I don't understand about your response, and your form, is that I am not actively creating a password. The topic is - how to install- not how to create a certificate. Do I need a domain in order to install the plug-in that presumably I would use to create the certificate?

You mention installing nginx on the Mac. Are you saying that if I install that , I will get access to the plug in?
Thanks.

If you have installed certbot, then you have installed the nginx plugin (for certbot).
So, the question becomes: How can I install certbot on Mac?

1 Like

@rberge, what is the certificate going to be securing in this container setup? (Or what is one environment going to access in another environment that is authenticated by the certificate?)

Usually, Let's Encrypt certificates and similar certificates are used to authenticate publicly-available web services, like this forum's web site. They can certainly be used for other things, but they may get less and less applicable as you get further and further away from this case.

1 Like

Hi, the certificate is used in a set of docker containers to provide authentication. When I do create a certificate it will be using the domain for my localhost variant of the software. However, as I said before, my problem is that I can't use the documented easy method of creating a certificate because I don't have the nginx-plugin. Could you help me with that? (rg305, the answer to your question is "Use Homebrew"). I used brew to install certbot and now have this version
certbot 1.22.0
And then, based on what rg305 said "If you have installed certbot, then you have installed the nginx plugin(for certbot)", I tried the command "sudo certbot --nginx certonly" because I have installed certbot.
the response is
"Saving debug log to /var/log/letsencrypt/letsencrypt.log

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.")

Ask for help or search for solutions at https://community.letsencrypt.org. See the logfile /var/log/letsencrypt/letsencrypt.log or re-run Certbot with -v for more"

following the instructions from the error, I am asking "how do I install that nginx plug in on a Mac running Big Sur (and soon Monterey)?" None of the answers given in the other questions in the community forum or in the faqs work in my circumstance. There was a link to a "manual" solution but that link gives a 404.
do I need to install nginx? Answer, I used brew nginx and then repeated the command and it works (kind of - I have some other problems).
So, for a Mac to use the nginx plugin, use brew certbot and then use brew nginx

So, if I understood you correctly, you're just using the software to connect to another service on your own local computer, using localhost, and not using a domain that you purchased?

Is that different from the way that people commonly set up the software that you're using according to the tutorial? (Is it uncommon to use it on localhost?)

Certbot can't get you a certificate for localhost under any circumstance, regardless of what plugins or other applications you install; it only ever obtains publicly-trusted certificates, which aren't available for localhost at all.

1 Like

You are misreading the error message.
It says that the certbot nginx plugin ran.
And that plugin could not find the nginx program.

Like I said earlier:

And I also tried to save you the trouble, with:

But, if you insist on using a guide that wasn't written for Mac, you will need to instruct certbot on where to find the nginx binary file.
[as well as other things alone the way...]

1 Like

Besides Mac, Docker is also an issue for the nginx plugin, as nginx will run in a different container and the nginx plugin isn't able to reach nginx due to that.

2 Likes

No, I didn’t say that. I am getting a domain. But the first block was the plugin.

In response to rg305, appreciate your clarification. However, the other part of the error clearly says that the plug in isn't working. What might be obvious to others (installing nginx) was the real problem. In response to schoen, I am trying to set up a development environment where I can test. Usually there is a purchased domain. Thanks for letting me know that I can't do this with localhost. That is truly helpful.

1 Like

The simplest solution to that is to use a free dynamic DNS domain name (for testing).

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.