How to add a subdomain to an existing certificate using certbot

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


I have a directory on my server called dev that I want to reference via

So to do that, I issued the following command

certbot -d,, --expand

Key takeaways:

  1. 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.
  2. 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.

By |2018-02-28T06:07:20+00:00February 28th, 2018|blog|5 Comments

About the Author:

Andrew Golightly is the lead web developer here at Golightly+. He is a passionate fullstack JavaScript developer. He also runs an Empath Community.


  1. midnight July 30, 2018 at 6:43 pm - Reply

    Very simple and effective!
    Thank you so much. :))

    I thought it was going to be a bigger struggle. 🤣

  2. Solomon Antoine September 19, 2018 at 2:41 pm - Reply

    Thank you so much man! Couldn’t be more simple

  3. Rebar November 28, 2018 at 9:38 am - Reply

    You saved my whole life ^^

    Thank you soooo…oooo much ❤️

  4. Hoa August 8, 2019 at 2:53 am - Reply

    Thanks you sooooooo much

  5. Steath September 18, 2019 at 10:56 am - Reply

    Very useful! Thank you for this!

Leave A Comment