I see a lot of people struggling with setting up
https://in their homelab - for some cases, you cant avoid it (for example Vaultwarden). With this guide you can automatically create and renew SSL Certificates for your homelab webserver with the help of Lets Encryt and the NGINX Proxy Manager.
Requirements #
- a domain you own
- an account at Hetzner or IONOS
- NGINX Proxy Manager
I won’t explain the setup of the NGINX Proxy Manager, there are plenty of guides you can find online (Link: Official NGINX Proxy Manager setup).
DNS and API Token #
Below you find the instructions for Hetzner or IONOS. Select your preferred provider.
This guide got updated to the new “Hetzner Console”, “Hetzner DNS” will be discontinued by Hetzner (https://dns.hetzner.com).Hetzner
IONOS
NGINX Proxy Manager: Set up SSL Certificate #
- Open your NGINX Proxy Manager in the browser and login.
- Switch to “Certificates”.
-
- Click on “Let’s Encrypt via DNS” on the top right.
- Enter your domain name you want to use
- Select “Use a DNS Challenge” a. As “DNS Provider”, choose your chosen provider (Hetzner Cloud or IONOS) b. A new field “Credentials Fle Content” will pop up. c. Enter your API Token that you created in the beginning from Hetzner or IONOS as required from NGINX Proxy Manager.
-
- Confirm the Terms of service and click on save.
- Now it will process for some time. The NGINX Proxy Manager will create a TXT DNS entry for your domain with the help of the API to validate the DNS challenge for Lets Encrypt. If you are interested, here are more informations about that challenge from the official Lets Encrypt Docs.
- After the processing has (hopefully) succesfully finished, you have a new SSL Certificate in NGINX Proxy Manager, that you can use for your hosts.
- NGINX Proxy Manager will renew the SSL Certificate automatically for you in the future (as long, as you dont delete it).
Fix issues #
If you get an error when requesting the SSL Cert:
- is your API Token correctly entered and safed?
- can your server reach the API service of Hetzner / IONOS?
- Hetzner: https://dns.hetzner.com/api/v1
- IONOS: https://api.hosting.ionos.com/dns
- For Hetzner: did you successfully add your domain to the DNS console before and set the Hetzner nameservers at your domainhoster? You can test that by manually adding an entry in the DNS Console of Hetzner and use an online DNS lookup tool to check, if the record was successfully registered.