Skip to main content
  1. Posts/

SSL certificates with NGINX Proxy Manager (IONOS or Hetzner)

·674 words·4 mins· loading · loading ·
Table of Contents

Introduction
#

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 (Official NGINX Proxy Manager setup).


DNS and API Token
#

Below you find the instructions for Hetzner or IONOS. Select your preferred provider.

Hetzner
  1. First of all, we start in Hetzner. Log into your account and switch to the “DNS” section in the top right:
  2. hetzner-dns-1
  3. If you don’t already got your domain in the Hetzner DNS Console, set it up with “Add new zone:
  4. hetzner-dns-2.
  5. Enter your DNS zone (in my example “torminal.com”) and click “continue”. You can leave “Auto scanning for records” activated.
  6. Now Hetzner will scan for some time, until it is finished.
  7. Click continue again - you will see “Verify ownershop for your domain”.
  8. You have to add the name servers from hetzner to the hoster of your domain. Please look into guides for your specific hoster (something like: “{Name of hoster} add custom nameservers for domain”).
  9. After that, your new zone is available in the DNS console and Hetzner is now the main DNS manager for your domain.
  10. In the dashboard of the DNS Console, click on “Manage API tokens” - we need the token to set up Lets Encryt / certbot later.
  11. hetzner-api-1
  12. Enter a name for your token in “Token name” and click on “Create Access Token”.
  13. Safe the token securely.

IONOS
  1. First of all, we start in IONOS. Log into your account.
  2. If not already done, you need to get access to the IONOS API at IONOS API Shop
  3. “Buy” the free API Add-On
  4. Next go to the API key portal
  5. Add a new key and give it a name (for example: “homelab”)
  6. Safe the token securely.


NGINX Proxy Manager: Set up SSL Certificate
#

  1. Open your NGINX Proxy Manager in the browser and login.
  2. Switch to “SSL Certificates”.
  3. nginx-1
  4. Click on “Add SSL Certificate” on the top right.
  5. Select “Lets Encrypt”.
  6. Enter your domain name and an email address you want to use (required by Lets Encrypt).
  7. Select “Use a DNS Challenge” a. As “DNS Provider” select the provider you used (IONOS or Hetzner). b. A new field “Credentials Fle Content” will pop up. c. Enter your API Token that you created in the beginning d. For IONOS you need the prefix and the key. Endpoint is filled for you:
    dns_ionos_prefix = myapikeyprefix
    dns_ionos_secret = verysecureapikeysecret
    dns_ionos_endpoint = https://api.hosting.ionos.com
    
    e. For Hetzner you just need your key:
    dns_hetzner_api_token = verysecureapikeysecret
    
  8. Example:
    nginx-2
  9. Confirm the Terms of service and click on save.
  10. 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 in Hetzner 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.
  11. After the processing has (hopefully) succesfully finished, you have a new SSL Certificate in NGINX Proxy Manager, that you can use for your hosts.
  12. 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 in NGINX Proxy Manager when requesting the SSL Cert:

  • is your API Token correctly entered?
  • can the host NGINX Proxy Manager runs on reach the API service of Hetzner / IONOS?
  • 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.
torminal
Author
torminal
IT enthusiast

Related

Homelab management with a telegram chatbot
594 words·3 mins· loading · loading
This project gives you the possibility to run shell commands on a linux host from a telegram bot.
Windows: move locked EFI partition
436 words·3 mins· loading · loading
Guide on how to move the EFI partition in Windows when it blocks extending another partition.
Zabbix Template: Monitor Wordpress updates of multiple websites
251 words·2 mins· loading · loading
Monitoring of available Wordpress updates (Core, Plugins and Themens) with Zabbix.