mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2026-04-25 17:35:52 +03:00
[GH-ISSUE #683] Export letsencrypt certificates #578
Labels
No labels
awaiting feedback
bug
cannot reproduce
dns provider request
duplicate
enhancement
enhancement
enhancement
good first issue
help wanted
invalid
need more info
no certbot plugin available
product-support
pull-request
question
stale
troll
upstream issue
v2
v2
v2
v3
wontfix
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
starred/nginx-proxy-manager-NginxProxyManager#578
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Originally created by @dgeordgy21 on GitHub (Nov 2, 2020).
Original GitHub issue: https://github.com/NginxProxyManager/nginx-proxy-manager/issues/683
Hello,
Can you add a link to download each certificate generated by letsencrypt? It's usefull to put it in adguard for exemple DNS-over-TLS.
privkey.pem: the private key for your certificate.fullchain.pem: the certificate file used in most server software.Thes files are located in letsencrypt/live/npm-XX/
Thank you in advance.
@samborambo commented on GitHub (Nov 12, 2020):
I would also like to be able to link to the cert folder based on the site name. Its useful for npm to handle renewal for certs for services other than web.
I can see where the numbered folders map to but having site name folders would ease configuration. Also concerned numbering may change, breaking cert paths.
@Salamafet commented on GitHub (Dec 7, 2020):
Same here.
I use NPM on my Synology. I need to import the generate certificate for use it with Drive Client (desktop app).
The Drive App is not using a web protocol.
@coronas2k commented on GitHub (Dec 13, 2020):
First of all great project, really top-notch!
This feature would be helpful, as I'm using wildcard certs which I wish I could export from the UI.
Meanwhile, anyone using the docker image can copy the files from the container to the host with the following commands:
docker cp NPM_CONTAINER_ID:/etc/letsencrypt/archive/npm-X ./Replace NPM_CONTAINER_ID with your container id, find it by running docker ps
Replace X with the order of the certificate, in my case I have one domain so it's 1
Example:
docker cp nginx_proxy_app_1:/etc/letsencrypt/archive/npm-1 ./This will copy the certs from the container to the current working directory.
@cromulus commented on GitHub (Mar 17, 2021):
If you have many sites and many ssl certs, it's difficult to discern which npm-[0-9]* folder contains the certificates you want.
I iterate through the nom folders and run
openssl x509 -noout -subject -in cert.pembut it's sub-optimal.@chaptergy commented on GitHub (May 12, 2021):
Duplicate of https://github.com/jc21/nginx-proxy-manager/issues/404
@Qaezar commented on GitHub (Aug 12, 2021):
+1, would love this too ! ;)
Thank you ^^
@samborambo commented on GitHub (Aug 12, 2021):
I solved this with a python script to copy out the certs to named folders. Not very well tested.
https://pastebin.com/gfAu5X8B
@marrobHD commented on GitHub (Feb 13, 2022):
I would also like to see this. I need to copy the SSL certificates over to mailcows SSL folder.
A better cert folder naming would be useful for building a script that does what I need.
Until now I'm turning off SSL on npm for the mailcow domains when the SSL certs run out. I run certbot on mailcows side and add ssl back to npm mailcow domains.
@captainabloc commented on GitHub (Feb 26, 2022):
Hi all,
here a small script for retrieving latest Fullchain and Privatekey from NPM.
Usefull for example for Adguardhome certificates renewal:
certificates numbers found in
/data/database.sqlitehope this can be useful
@balya commented on GitHub (Jan 11, 2023):
I use NPM on my Unaraid server.
Wrote a small script to transfer keys to another server with OPNsense. Perhaps someone will come in handy.
I run the script according to the schedule through the plugin
User Scripts.@Moonbase59 commented on GitHub (Mar 29, 2023):
@Balya Thanks for your suggestion!
I run Prosody as a chat server (not on the NGINX Proxy Manager machine) and also need to transfer the certs to Prosody. I found the numbering scheme you use above not reliable, especially when making NPM configuration changes. So I opted for actually reading the relevant parts of NPM’s
.conffiles. (Excuse my bad Python…)This script I run via root’s crontab on the NPM machine every night at 3:00 a.m. like so:
And on the Prosody machine, since it can’t reload correctly, at 3:10 a.m., also via root’s crontab:
Works well so far. Maybe this can help others, too.
@smooth-baking-powder commented on GitHub (May 20, 2023):
If i use your script and edit the paths and username etc. i get this Error:
Traceback (most recent call last):
File "/root/./turn-ssl.sh", line 36, in
sftp.put(fullchain, '/opt/coturn/cert/' + target_host + '.fullchain.pem')
NameError: name 'fullchain' is not defined
No idea, how i can solve it
@LazyGatto commented on GitHub (Aug 16, 2023):
I tried to write a sample script to export certificates from Nginx Proxy Manager for use with mailcow mail server. You can adapt it to use with any application. https://github.com/LazyGatto/npm-cert-export
@psychogun commented on GitHub (Aug 20, 2023):
This is my take on it; one VM with NPM container (192.168.0.44)- another VM with a ZNC bouncer from where the bash script is run in a cron job from the root user, every 90 days. First execution is on the 25th of September 2023.
If you go to SSL Certificates in NPM, you can see which #number the certificate it is listed as (
/home/yoyo/podman/npm/letsencrypt/live/npm-13) when you download it manually.Cron:
crontab -e 0 0 25 9 */90 /root/fullchain_download.shI am running the ZNC bouncer as a regular user (
wwhite) as a systems service (systemctl --user start container-znc.service) and I had some issues writing the files in to the shared directory with podman from that user. Therefore I opted to copy therootuser's public key in to.ssh/authorized_keyson theyoyouser running NPM on the other machine.