Adding subdomain to certificate

I have a domain and a subdomain
both have different certificate right now.
can I add the subdomain to the domain for them to both have one certificate, safely with the following code?
/usr/local/certbot/certbot-auto -t --renew-by-default --agree-tos --webroot -w /etc/letsencrypt/webroot --server -m --expand -d,, certonly

Hi @hnaseri,

Yes. Three notes:

--renew-by-default is not useful in this situation. We felt it had a misleading name so in newer versions it's instead called --force-renewal. It doesn't make sense in combination with--expand. If you're interested in more about what all of these options do, I tried to explain it in detail at

② It also isn't necessary to specify --agree-tos, --server, or -m after the first time that you've used Certbot, although it isn't harmful.

③ A random one of the certificates will be expanded to include the names (you can choose which one with --cert-name, if you want). The other certificate will still exist, and will still be automatically renewed when it's near to expiry if you run certbot-auto renew. You might choose to delete this old certificate afterward if you don't need it anymore. You can find out about which certificates you have, what names they cover, and what their certnames are with certbot-auto certificates.

1 Like

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.