Skip to content

certbro

certbro is an open-source command-line tool for the regfish TLS API and DNS API. It bundles ordering, domain validation, download, key rotation, deployment and renewal into a single command, instead of scripting every step separately.

Source code and releases: github.com/regfish/certbro (Go, Apache 2.0, no external dependencies).

  • Linux (the installer supports macOS, the systemd automation does not)
  • a regfish API key with access to TLS and DNS - see Create an API key
  • a DNS zone managed by regfish (certbro creates the validation records itself)
  • systemd for unattended renewal
Terminal window
curl -fsSL https://regfish.com/certbro/install.sh | sh

The installer detects the operating system and architecture, downloads the matching archive from the GitHub releases, verifies the SHA256 checksum against checksums.txt and aborts on a mismatch. It installs to /usr/local/bin/certbro.

For a reproducible rollout, pin the version - the current one is listed under Releases:

Terminal window
curl -fsSL https://regfish.com/certbro/install.sh | CERTBRO_VERSION=v0.1.10 sh
Terminal window
sudo certbro configure --api-key YOUR_REGFISH_API_KEY

certbro checks the key against the API before storing it and remembers when it did so. Without a verified key, every other command refuses to run.

Terminal window
sudo certbro issue \
--name example-com \
--common-name example.com \
--dns-name www.example.com \
--webserver nginx

Only --common-name is required. The most important of the other flags:

FlagDefaultMeaning
--name--common-name in lower caselogical name that renew uses to find the certificate again
--dns-name-additional name (SAN), repeatable
--productRapidSSLchecked against the live catalog; GET /tls/products returns the available products
--key-typersarsa or ecdsa
--webserver-nginx, apache or caddy
--install-hook-shell command to run after deployment
--validity-dayssee belowvalidity of the order
--org-id-organization handle (hdl_…) for OV products

For RSA and ECDSA side by side there is certbro issue-pair - it creates two certificates with the suffixes -rsa and -ecdsa and only reloads the web server once both are finished.

This is the part you need to know: certbro creates three directories under /etc/certbro/<common-name>/.

DirectoryContents
live/the stable paths - privkey.pem, cert.pem, chain.pem, fullchain.pem, metadata.json, plus request.csr.pem and bundle.zip where present. Overwritten on every deployment.
archive/<timestamp>/an untouched snapshot of each deployment
pending/only while an order is running: private key, CSR and order state. Disappears as soon as the certificate has been deployed.

The web server configuration must point at live/, never at archive/. The paths there never change, which is why the vhost does not need to be touched after a renewal.

What gets run in each case:

ValueCheckReload
nginxnginx -tsystemctl reload nginx, otherwise nginx -s reload
apacheapachectl -tapachectl -k graceful, otherwise systemctl reload apache2
caddycaddy validatecaddy reload, otherwise systemctl reload caddy

Use --webserver-config to specify a different configuration path. The command from --install-hook runs after the reload and receives the paths as environment variables (CERTBRO_LIVE_DIR, CERTBRO_FULLCHAIN_PATH, CERTBRO_PRIVKEY_PATH and others).

Without --validity-days, certbro takes the longest validity the CA/Browser Forum currently allows, minus one day:

FromDefault
today199 days
2027-03-1499 days
2029-03-1446 days

The value has to be greater than the renewal lead time, otherwise certbro rejects it - the renewal would run into an endless loop.

Terminal window
sudo certbro renew

Without --name, certbro checks every managed certificate. One is due when it expires in less than --renew-before-days (default: 7 days). To renew a single certificate, use --name example-com; --force renews it regardless.

certbro prevents parallel runs with a lock file - the second run ends with a note and exit code 0, so it does not disturb a cron job.

Terminal window
sudo certbro install

This creates a systemd service unit and a timer unit, enables the timer and reloads systemd. The timer runs hourly with a random delay of up to 30 minutes, so that not all servers make requests at the same time. Missed runs are caught up.

Without systemd, a cron entry does the job just as well:

17 3 * * * /usr/local/bin/certbro renew
Terminal window
sudo certbro list

shows the status, names, key type, expiry date and whether an action is pending, among other things, for each certificate. --json makes the output machine-readable.

  • No revoking. Use POST /tls/certificate/{id}/revoke for that.
  • No removing. There is no command to drop a managed certificate again - delete the corresponding directory instead.
  • No web server configuration. See above.
  • No touching other people’s DNS records. If a CNAME that certbro did not create is already sitting at the validation name, the run aborts and names it. That record then has to go by hand.
  • DNS validation only. certbro uses dns-cname-token exclusively; it does not support email validation.