dehydrated: install, configure and renew certificates

dehydrated is a plain bash ACME client that renews certificates through hook scripts for DNS validation and service reloads. This page covers what it needs, how to set it up and how to confirm renewals keep happening.

On this page

How can dehydrated automate certificate renewal, and what do shorter lifetimes change for it?

dehydrated renews certificates automatically through ACME. It reads a config file, a domains.txt list of the names to cover, and a hook script that handles validation and service reloads. The README describes the renewal behavior: dehydrated renews a certificate when it is near expiry or when its domain set has changed, so a scheduled run of the script keeps certificates current without manual steps. As certificate lifetimes shorten, scheduled renewal stops being a convenience and becomes the only workable method, because a certificate that must be replaced every few weeks cannot be reissued by hand.

Admins running dehydrated on Linux or BSD hosts who currently renew by hand need to move that work into a schedule. The first task is to confirm that each host runs the script from a cron job or timer, that the config file and domains.txt are in the locations dehydrated searches, and that the hook script reloads the right service after each issuance. Leads who must plan the move should treat each host as a renewal dependency: list which services depend on each certificate, decide who owns the hook and the schedule, and confirm that a failed run is reported to someone who can act on it.

The sources do not publish a lifetime schedule for this client, so the cadence the work has to support is not established here. Confirm the lifetimes your public certificate authority issues and the renewal window dehydrated uses by checking the dehydrated README and the authority's own documentation. Staging use is recommended in the project's documentation to avoid rate limits while you test the schedule, so run the new setup against staging before pointing production hosts at it.

What the shorter lifetimes change for dehydrated installs

This table pairs each public lifetime step (200, 100 and 47 days) with what it means for a dehydrated host, including renewal frequency, scheduling needs and what breaks if renewal stays manual. Read each row as a planning question: the more often a certificate expires, the more the renewal cron job, hooks and service reloads have to work unattended. The sources do not state which schedule a given CA applies on a given date, so confirm that with the CA's own documentation before setting your renewal cadence.

Lifetime scheduleRenewals per year (illustrative)What it means for dehydratedWhat stops working if renewal is manual
200-day maximumAbout 2 renewals per year per nameRenewal runs on the cron schedule, and the config and domains.txt must stay valid across runsCertificates lapse if no one runs the renewal within the window
100-day maximumAbout 4 renewals per year per nameUnattended scheduling becomes the default, and hook scripts run more oftenManual renewal misses the window within a few cycles, and services serve expired certificates
47-day maximumAbout 8 renewals per year per nameRenewal must run unattended on a schedule, with hooks reloading services after every issuanceAny manual step, failed hook or missed cron run leads to expiry, since the margin is short
Which schedule a CA applies on a given dateNot stated in the sourcesConfirm with the CA's documentation before you set a renewal intervalDo not assume a schedule from the table alone
Renewal trigger in dehydratedDepends on the configured renewal windowDehydrated renews certificates near expiry or when the domain set changes, so run it on a scheduleA cron job that stops running means no renewal, whatever the lifetime
Hook scripts for service reloadsRun once per issued certificateMore renewals mean more reloads, so test hooks against your services before the shorter lifetimes applyA failing hook leaves the new certificate on disk while services keep the old one
Monitoring and alertsScales with renewal countAlert on failed runs and on certificates nearing expiry, not only on expired onesFailures go unnoticed until clients report errors

How dehydrated issues and renews certificates on a host

dehydrated runs as a single bash script that reads its configuration, works through a list of domains, and handles issuance and renewal in one pass. On startup, the script looks for its config file in /etc/dehydrated/config, /usr/local/etc/dehydrated/config, the current directory and then the script directory, in that order. You can override the search with --config (or -f) to point at a specific file. The script then reads domains.txt, which lists the names to certify, one set per line. The README points to docs/domains_txt.md for the exact format, including how wildcards are written. Before you rely on the list, read that document and confirm the syntax for the version you have installed.

Next, the script contacts the certificate authority chosen with --ca, which accepts a URL or a preset such as ZeroSSL or Let's Encrypt. The README says dehydrated supports ACME v1 and v2, so confirm which protocol version your chosen CA expects. To prove control of each name, the client completes a challenge. The README lists http-01, dns-01, dns-persist-01 and tls-alpn-01, and the hook script is where DNS records are created or removed for dns-01. Once validation succeeds, dehydrated signs a certificate for each domain set. It renews certificates close to expiry and reissues any whose domain set has changed since the last run. The README also covers revocation, account deactivation and cleanup of unused certificate files, which you should schedule along with normal renewal.

Certificates and keys are written to the output directory, and dehydrated does not restart your services on its own. Your web server, load balancer or other consumer must be pointed at those files, or the hook script must reload it after a change. The README says the hook is set with --hook (or -k), but its main page does not describe the hook function names, so check the hook documentation in the repository before writing one. Plan a test renewal in staging first, and read docs/staging.md, which recommends staging use to avoid hitting rate limits on the production CA.

Which dehydrated options fit each validation method

The http-01 challenge proves control of a name by having the CA fetch a token from a web server that answers on that name. The host must serve the challenge file under the well-known ACME path for every domain you request, and the CA must be able to reach it over port 80. dehydrated supports this challenge type as listed in its README, and the challenge runs without any DNS changes.

  • Host requirement: Each requested domain must resolve to a web server that the CA can reach over HTTP.
  • Hook involvement: This challenge type does not depend on DNS, so the hook script is not required for the validation step itself.
  • Key algorithms: The README lists rsa, prime256v1 and secp384r1 as the key algorithms, and you choose one per run.
  • Wildcards: Wildcard names are validated with dns-01 rather than this method, so plan them in a separate tab.
  • Reloads: Use the hook script to reload the web server after issuance, since the validation itself does not touch the service.

Before you rely on this method, confirm that your web server serves the challenge path for each domain and that the CA can reach it from the internet. Check the dehydrated README and its hook documentation for the exact challenge handling options.

How do you install and configure dehydrated step by step?

The sequence below takes you from a bare host to a first signed certificate with dehydrated, a plain bash ACME client. Each step produces a file or check you can verify before moving on, and the staging step lets you confirm the whole chain without touching live rate limits.

  1. Confirm the prerequisite tools are installed

    Before anything else, check that openssl, cURL, sed, grep, awk and mktemp are present on the host that will run dehydrated. The dehydrated README names these as the tools the script needs, and it is a zsh-compatible bash script, so a shell with those utilities is the only runtime it depends on. Run each tool with a version or help flag in a terminal, such as openssl version and curl --version, and confirm each one returns output without an error. If any tool is missing, install it through your operating system's package manager before continuing. The step is done when all six tools respond.

  2. Install or clone the dehydrated repository

    Obtain the dehydrated script from its official repository at github.com/dehydrated-io/dehydrated, which the README identifies as the project home. You can clone the repository with git or download a copy of the source, then place the script in a directory your admin scripts can reach, such as a dedicated tooling path on the host. Check the README and the repository's release tags for the version you intend to run, since the main page does not list release information. The step is done when the dehydrated script is present and runs with its help flag without errors.

  3. Create the config file in a searched path

    dehydrated reads its configuration from the first of four locations it finds: /etc/dehydrated/config, /usr/local/etc/dehydrated/config, the current directory, or the script directory. Pick one of these, typically /etc/dehydrated/config for a system-wide setup, and create the file there with the settings your environment needs. If you prefer a path outside the searched locations, pass it at run time with --config (or -f), and the README says that flag overrides the search. The step is done when the config file exists in a location dehydrated will read, and a test run reports that it loaded that file.

  4. List domains and wildcards in domains.txt

    Create a domains.txt file that lists each name you want certificates for, one entry per line, with wildcard names included where you need them. The README says domains.txt is documented in docs/domains_txt.md, so read that file for the exact entry format before you write yours. Keep the list to the names each certificate should cover, since the domain set determines what dehydrated checks for renewal. The step is done when domains.txt holds every name you need and you have checked it against the documentation.

  5. Select the CA and read the staging guidance

    Choose your certificate authority with --ca followed by a URL or preset name. The README says it supports ACME v1 and v2 and names ZeroSSL and Let's Encrypt as examples of CAs you can select. Before issuing live certificates, read docs/staging.md, which the README recommends for using staging to avoid rate limits, and run your first attempts against a staging endpoint. Confirm with the CA's own documentation which endpoint is staging, since the staging address is set by the CA and not by dehydrated. The step is done when you have selected a CA, located its staging endpoint, and read the staging guidance.

  6. Set the hook script with the hook flag

    Point dehydrated at your hook script with --hook (or -k) followed by the path to the script, as the README describes. The hook is where you put your own logic for steps such as DNS validation and service reloads, and the README's main page does not describe the hook function names, so check the project's documentation for the events and functions the hook receives before writing it. Test the hook on a staging run first, and confirm that it executes and writes any output you expect. The step is done when the hook path is set and a test run shows the hook being called.

  7. Run the first signing and verify the result

    Run dehydrated with the config, the CA and the hook you have set, and let it sign the certificates listed in domains.txt. Watch the output for the challenge type it uses and for any errors from the CA or from your hook. When the run completes, check the generated certificate files and confirm the names on each certificate match the entries you listed. Once a staging run succeeds, repeat the run against the live CA only after you have confirmed the staging results. The step is done when the certificate files exist, their names match domains.txt, and the run reported no errors.

What must be in place before dehydrated can renew

dehydrated is a plain bash script, so renewal depends on the host around it as much as the script itself. The cards below cover what has to exist on the machine, on the network and in the file system before a scheduled run can issue or renew certificates.

Required tools on the host

The README lists openssl, cURL, sed, grep, awk and mktemp as the tools dehydrated needs, and it states the script is zsh-compatible bash. Confirm each command is present and on the PATH of the account that will run the scheduled job, since a cron or systemd environment often has a shorter PATH than an interactive shell. The README main page shows no release version, so note the exact version or commit you install and check its documentation for the version you run.

dehydrated README

Network reachability to the CA

dehydrated must reach the ACME directory of the CA you select with --ca, and it must reach the CA's endpoints during issuance and validation. Test outbound HTTPS from the host to that directory URL before you configure anything, because a proxy or egress rule can block it silently. For the http-01 challenge, the public web server for each domain must also answer on port 80 at the challenge path, so check that no redirect or firewall rule breaks the request.

dehydrated README

DNS write access for dns-01

If you use the dns-01 challenge, the hook script must create and remove TXT records at the DNS provider for each name you request. Confirm the credential the hook uses can write those records and nothing broader, and store it where only the job's account can read it. The README lists dns-persist-01 and tls-alpn-01 as further challenge types, but the DNS write requirement applies only to the DNS-based ones you choose.

dehydrated README

Write access to output and key directories

The account running dehydrated needs write permission on the directory where it stores accounts, keys and issued certificates, and on the directories your hook copies files into for each service. Check ownership and mode bits on these paths before the first run, and keep private keys readable only by the service account that needs them. A failed write during renewal can leave a service on an old certificate, so test a write as the job's user.

A scheduler that runs the script

dehydrated does not run itself on a timer, so the host needs a scheduler such as cron or a systemd timer that calls the script regularly. The README lists renewing certificates near expiry or whose domain set has changed, so a frequent scheduled run is what triggers those renewals. Log each run's output and alert on failure, because a broken schedule goes unnoticed until a certificate expires.

How do you confirm dehydrated renewals keep happening?

A dehydrated setup is only working if certificates are renewed before they expire, and the only way to know that is to check. Start by reviewing the output of each dehydrated run and the logs of whatever scheduler starts it. A run that fails on one domain can still exit with other domains updated, so read the full output rather than only the exit status. Confirm that each run reports either a renewal or a message that the certificate is not yet near expiry, and that no domain is repeatedly failing validation. Dehydrated renews certificates near expiry or when the domain set has changed, so a quiet run is normal; a run that never reports anything about a domain is worth investigating.

Verify the result independently on each host and at the service endpoint. On the host, inspect the certificate files that dehydrated wrote and read their expiry dates with openssl. At the endpoint, connect to the service with openssl s_client and confirm the certificate being served has the expected expiry and that the reload hook has run, since a renewed file on disk does nothing until the web server or other service picks it up. Checking the live endpoint catches reload failures that a file-based check would miss. Confirm the checks cover every host and every domain listed in domains.txt, because a single skipped entry can go unnoticed for weeks.

Set an alert for certificates that are within a margin you choose of their expiry, and keep a dated record of issuance, renewal and reload for each certificate. The alerting tool is your own choice, and the margin should allow time to fix a failed renewal before the certificate lapses. The dated record is what an auditor or customer may ask for, so keep the log lines, certificate expiry readings and reload confirmations together and retain them according to your own policy. Confirm with your compliance team which records they need and how long they must be kept, since the sources listed on this page do not set retention periods.

Common questions about running dehydrated for certificate renewal

Does dehydrated support ACME?

Yes. The dehydrated README says it supports ACME v1 and v2, so it can request and renew certificates from any CA that offers those versions. It is a zsh-compatible bash script that needs openssl, cURL, sed, grep, awk and mktemp available on the host. Because it is a single shell script with few dependencies, it suits admins who want a plain bash client rather than a packaged tool. Confirm which ACME version your chosen CA expects before you start, since the README does not say which CAs use which version.

Which CA should I choose with the --ca option?

Pick the CA with --ca url/preset. The README names ZeroSSL and Let's Encrypt as examples of CAs you can select this way. Choose based on what your organization needs: the CA's lifetime options, its rate limits, and whether it supports the challenge types and key algorithms you plan to use. The README points to docs/staging.md for test runs against a staging endpoint, which helps you avoid hitting rate limits while you configure things. Check each CA's own documentation for its current terms and limits, since the README does not describe them.

Does dehydrated handle wildcard certificates?

The README lists signing certificates for domain lists that include wildcards, so wildcard names are supported as an entry in your domain list. Wildcard certificates generally require the dns-01 challenge, which the README lists among its challenge types, so plan for a DNS hook script to create and remove the validation records. The README does not give the exact syntax for wildcard entries in domains.txt, so read docs/domains_txt.md in the repository for the format before you rely on it. Test the setup against a staging CA first.

How often does dehydrated renew certificates?

dehydrated renews a certificate when it is near expiry or when its domain set has changed, according to the README. That means you run it on a schedule, such as a cron job or systemd timer, and it renews only what needs renewing. The README does not state a default renewal window or a fixed number of days before expiry, so check the configuration documentation in the repository for the threshold your version uses. Because renewal is conditional, running the schedule more often than daily is usually unnecessary, but confirm the approach that suits your CA's lifetimes and your monitoring.

What happens when a dehydrated renewal fails?

The README does not describe the failure behavior in detail, so the exact retry, logging and exit handling should be confirmed in the repository before you depend on it. In practice, a failed renewal leaves the existing certificate in place until it expires, which is why monitoring matters. Build alerting that checks the expiry date of each deployed certificate independently of the renewal job, and make your hook scripts report errors so a failed DNS update or service reload does not go unnoticed. Test a failed renewal in staging to see what your version writes to its output and how your hooks behave.

Can I run dehydrated myself, or should I get outside help?

Many teams run dehydrated in-house once the install and configuration are understood, since it is a single script with a small set of dependencies. Outside help becomes worth considering when the work includes custom hook scripts for DNS providers, integration with many services, or migration from an existing client, or when your team lacks the time to maintain the setup. DeployOpen can plan, implement and document a self-hosted certificate renewal setup inside your own infrastructure, with written, fixed-scope deliverables agreed before work starts. Ask for the scope in writing and compare it against your internal capacity. DeployOpen does not publish prices, so request a quote based on your environment.

Where do I find the full list of dehydrated options?

Start with the dehydrated README at the project repository, which covers the main command-line options, the challenge types http-01, dns-01, dns-persist-01 and tls-alpn-01, and the key algorithms rsa, prime256v1 and secp384r1. The README also documents the optional --acme-profile and --preferred-chain options, and it points to the config search order and the hook option --hook. For hook function names and their behavior, the README does not say, so read the scripts and docs in the repository for the version you install. Check the README's release information for the version you plan to run, since it does not show release details on the main page.

How the dehydrated renewal flow runs on a host

The flow starts when the scheduler runs dehydrated, which reads its config file and the domains.txt list to decide which certificates need signing or renewal. dehydrated then uses the CA chosen with --ca and requests a challenge, which the hook script at --hook handles, typically by creating DNS records or validating the challenge. After the CA signs the certificate, the hook reloads the service that uses it. Check that the hook completes cleanly and that the service picks up the new certificate, because a failed hook step leaves the old certificate in place.

The renewal path from the scheduler through the CA and hook to the reloaded service.

How DeployOpen helps teams automate certificate renewal with dehydrated

DeployOpen approaches dehydrated as a bash-based client that runs inside your own infrastructure, with hook scripts for DNS validation and service reloads. We scope the work in writing, build and test the hooks against your environment, and hand over documentation your team can run without us.

How we scope

  • We list the domains, wildcards and certificate authorities your environment needs, and which challenge types each one will use.
  • We confirm which services consume each certificate, so reload hooks match how each platform actually picks up new files.
  • Engagements are fixed-scope, with deliverables and timelines agreed in writing before any work starts.

How we build

  • We configure dehydrated with its config file and domains.txt, and set up staging runs first to avoid hitting rate limits.
  • We write and test hook scripts for DNS-01 validation and service reloads, checking renewal against your real DNS provider.
  • We run renewal, revocation and cleanup paths in a test environment so failure behavior is known before production.

How we hand over

  • You receive documentation covering installation, the config file, the domains list and every hook script we wrote.
  • We document how to schedule renewal, read the logs, and check which certificates are near expiry or have changed domain sets.
  • Your team gets a walkthrough of the runbook so routine renewal and troubleshooting stay in-house after handover.

How we support

  • Ongoing support, upgrades and continuous testing are available as retainers, scoped separately from the initial engagement.
  • Retainers can cover reviewing hook changes when your DNS provider, services or certificate authority settings change.
  • Confirm current dehydrated release details and supported options against the project's README and docs before relying on them.

Sources and further reading

Talk to our team.

Tell us what you're working on, whether it's a deployment, an audit, a security test or a cyber range. You'll speak with an engineer who can help you scope it.

  • 30-minute call: free, with no obligation.
  • NDA on request: we can sign before you share details.
  • Clear next steps: a scope and plan after the call.