From d8cf7ff89fee58a8506d5d26bc05aa771cc94f2a Mon Sep 17 00:00:00 2001 From: CHEF-KOCH Date: Mon, 27 Feb 2023 11:45:32 +0100 Subject: [PATCH] Inital bumper --- README.md | 59 +++++++++++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 57 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index bc7ee88..9ec601c 100644 --- a/README.md +++ b/README.md @@ -1,3 +1,58 @@ -# LetsEncryptCertificate +# Let’s Encrypt certificates without exposing port 80 and 443 trough DNS record -Create Let's Encrypt certificate without exposing port 80 and 443 for renewal process. \ No newline at end of file + +## Instructions on SSH end + +Replace yourdomain.org with your actual domain. + +- sudo -s +- apt install -y certbot +- certbot --manual --preferred-challenges dns certonly --elliptic-curve secp384r1 -d yourdomain.org + + + +Follow the console instruction and give GoDaddy or whatever you use your TXT record with the provided data. + + +Hit enter. + + +## Certificates are stored here +- Certificate is saved at: /etc/letsencrypt/live/yourdomain.org/fullchain.pem +- Key is saved at: /etc/letsencrypt/live/yourdomain.org/privkey.pem + + +## Cert paths +- CERT: /etc/letsencrypt/live/yourdomain.org//cert.pem +- CHAIN: /etc/letsencrypt/live/yourdomain.org//chain.pem +- FULLCHAIN: /etc/letsencrypt/live/yourdomain.org//fullchain.pem +- PRIVKey: /etc/letsencrypt/live/yourdomain.org//privkey.pem + + +## Add cron job for reneww process and restart Nginx +- crontab -e +- #@weekly /usr/bin/certbot renew > /dev/null 2>&1 +- @weekly /usr/bin/certbot renew --renew-hook 'systemctl restart nginx.service' > /dev/null 2>&1 + + +## Adjust Renewable procedure - only one single time needed +- nano /etc/letsencrypt/renewal/yourdomain.org.conf +- authenticator = standalone + + +## Start timers and verify the status to ensure its running +- systemctl enable certbot.timer +- systemctl restart certbot.timer +- systemctl status certbot.timer + + +## Logs +- /var/log/letsencrypt/letsencrypt.log + + +## Delete old certificates if not needed anymore +- certbot delete + + +## Close ufw ports +You can remove Port 80, 443 is usually needed anyway for e.g. Nextcloud or whatever you use. \ No newline at end of file