certbot

managing mutiple certbot certificates? changing cert storage without breaking?


I have several domains, but not a very large number. I have an apache instance running on Ubuntu 20.04.6 LTS. I would like to clean up my certificates management, but I do not want to break all of my websites as I do this. The cert information is below. Which of these can be safely deleted?

Is the usual practice to have one certificate per domain? One can, of course, have a certificate for several domains on one server, but then one cannot move the site to another server. Or can one? By copying the certificate files to the new server? And multiple certificates means multiple things to manage. Hmmm.

- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
Found the following certs:
  Certificate Name: AAAAA.com-0001
    Serial Number: 4ff20...9b07e
    Key Type: ECDSA
    Domains: AAAAA.com BBBBB.com BBBBB.org opengovaccess.org CCCCC.com DDDDD.org
    Expiry Date: 2025-04-07 00:52:13+00:00 (VALID: 30 days)
    Certificate Path: /etc/letsencrypt/live/AAAAA.com-0001/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/AAAAA.com-0001/privkey.pem
  Certificate Name: AAAAA.com
    Serial Number: 4842d...a19f0
    Key Type: ECDSA
    Domains: AAAAA.com
    Expiry Date: 2025-05-30 05:26:03+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/AAAAA.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/AAAAA.com/privkey.pem
  Certificate Name: BBBBB.com-0001
    Serial Number: 41ee1...f1124
    Key Type: ECDSA
    Domains: BBBBB.com
    Expiry Date: 2025-05-30 05:26:11+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/BBBBB.com-0001/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/BBBBB.com-0001/privkey.pem
  Certificate Name: BBBBB.org-0001
    Serial Number: 3731f...92edd
    Key Type: RSA
    Domains: BBBBB.org
    Expiry Date: 2025-05-30 05:26:18+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/BBBBB.org-0001/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/BBBBB.org-0001/privkey.pem
  Certificate Name: BBBBB.org
    Serial Number: 3731f...92edd
    Key Type: RSA
    Domains: BBBBB.org
    Expiry Date: 2025-05-30 05:26:18+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/BBBBB.org-0001/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/BBBBB.org-0001/privkey.pem
  Certificate Name: opengovaccess.org
    Serial Number: 4d17f...41c7b
    Key Type: ECDSA
    Domains: opengovaccess.org
    Expiry Date: 2025-05-30 05:26:24+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/opengovaccess.org/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/opengovaccess.org/privkey.pem
  Certificate Name: CCCCC.com
    Serial Number: 38dae...56001
    Key Type: RSA
    Domains: CCCCC.com www.CCCCC.com
    Expiry Date: 2025-05-30 05:26:36+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/CCCCC.com/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/CCCCC.com/privkey.pem
  Certificate Name: DDDDD.org
    Serial Number: 39ffa...a7851
    Key Type: ECDSA
    Domains: DDDDD.org
    Expiry Date: 2025-05-30 05:26:46+00:00 (VALID: 83 days)
    Certificate Path: /etc/letsencrypt/live/DDDDD.org/fullchain.pem
    Private Key Path: /etc/letsencrypt/live/DDDDD.org/privkey.pem
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -

Solution

  • Certificate cleaning recommendation:

    1. Identify redundant certificates
    1. What Can You Safely Delete?

    Based on your certificates:

    # check Apache configs: 
    ls -al /etc/apache2/sites-available/)
    
    sudo certbot delete --cert-name AAAAA.com-0001
    
    sudo certbot delete --cert-name BBBBB.org
    # (or BBBBB.org-0001, depending on which is unused)
    
    1. Best Practices for Certificate Management