[GH-ISSUE #593] Generation of self-signed certificates #496

Open
opened 2026-02-26 06:33:07 +03:00 by kerem · 29 comments
Owner

Originally created by @typoworx-de on GitHub (Sep 3, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/593

Is your feature request related to a problem? Please describe.
I'm running docker instance in intranet/private-network and require https for some docker-instances (like docker-registry). The private-lan runs on TLD ".lan" so it's not possible to use letsencrypt by routing domain-name over router as letsencrypt only supports domains/tld's reachable from intranet.

Describe the solution you'd like
I noticed nginx-proxy-manager already supports custom-certs which is awesome! I would love to have an additional option in that dropdown in section "SSL Certificates" that could be named "Create self-signed certificate" and then routes this request to f.e. the linux-tool mkcert.

https://blog.filippo.io/mkcert-valid-https-certificates-for-localhost/

mkcert my-private-domain.lan

Describe alternatives you've considered
I could run mkcert on my local machine and manually upload the cert-files into nginx-proxy-manager.

Additional context
I think I'm not the only user who runs a docker instance in private/lan and think this feature would support/help other users as well.

Originally created by @typoworx-de on GitHub (Sep 3, 2020). Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/593 **Is your feature request related to a problem? Please describe.** I'm running docker instance in intranet/private-network and require https for some docker-instances (like docker-registry). The private-lan runs on TLD ".lan" so it's not possible to use letsencrypt by routing domain-name over router as letsencrypt only supports domains/tld's reachable from intranet. **Describe the solution you'd like** I noticed nginx-proxy-manager already supports custom-certs which is awesome! I would love to have an additional option in that dropdown in section "SSL Certificates" that could be named "Create self-signed certificate" and then routes this request to f.e. the linux-tool mkcert. https://blog.filippo.io/mkcert-valid-https-certificates-for-localhost/ ``` mkcert my-private-domain.lan ``` **Describe alternatives you've considered** I could run mkcert on my local machine and manually upload the cert-files into nginx-proxy-manager. **Additional context** I think I'm not the only user who runs a docker instance in private/lan and think this feature would support/help other users as well.
Author
Owner

@typoworx-de commented on GitHub (Sep 3, 2020):

As a short proof-of-concept I've run a shell-console on my nginx-proxy-manager docker instance trying this:

[root@docker-nginx-ssl-proxy:/usr/local/bin]# wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64

[root@docker-nginx-ssl-proxy:/usr/local/bin]# mv mkcert-v1.4.1-linux-amd64 mkcert

root@docker-nginx-ssl-proxy:/usr/local/bin]# mkcert *.typoworx.lan
Using the local CA at "/root/.local/share/mkcert" ✨

Created a new certificate valid for the following names 📜
 - "*.test.lan"

Reminder: X.509 wildcards only go one level deep, so this won't match a.b.typoworx.lan ℹ️

The certificate is at "./_wildcard.typoworx.lan.pem" and the key at "./_wildcard.typoworx.lan-key.pem" ✅
<!-- gh-comment-id:686349558 --> @typoworx-de commented on GitHub (Sep 3, 2020): As a short proof-of-concept I've run a shell-console on my nginx-proxy-manager docker instance trying this: ``` [root@docker-nginx-ssl-proxy:/usr/local/bin]# wget https://github.com/FiloSottile/mkcert/releases/download/v1.4.1/mkcert-v1.4.1-linux-amd64 [root@docker-nginx-ssl-proxy:/usr/local/bin]# mv mkcert-v1.4.1-linux-amd64 mkcert root@docker-nginx-ssl-proxy:/usr/local/bin]# mkcert *.typoworx.lan Using the local CA at "/root/.local/share/mkcert" ✨ Created a new certificate valid for the following names 📜 - "*.test.lan" Reminder: X.509 wildcards only go one level deep, so this won't match a.b.typoworx.lan ℹ️ The certificate is at "./_wildcard.typoworx.lan.pem" and the key at "./_wildcard.typoworx.lan-key.pem" ✅ ```
Author
Owner

@bitsvital commented on GitHub (Apr 22, 2021):

For now I use minica. It's super easy. Just spin up an ubuntu:20.04 docker. I have all the instructions written out. If you want the instructions just message me and I'll send them over to you.
https://github.com/jsha/minica

<!-- gh-comment-id:825078741 --> @bitsvital commented on GitHub (Apr 22, 2021): For now I use minica. It's super easy. Just spin up an ubuntu:20.04 docker. I have all the instructions written out. If you want the instructions just message me and I'll send them over to you. https://github.com/jsha/minica
Author
Owner

@WillJBrown commented on GitHub (May 16, 2021):

I'd be interested in those instructions if it automates the process a little more than what typoworx-de described

<!-- gh-comment-id:841887322 --> @WillJBrown commented on GitHub (May 16, 2021): I'd be interested in those instructions if it automates the process a little more than what typoworx-de described
Author
Owner

@jc21 commented on GitHub (May 16, 2021):

The mkcert binary is shipped with the docker image, but it's not used by the software yet. I was planning to add it as an option on the SSL dropdown, but other things have taken more priority. PR's are welcome :)

<!-- gh-comment-id:841890167 --> @jc21 commented on GitHub (May 16, 2021): The `mkcert` binary is shipped with the docker image, but it's not used by the software yet. I was planning to add it as an option on the SSL dropdown, but other things have taken more priority. PR's are welcome :)
Author
Owner

@bitsvital commented on GitHub (May 17, 2021):

I'd be interested in those instructions if it automates the process a little more than what typoworx-de described

Hi @WillJBrown ,
I actually created a docker image that does it for you. I have all the instructions typed out in the repository. You can use the docker image or just spin up a Ubuntu image yourself and the instructions are about the same. If you run into any problems, questions, or need any help just let me know. I’ll be more than happy to help you.
Here is the the docker image.
https://hub.docker.com/r/bitsvital/minica-bv

<!-- gh-comment-id:841971004 --> @bitsvital commented on GitHub (May 17, 2021): > I'd be interested in those instructions if it automates the process a little more than what typoworx-de described Hi @WillJBrown , I actually created a docker image that does it for you. I have all the instructions typed out in the repository. You can use the docker image or just spin up a Ubuntu image yourself and the instructions are about the same. If you run into any problems, questions, or need any help just let me know. I’ll be more than happy to help you. Here is the the docker image. [https://hub.docker.com/r/bitsvital/minica-bv](https://hub.docker.com/r/bitsvital/minica-bv)
Author
Owner

@WillJBrown commented on GitHub (May 18, 2021):

Thanks for that @bitsvital. I got it working today thanks to your page. you might like to clarify that the cert you have to share to clients is the root minica one whereas the one npm needs is the domain specific one. Also thanks to you @jc21 for npm - It's made all the local proxies I set up today so much easier. I don't know any web dev otherwise I would definitely work on a pull request to get this implemented. My knowledge is more in c#, fortran, python, etc. apologies.

<!-- gh-comment-id:843433737 --> @WillJBrown commented on GitHub (May 18, 2021): Thanks for that @bitsvital. I got it working today thanks to your page. you might like to clarify that the cert you have to share to clients is the root minica one whereas the one npm needs is the domain specific one. Also thanks to you @jc21 for npm - It's made all the local proxies I set up today so much easier. I don't know any web dev otherwise I would definitely work on a pull request to get this implemented. My knowledge is more in c#, fortran, python, etc. apologies.
Author
Owner

@bitsvital commented on GitHub (May 18, 2021):

@WillJBrown no problem. Thanks for the FYI. I will update that this evening. Feel free to contact me anytime if you need further assistance.

<!-- gh-comment-id:843437093 --> @bitsvital commented on GitHub (May 18, 2021): @WillJBrown no problem. Thanks for the FYI. I will update that this evening. Feel free to contact me anytime if you need further assistance.
Author
Owner

@Albonycal commented on GitHub (Jan 19, 2022):

any updates on this?

<!-- gh-comment-id:1016334998 --> @Albonycal commented on GitHub (Jan 19, 2022): any updates on this?
Author
Owner

@bonelifer commented on GitHub (Jul 27, 2022):

Having mkcert would be awesome as some of my homelab is local only.

<!-- gh-comment-id:1196213048 --> @bonelifer commented on GitHub (Jul 27, 2022): Having mkcert would be awesome as some of my homelab is local only.
Author
Owner

@ThomasHineXYZ commented on GitHub (Feb 4, 2023):

Is there any update for this?

<!-- gh-comment-id:1416645496 --> @ThomasHineXYZ commented on GitHub (Feb 4, 2023): Is there any update for this?
Author
Owner

@onlineapps-cloud commented on GitHub (Mar 18, 2023):

Any updates?

<!-- gh-comment-id:1474906198 --> @onlineapps-cloud commented on GitHub (Mar 18, 2023): Any updates?
Author
Owner

@tapionx commented on GitHub (Oct 21, 2023):

It would be nice to have this!

<!-- gh-comment-id:1773788767 --> @tapionx commented on GitHub (Oct 21, 2023): It would be nice to have this!
Author
Owner

@flavienbwk commented on GitHub (Dec 4, 2023):

Indeed it might be nice. It looks like it was possible before. Why was it removed ?

<!-- gh-comment-id:1839081956 --> @flavienbwk commented on GitHub (Dec 4, 2023): Indeed it might be nice. It looks like [it was possible before](https://github.com/NginxProxyManager/nginx-proxy-manager/issues/576#issuecomment-679076377). Why was it removed ?
Author
Owner

@github-actions[bot] commented on GitHub (Jul 8, 2024):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2212788969 --> @github-actions[bot] commented on GitHub (Jul 8, 2024): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@flavienbwk commented on GitHub (Jul 8, 2024):

Community wants to keep it open

<!-- gh-comment-id:2212866214 --> @flavienbwk commented on GitHub (Jul 8, 2024): Community wants to keep it open
Author
Owner

@onlineapps-cloud commented on GitHub (Jul 8, 2024):

agree with you.

<!-- gh-comment-id:2213114250 --> @onlineapps-cloud commented on GitHub (Jul 8, 2024): agree with you.
Author
Owner

@robnewport commented on GitHub (Jul 8, 2024):

Please keep this open and active.

<!-- gh-comment-id:2213530970 --> @robnewport commented on GitHub (Jul 8, 2024): Please keep this open and active.
Author
Owner

@W1BTR commented on GitHub (Sep 26, 2024):

This is still a much wanted feature! Would love to see this added.

<!-- gh-comment-id:2377251890 --> @W1BTR commented on GitHub (Sep 26, 2024): This is still a much wanted feature! Would love to see this added.
Author
Owner

@an0o0nym commented on GitHub (Sep 29, 2024):

I would also love to to see it working with NPM!

<!-- gh-comment-id:2381616815 --> @an0o0nym commented on GitHub (Sep 29, 2024): I would also love to to see it working with NPM!
Author
Owner

@github-actions[bot] commented on GitHub (May 5, 2025):

Issue is now considered stale. If you want to keep it open, please comment 👍

<!-- gh-comment-id:2849747702 --> @github-actions[bot] commented on GitHub (May 5, 2025): Issue is now considered stale. If you want to keep it open, please comment :+1:
Author
Owner

@flavienbwk commented on GitHub (May 5, 2025):

👍

<!-- gh-comment-id:2849748461 --> @flavienbwk commented on GitHub (May 5, 2025): 👍
Author
Owner

@tapionx commented on GitHub (May 5, 2025):

yes

<!-- gh-comment-id:2850676907 --> @tapionx commented on GitHub (May 5, 2025): yes
Author
Owner

@huco95 commented on GitHub (May 9, 2025):

👍

<!-- gh-comment-id:2867074911 --> @huco95 commented on GitHub (May 9, 2025): 👍
Author
Owner

@noto10 commented on GitHub (Jun 4, 2025):

👍

<!-- gh-comment-id:2940381707 --> @noto10 commented on GitHub (Jun 4, 2025): 👍
Author
Owner

@r-nd-m commented on GitHub (Jun 4, 2025):

👍

<!-- gh-comment-id:2940395778 --> @r-nd-m commented on GitHub (Jun 4, 2025): 👍
Author
Owner

@alexunderboots commented on GitHub (Jun 11, 2025):

<!-- gh-comment-id:2963762027 --> @alexunderboots commented on GitHub (Jun 11, 2025): +
Author
Owner

@itzTheMeow commented on GitHub (Aug 26, 2025):

@jc21 is this something I am able to work on? I saw elsewhere you were redoing the frontend in react, would this interfere?

<!-- gh-comment-id:3222198532 --> @itzTheMeow commented on GitHub (Aug 26, 2025): @jc21 is this something I am able to work on? I saw elsewhere you were redoing the frontend in react, would this interfere?
Author
Owner

@jc21 commented on GitHub (Aug 26, 2025):

Yeah it might interfere with the react rewrite. Given the explanation on #4525 wouldn't using a separate self-hosted CA be better? the only limitation is that this project doesn't properly support using a specific CA url in the certbot command on a per-certificate basis.

For example, in the test stack, I spin up StepCA container and PowerDNS when I request a cert for website.example.com it's able to issue a certificate locally. PowerDNS is only required for DNS01 certs. In order for this to work, these env vars are present:

LE_SERVER: 'https://ca.internal/acme/acme/directory'
REQUESTS_CA_BUNDLE: '/etc/ssl/certs/NginxProxyManager.crt'

If they could be defined on a per-certificate level in NPM, then you'd be set to provision your own stuff.

In my v3 prototype I was working on the principle of having CertificateAuthorities rows that would be selectable when requesting certs.

A little bit off topic but I know this q is going to come up: Instead of pumping a lot of effort finishing v3 I'm trying to backport concepts back into v2 slowly until it is eventually v3. The first thing is React.

<!-- gh-comment-id:3222220305 --> @jc21 commented on GitHub (Aug 26, 2025): Yeah it might interfere with the react rewrite. Given the explanation on #4525 wouldn't using a separate self-hosted CA be better? the only limitation is that this project doesn't properly support using a specific CA url in the certbot command on a per-certificate basis. For example, in the [test stack](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/develop/docker/docker-compose.ci.yml), I spin up StepCA container and PowerDNS when I request a cert for `website.example.com` it's able to issue a certificate locally. PowerDNS is only required for DNS01 certs. In order for this to work, these env vars are present: ``` LE_SERVER: 'https://ca.internal/acme/acme/directory' REQUESTS_CA_BUNDLE: '/etc/ssl/certs/NginxProxyManager.crt' ``` If they could be defined on a per-certificate level in NPM, then you'd be set to provision your own stuff. In my v3 prototype I was working on the principle of having [CertificateAuthorities](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/v3/backend/embed/migrations/postgres/20201013035318_initial_schema.sql#L69) rows that would be [selectable when requesting certs](https://github.com/NginxProxyManager/nginx-proxy-manager/blob/v3/backend/embed/migrations/postgres/20201013035839_initial_data.sql#L65). _A little bit off topic but I know this q is going to come up: Instead of pumping a lot of effort finishing v3 I'm trying to backport concepts back into v2 slowly until it is eventually v3. The first thing is React._
Author
Owner

@itzTheMeow commented on GitHub (Aug 26, 2025):

The certificate authority table approach seems best. Currently the way I am generating certificates is using openssl, rather than a URL or ACME server.

openssl x509 -req -in example.internal.csr -CA exampleCA.pem -CAkey exampleCA.key \
  -CAcreateserial -out example.internal.crt -days 825 -sha256 -extfile example.internal.ext
<!-- gh-comment-id:3222350075 --> @itzTheMeow commented on GitHub (Aug 26, 2025): The certificate authority table approach seems best. Currently the way I am generating certificates is using openssl, rather than a URL or ACME server. ```bash openssl x509 -req -in example.internal.csr -CA exampleCA.pem -CAkey exampleCA.key \ -CAcreateserial -out example.internal.crt -days 825 -sha256 -extfile example.internal.ext ```
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/nginx-proxy-manager-NginxProxyManager#496
No description provided.