certbot is a command-line utility in Linux that is used to manage and obtain SSL/TLS certificates for web servers. It is part of the Let’s Encrypt project, which provides free, automated SSL/TLS certificates to help secure websites and protect the privacy of users.
certbot is designed to be easy to use and automate the process of obtaining and installing SSL/TLS certificates for web servers. It supports a wide range of web servers, including Apache, Nginx, and other popular web servers.
If you encounter the below error while running the certbot command:
certbot: command not found
you may try installing the below package as per your choice of distribution:
Distribution | Command |
---|---|
OS X | brew install certbot |
Debian | apt-get install certbot |
Ubuntu | apt-get install certbot |
Alpine | apk add certbot |
Arch Linux | pacman -S certbot |
Kali Linux | apt-get install certbot |
Fedora | dnf install certbot |
Raspbian | apt-get install certbot |
certbot Command Examples
1. Obtain a new certificate via webroot authorization, but do not install it automatically:
# certbot certonly --webroot --webroot-path path/to/webroot --domain subdomain.example.com
2. Obtain a new certificate via nginx authorization, installing the new certificate automatically:
# certbot --nginx --domain subdomain.example.com
3. Obtain a new certificate via apache authorization, installing the new certificate automatically:
# certbot --apache --domain subdomain.example.com
4. Renew all Let’s Encrypt certificates that expire in 30 days or less (don’t forget to restart any servers that use them afterwards):
# certbot renew
5. Simulate the obtaining of a new certificate, but don’t actually save any new certificates to disk:
# certbot --webroot --webroot-path path/to/webroot --domain subdomain.example.com --dry-run
6. Obtain an untrusted test certificate instead:
# certbot --webroot --webroot-path path/to/webroot --domain subdomain.example.com --test-cert