Thanks for these great instructions, after trying multiple other things for days this is what actually worked to get the secure external https connection working for my homeasssistant. I have an odd setup of running HA on a macmini that dual boots into MACOS and Ubuntu, and HA runs in a docker container on Ubuntu, so typical instructions and documentation generally don’t work for me. But my mac mini, although old, is SO much faster then a PI. One thing I ran across was letsencrypt apparently was recently renamed to “swag” due to a trademark issue. I wasn’t able to get this working at first but that’s one of the things I updated and now it works. Also I couldn’t get things working on ports 180 and 1443, not sure what I was doing wrong or if it was in my router’s port forwarding settings, but since I don’t have anything used on ports 80 or 443 I just stuck with those and everything is now working with those changes. I used the config file from the top post exactly with the replacements for mydomain obtained from duckdns and the replacement of “hostip” with my computer’s actual local 192.etc IP address This was my docker-compose if anyone runs into similar problems, or wants to suggest anything else that should be updated with this “swag” name change. :
version: "2.1"
services:
swag:
image: linuxserver/swag
container_name: swag
restart: unless-stopped
cap_add:
- NET_ADMIN
volumes:
- /home/user/docker/swag/config:/config
- /etc/localtime:/etc/localtime:ro
environment:
- PGID=1000 (replace with yours obtained from $ id username command)
- PUID=1000 (replace with yours obtained from $ id username command)
- [email protected]
- URL=MYDOMAIN.duckdns.org
- SUBDOMAINS=wildcard
- VALIDATION=duckdns
- TZ=America/New_York
- DUCKDNSTOKEN=XXXXXXX (replace with your token from duckdns.org)
ports:
- "80:80"
- "443:443"