Install Certbot on Linux With Nginx - 在 Linux 上安装 Certbot 和 Nginx 插件 - Ubuntu / CentOS
Certbot is the command line tool for Let's Encrypt, with it, you can deploy
and renew
SSL certificates easily through simple commands.
While official guide telling people to install it with snapd, I found it more simple to install it via each Linux distributions' onboard package manager.
So here we go…
how-to-secure-nginx-with-let-s-encrypt-on-ubuntu-20-04
sudo apt install certbot python3-certbot-nginx
how-to-secure-apache-with-let-s-encrypt-on-centos-7
sudo yum install epel-release
sudo yum install certbot python2-certbot-apache mod_ssl
Run the following command to install certificates for your domain.
sudo certbot --nginx
The command will show you a list of domains you have on your server, select the one you want to install SSL certificate for, and it will do the rest for you.
Run the following command to renew certificates for your domain.
## Test
sudo certbot renew --dry-run
## Renew
sudo certbot renew