This guide uses Certbot, the most popular ACME client, which can automatically obtain and install certificates and configure your Apache or NGINX web server. After you complete the initial setup, your SSL certificate will be hands-free: renewals and updates happen automatically without you needing to worry about it.
Note: Certbot requires a supported, up-to-date operating system with the necessary dependencies. Using an outdated OS may result in installation errors. Root or sudo access is required for all installation steps.
Before you begin, make sure you have the following:
Tip: you can run certbot –version to see if certbot is already installed on your server.
Certbot is the recommended ACME client for Apache and NGINX. Installation steps vary by operating system and web server. Select your OS family below, then choose one of the available installation methods.
The following instructions apply to Debian, Ubuntu, Linux Mint, and other Debian-based distributions. Choose Option A or Option B below—you only need to complete one.
Option A: Install via apt
The apt package manager provides a straightforward installation that integrates with your system’s package management. This method may not always provide the latest version of Certbot.
sudo apt update
For Apache:
sudo apt install certbot python3-certbot-apache
For NGINX:
sudo apt install certbot python3-certbot-nginx
Option B: Install via snap (Recommended)
The Certbot developers recommend installation via snap, as it provides automatic updates and always delivers the latest version. This method installs Certbot with support for both Apache and NGINX.
sudo snap install coresudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
The following instructions apply to Red Hat Enterprise Linux (RHEL), CentOS, Fedora, Rocky Linux, AlmaLinux, and other RHEL-based distributions. Choose Option A or Option B below—you only need to complete one.
Option A: Install via dnf or yum
This method uses your system’s native package manager. You’ll need to enable the EPEL (Extra Packages for Enterprise Linux) repository first.
sudo dnf install epel-release
OR
sudo yum install epel-release
sudo dnf clean allsudo dnf update
OR
sudo yum clean allsudo yum update
For Apache:
sudo dnf install certbot python3-certbot-apache
OR
sudo yum install certbot python-certbot-apache
For NGINX:
sudo dnf install certbot python3-certbot-nginx
OR
sudo yum install certbot python-certbot-nginx
Option B: Install via snap (Recommended)
The Certbot developers recommend installation via snap, as it provides automatic updates and always delivers the latest version. This method installs Certbot with support for both Apache and NGINX.
sudo snap install coresudo snap refresh core
sudo snap install --classic certbot
sudo ln -s /snap/bin/certbot /usr/bin/certbot
With Certbot installed, you can now request your SSL certificate. Certbot’s automatic mode will obtain the certificate, configure your web server, and set up automatic renewal—all in a single command.
Run the appropriate command for your web server, replacing the placeholder values with your own:
For 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 <your-certificate-name>
For 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 <your-certificate-name>
Command Parameters
Example Command
Here is a complete example for Apache using a Sectigo ACME server:
sudo certbot --apache --non-interactive --agree-tos \ --email admin@example.com \ --server https://acme.sectigo.com/v2/DV \ --eab-kid abc123yourEabKid \ --eab-hmac-key xyz789yourHmacKey \ --domain example.com \ --domain www.example.com \ --cert-name my-example-certificate
Tip: For NGINX, simply change –apache to –nginx in the command above. To secure multiple domains with a single certificate, include a separate –domain flag for each domain.
After the command completes successfully, verify that your certificate is installed and working:
sudo certbot renew --dry-run
Certbot automatically configures a cron job or systemd timer to renew your certificate before it expires. No additional configuration is required for automatic renewal. If you want to verify the timer is running:
# For standard apt installations
sudo systemctl status certbot.timer
# For Snap installations
sudo systemctl status snap.certbot.renew.tim
Congratulations! You have successfully installed your ACME SSL certificate. Your certificate will renew automatically, ensuring uninterrupted HTTPS protection. Please ensure you renew the service before the due date every 12 months otherwise the renewal will fail.
Note: If you can't find an answer to your problem click Here to open a support ticket (requires log in).