What you'll need
Apache or NGINX
Installed and serving your site on a current, supported Linux release. Outdated systems often fail to install Certbot.
Root or sudo access
Every step below runs with administrative privileges.
DNS pointing to the server
An A or AAAA record for each domain must resolve to this server's IP address.
ACME server URL + EAB credentials
Your directory URL plus EAB key ID and HMAC key.
- 1
Step 1 of 4
Install Certbot
Tip: Already installed? Run
certbot --versionto check before you start.Choose your Linux family, then follow one installation method. The snap package is recommended by the Certbot team because it updates itself and always ships the latest version.
Option A — snap (recommended). Supports both Apache and NGINX:
Terminal sudo snap install coresudo snap refresh coresudo snap install --classic certbotsudo ln -s /snap/bin/certbot /usr/bin/certbotOption B — apt. Integrates with system packages but may lag behind the latest release:
Apache sudo apt updatesudo apt install certbot python3-certbot-apacheNGINX sudo apt updatesudo apt install certbot python3-certbot-nginx - 2
Step 2 of 4
Request and install the certificate
Certbot's automatic mode gets the certificate, edits your web-server configuration and schedules renewals — all in one command. Use the line for your web server:
Apache sudo certbot --apache --non-interactive --agree-tos \ --server <acme-directory> \ --email <your-email> \ --eab-kid <your-eab-kid> \ --eab-hmac-key <your-hmac-key> \ --domain <your-domain> \ --cert-name <certificate-name>NGINX sudo certbot --nginx --non-interactive --agree-tos \ --server <acme-directory> \ --email <your-email> \ --eab-kid <your-eab-kid> \ --eab-hmac-key <your-hmac-key> \ --domain <your-domain> \ --cert-name <certificate-name>What each option does
--apache / --nginx- Which web server Certbot should configure.
--non-interactive- Runs without prompts, so it's safe in scripts.
--agree-tos- Accepts the certificate authority's subscriber terms.
--server- Your ACME directory URL, e.g. https://acme.sectigo.com/v2/DV.
--email- Where expiry and account notices are sent.
--eab-kid / --eab-hmac-key- The External Account Binding credentials for your subscription.
--domain- Each hostname to secure — repeat the flag for extra names.
--cert-name- A friendly label for this certificate on the server.
A complete example for Apache securing example.com and www.example.com:
Terminal sudo certbot --apache --non-interactive --agree-tos \ --email [email protected] \ --server https://acme.sectigo.com/v2/DV \ --eab-kid abc123yourEabKid \ --eab-hmac-key xyz789yourHmacKey \ --domain example.com \ --domain www.example.com \ --cert-name example-comTip: Running NGINX? Change
--apacheto--nginx— everything else stays the same. - 3
Step 3 of 4
Verify the certificate
- Open https://yourdomain.com and confirm the padlock appears.
- Check the certificate shows the right domain names and expiry date.
- Run the domain through our free SSL Checker to confirm the full chain is served.
- 4
Step 4 of 4
Confirm automatic renewal
Certbot installs a systemd timer or cron job that renews certificates before they expire. Do a dry run to make sure nothing will block it:
Terminal sudo certbot renew --dry-runsystemctl list-timers | grep certbotNote: No extra configuration is needed. Certbot reloads Apache or NGINX after each successful renewal.
All set — your certificate now renews itself
Keep an eye on it anyway: scheduled jobs occasionally fail. Check your live certificate any time with our free SSL Checker.

