|

Adding domains to existing Letsencrypt certificate using Certbot.

If you want to add one or more (sub)domains to an existing Letsencrypt certificate, you can use Certbot with the “–cert-name” option to accomplish this.

# certbot certonly --cert-name existing-domain.com --webroot -w /var/www/virtual/existing-domain.com/htdocs/ -d existing-domain.com -d www.existing-domain.com -d first-new-domain.com -d www.first-new-domain.com -d second-new-domain.net -d www.second-new-domain.net -d third-new-domain.org -d www.third-new-domain.org

Make sure you have added all domains to the Web server configuration file and that an A record has been created in the DNS server pointing to that Web server.

Furthermore, when requesting the renewed certificate, you must also specify the domains for which the Letsencrypt certificate was initially issued, otherwise they will be removed from the new certificate, unless this is clearly intended, such as for a subdomain that is no longer needed.