Adding more certificates to existing letsencrypt installation

I used the following command to set up letsencrypt with all my domains

docker run -d \
 --restart always \
 --name=letsencrypt \
 -h letsencrypt \
 -p 80:80 \
 -p 443:443 \
 --cap-add=NET_ADMIN \
 -e PUID=1001 \
 -e PGID=1001 \
 -e TZ=Asia/Nicosia \
 -e URL=domain1 \
 -e SUBDOMAINS=www, \
 -e VALIDATION=http \
 -e \
 -e EXTRA_DOMAINS=domain2,domain3,domain4,domain5 \
 -v letsencrypt:/config \

Works great by the way, thanks for your hard work.

Now I want to add a couple more domains, but I’m afraid if I run the same command again, with the new domains I want to add, it might mess up the existing domains and certificates I have running.

What is the correct way of adding a few more domains (and their certificates of course) to an existing letsencrypt installation?


The only way to do it is to remove the current container and then run the command again with the new domains added. Then you will see if it works.

I understand that trying a bunch of things will eventually give me the answer. But I wanted to avoid that, so I asked the question, what is the proper way of doing this?

That is the proper way of doing this. as @saarg mentioned, you need to destroy the current container you’ve created and re-run the command you used with the additional domains you want to setup.

Won’t that request new certificates for all the domains from lesencrypt? Or will it find the existing certificates and not request new ones?

No unless you end up using a different volume for your /config mount. When the container boots, it will detect the changes you made and request certs* for the extra domains.

*It’s not actually multiple certs, it’s one cert that is useable with all your domains.

great, thanks for your help!