Cerbot command flag not found

I am trying to fully automate installation of the letsencrypt certificate using the following command:

certbot certonly --duplicate --nginx --preferred-challenges http -d $(domain_name) --register-unsafely-without-email --agree-tos --config-dir /etc/ssl/certs/ --cert-name certificate-folder

For the first time, I execute the command, ( where $(domain_name) is comma seperated value for domains) it workd without asking anything. Just fine.

But the second time I executed the command, it ask for

What would you like to do?


1: Keep the existing certificate for now
2: Renew & replace the cert (limit ~5 per 7 days)


Select the appropriate number [1-2] then [enter] (press 'c' to cancel):

I search the documentation but couldn't find approprate flage or option to chose number 1 or 2.
Is there any flag to accept number 1 ?

1 Like

Hi @pratikgautm

if you want to renew a certificate, please use only

certbot renew

nothing else. And please don't use --duplicate in a renew command, you will hit the limit.

--duplicate in combination with an existing cert-name: How should that work? Your command is wrong, so Certbot asks.

1 Like

While @JuergenAuer's suggestion above is certainly the best course of action for renewal, if you are trying to automate initial acquisition, you might try:

certbot --nginx -d "$(domain_name)" --config-dir /etc/ssl/certs --keep

You only want to use --agree-tos and --register-unsafely-without-email when creating a new ACME account, which only needs to be done the first time you run certbot.

1 Like

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