Requirements
- DNS points to the server: A record and, if present, AAAA record. Let's Encrypt prefers to validate over IPv6. An outdated AAAA record is one of the most common causes of failure. Check in the DNS lookup.
- Port 80 is reachable from the internet. The standard validation (HTTP-01) runs over HTTP, even if the site later uses HTTPS only.
- A vhost with
ServerNamefor every name the certificate should contain.
Install certbot
# Debian, Ubuntu sudo apt install certbot python3-certbot-apache # RHEL, Rocky, Alma (from EPEL) sudo dnf install epel-release sudo dnf install certbot python3-certbot-apache # alternative, always up to date sudo snap install --classic certbot
Obtain and install the certificate
sudo certbot --apache -d example.com -d www.example.com
On the first run certbot asks for an email address and the terms of service. It then creates a vhost for port 443 (on Debian …-le-ssl.conf), adds certificate and key, and sets up the redirect from HTTP to HTTPS if you want (--redirect). Since version 2.0 certbot creates ECDSA keys; for very old clients there is --key-type rsa.
If certbot should not touch the Apache configuration, certonly only obtains the certificate:
sudo certbot certonly --webroot -w /var/www/example -d example.com -d www.example.com
The files are then in /etc/letsencrypt/live/example.com/. How to add them to the vhost yourself is in the article set up SSL/TLS in Apache. Use fullchain.pem, not cert.pem.
Automatic renewal
Certificates are valid for 90 days. The packages set up a systemd timer that checks twice a day and renews from 30 days remaining. Check:
systemctl list-timers | grep certbot sudo certbot renew --dry-run
With the Apache plugin certbot reloads Apache itself after renewal. With certonly --webroot you need a deploy hook, otherwise Apache keeps serving the old certificate:
sudo certbot renew --deploy-hook "systemctl reload apache2" # permanently: put a script into /etc/letsencrypt/renewal-hooks/deploy/
Let's Encrypt has not sent reminder emails since 2025. To notice a failure, add the server to the certificate expiry overview or embed the expiry badge from the SSL check.
Wildcard certificates
*.example.com is only available with DNS validation (DNS-01). certbot needs a plugin for your DNS provider, e.g. python3-certbot-dns-cloudflare, or you use acme.sh, which supports very many providers. --manual works without a plugin but does not renew automatically. The ACME helper generates the commands for your provider.
Typical errors
Timeout during connect (likely firewall problem): port 80 is closed, in the server firewall or at the host or router.Invalid response … 404: the challenge file under/.well-known/acme-challenge/is not found. Usually another vhost answers, or a redirect or rewrite rule catches the path.- Validation fails only sometimes: the AAAA record points to another server, or IPv6 is not set up on the server.
CAA record … prevents issuance: a CAA record only allows other CAs. Addletsencrypt.organd check with CAA & DANE.too many certificates already issued: rate limit reached, e.g. 5 identical certificates per week. For testing use--test-cert, which uses the staging environment without these limits.
Finally check chain and protocols with the SSL check.
FAQ
Is Let's Encrypt really free?
Yes. Let's Encrypt is a non-profit CA. The certificates are equivalent to purchased domain-validated certificates and accepted by all browsers.
Does it work at a web host without root access?
Almost all hosts let you enable Let's Encrypt with one click in the control panel, e.g. in Plesk or cPanel. You only need certbot on your own servers.
Can I put several domains in one certificate?
Yes, with several -d options, up to 100 names. For independent sites, separate certificates are easier to manage.