Zum Inhalt

Home Assistant - Let's Encrypt Zertifikate automatisch erstellen

Für Home Assistant lässt sich mit dem Add-on Let's Encrypt ein eigenes SSL-Zertifikat erstellen, um die Kommunikation zwischen dem Server und den Clients abzusichern.

Voraussetzung

Let's Encrypt

Der Hosting Anbieter Hetzner stellt seine Hetzner DNS Console kostenfrei zur Verfügung. Das Tool unterstützt die acme-Challenge. 1

Das Tool verwende ich bereits, um automatisiert SSL-Zertifikate für meine Nextcloud erstellen zu lassen. Hetzner DNS Console

Die Erweiterung Let's Encrypt lässt sich direkt aus dem Add-ons Store für die eigen Home Assistant installieren:

Einstellungen --> Add-ons --> ...

Let's Encrypt im Add-ons Store

Image caption: Let's Encrypt im Add-ons Store

Nach der Installation kann das Add-on direkt aufgerufen werden.

Let's Encrypt - Tab Informationen

Image caption: Let's Encrypt - Tab Informationen

Die Konfiguration ist einfach. Im Tab Dokumentation werden alle unterstützen Provider gelistet, die die acme-Challenge anbieten. 1

Let's Encrypt - Tab Konfiguration

Image caption: Let's Encrypt - Tab Konfiguration

Die Einstellungen sind wie im Screenshot einzutragen.

  • Domains: homeassistant.example.com
  • Email: homeassistant@example.com
  • Challenge: dns

Im Abschnitt DNS ist der Code-Block aus der Dokumentation einzutippen. hetzner-personal-access-token ist durch den eigenen API-Token zu ersetzen.

provider: dns-hetzner
hetzner_api_token: hetzner-personal-access-token

Die Konfiguration ist damit bereits abgeschlossen. Ein Blick in den Tab Protokoll zeigt, ob alles korrekt funktioniert.

s6-rc: info: service s6rc-oneshot-runner: starting
s6-rc: info: service s6rc-oneshot-runner successfully started
s6-rc: info: service fix-attrs: starting
s6-rc: info: service fix-attrs successfully started
s6-rc: info: service legacy-cont-init: starting
cont-init: info: running /etc/cont-init.d/file-structure.sh
cont-init: info: /etc/cont-init.d/file-structure.sh exited 0
s6-rc: info: service legacy-cont-init successfully started
s6-rc: info: service legacy-services: starting
services-up: info: copying legacy longrun lets-encrypt (no readiness notification)
s6-rc: info: service legacy-services successfully started
[21:43:19] INFO: Selected DNS Provider: dns-hetzner
[21:43:19] INFO: Use propagation seconds: 60
[21:43:20] INFO: Detecting existing certificate type for homeassistant.example.com
Saving debug log to /var/log/letsencrypt/letsencrypt.log
[21:43:25] INFO: Existing certificate using 'ecdsa' key type.
Saving debug log to /var/log/letsencrypt/letsencrypt.log
Renewing an existing certificate for homeassistant.example.com
Waiting 60 seconds for DNS changes to propagate
Successfully received certificate.
Certificate is saved at: /data/letsencrypt/live/homeassistant.example.com/fullchain.pem
Key is saved at:         /data/letsencrypt/live/homeassistant.example.com/privkey.pem
This certificate expires on 2025-06-26.
These files will be updated when the certificate renews.
NEXT STEPS:
- The certificate will need to be renewed before it expires. Certbot can automatically renew the certificate in the background, but you may need to take steps to enable that functionality. See https://certbot.org/renewal-setup for instructions.
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
If you like Certbot, please consider supporting our work by:
 * Donating to ISRG / Let's Encrypt:   https://letsencrypt.org/donate
 * Donating to EFF:                    https://eff.org/donate-le
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
s6-rc: info: service legacy-services: stopping
s6-rc: info: service legacy-services successfully stopped

...


Gib mir gerne einen Kaffee ☕ aus 😀

Wenn dir meine Beiträge gefallen und geholfen haben, dann kannst du mir gerne einen Kaffee ☕️ ausgeben.

Donation via PayPalDonation via LiberaPay

Donation via Bitcoin
Bitcoin Address: bc1qfuz93hw2fhdvfuxf6mlxlk8zdadvnktppkzqzj

Source
  • Teile des Artikels wurden mit maschineller Hilfe erstellt.
  • Foto von Micah Williams Unsplash