-
Sign up for a DuckDNS account at https://www.duckdns.org/
-
Create a subdomain and point it to the same ipv4_address you used for the caddy container in the docker-compose.yml file
-
Review DuckDNS details at https://www.duckdns.org/spec.jsp and https://go-acme.github.io/lego/dns/duckdns/
-
SSH to your QNAP NAS
-
Run the following to create your docker network, change IP and subnet to suit your needs
docker network create --driver=qnet --ipam-driver=qnet --ipam-opt=iface=bond0 --subnet 192.168.0.0/23 --gateway 192.168.1.1 qnet-static
- Make dynamic links to /share/docker-data/vw-caddy/caddy and /share/docker-data/vw-caddy/data/lego so they exist in your $PATH
ln -s /share/docker-data/vw-caddy/caddy /usr/bin/caddy
ln -s /share/docker-data/vw-caddy/data/lego /usr/bin/lego
- You can have caddy check the formatting, and even have it write the file for you to ensure Caddyfile has proper formatting
cd /share/docker-data/vw-caddy/config
caddy fmt -overwrite Caddyfile
- No matter how many times I tried, no matter what I did I could not get Caddy working with automatic HTTPS with a QNAP NAS
- This is why my instructions say to use Lego yourself to obtain your own SSL Certificate and SSL Key. Once I did this, Caddy, Vaultwarden and DuckDNS worked flawlessly for me
cd /share/docker-data/vw-caddy/data
DUCKDNS_TOKEN=12345678-aaaa-bbbb-cccc-dddddddddddd lego --accept-tos --dns duckdns -d DOMAIN.duckdns.org -m [email protected] run
- When all files and folders are in the right place, run the following:
docker-compose up -d
-OR-
-
Paste the docker-compose.yml in to
QNAP Control Panel
>
Container Station
>
Create
>
Create Application
-
Application Name: vaultwarden
-
YAML: (PASTE the content of
docker-compose.yml
file here, make sure fill-in the Environment Variables properly) -
Click
Validate YAML
button -
Click
Create
button -
Now, wait for a little bit for QNAP's Container Station to get everything operational, you can try doing things via Portainer as well, it is quite useful.
-
When everything is all said and done, you can check the status via Container Station Overview, or run
docker ps -a
in SSH session -
It is a good idea to view logs of caddy and vaultwarden containers when troubleshooting
-
You can have caddy validate the Caddyfile, but you would do this later when caddy is actually running. Also you would do this within the caddy Docker container:
docker exec -it caddy /bin/sh
cd /etc/caddy/
caddy validate -config /etc/caddy/Caddyfile