How to delete a cert and install a new one on ubuntu nginx

server: digitalocean droplet, ubuntu 20, nginx

/etc/nginx/sites-available:
total 16
drwxr-xr-x 2 root root 4096 Apr 15 21:57 .
drwxr-xr-x 8 root root 4096 Apr 22 20:01 ..
-rw-r--r-- 1 root root 3137 Apr 15 21:57 default
-rw-r--r-- 1 root root  139 Mar 31 09:18 example.com
/etc/nginx/sites-enabled:
total 8
drwxr-xr-x 2 root root 4096 Oct 26  2020 .
drwxr-xr-x 8 root root 4096 Apr 22 20:01 ..
lrwxrwxrwx 1 root root   34 Oct 25  2020 default -> /etc/nginx/sites-available/default
Saving debug log to /var/log/letsencrypt/letsencrypt.log

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: b.procore.vn
    Domains: b.procore.vn
    Expiry Date: 2023-07-21 19:01:53+00:00 (VALID: 77 days)
    Certificate Path: /etc/letsencrypt/live/b.procore.vn/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/b.procore.vn/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

the current domain is b.procore.vn
I want to delete the cert for that domain, and install a new cert for this domain api.procore.vn

Or is it possibe to a new domain to the current certificate? if that so, I want to add my new domain to the current cert

certbot delete --cert-name b.procore.vn

An existing certificate cannot be modified, but you can get a new cert with multiple domains
certbot certonly -d b.procore.vn,api.procore.vn <other options>

2 Likes

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