You’re probably reading this because you already have a Let’s Encrypt certificate issued using certbot for a domain, and now want to add-on subdomains.
If you want to create a new certificate, have a look at the end of this article.
In my case I already had a certificate which covered
- golightlyplus.com
- www.golightlyplus.com
I have a directory on my server called dev that I want to reference via dev.golightlyplus.com.
So to do that, I issued the following command
certbot -d golightlyplus.com,dev.golightlyplus.com,www.golightlyplus.com --expand
Key takeaways:
- re-include every domain name you want on that certificate again. I forgot www. the first time. No biggie, just re-run with all the domains you want.
- don’t forget to add
--expand
to the end
After reading around on the net a bit, I found this solution on this GitHub thread.
8 responses to “How to add a subdomain to an existing certificate using certbot”
Very simple and effective!
Thank you so much. :))
I thought it was going to be a bigger struggle. 🤣
Thank you so much man! Couldn’t be more simple
You saved my whole life ^^
Thank you soooo…oooo much ❤️
Thanks you sooooooo much
Very useful! Thank you for this!
How to make this for any subdomain like *.domain.com ??
Looks like wildcard certs are now supported. This write-up looks useful https://medium.com/@saurabh6790/generate-wildcard-ssl-certificate-using-lets-encrypt-certbot-273e432794d7
Very useful post about Ssl Certificate.