Once you’ve installed certbot, run the following command after replacing the relevant variables with your information.
sudo certbot certonly --webroot --agree-tos --email your-email address -d your-domain.com -w /var/www/your-domain.com/
Here’s what we’re doing:
- certonly tells certbot to obtain the cert only, don’t install it.
- –webroot option specifies the webroot plugin is being used.
- –agree-tos means agree Let’s Encrypt’s terms of service.
- email address is used to receive expiry notice from Let’s Encrypt and can also be used to recover lost key.
- -d option specifies the domain name.
- -w option specifies the web root path.