nginx certbot install ssl 证书


1. SSH into the server

2. Install snapd

Adding EPEL to CentOS 8

$ sudo dnf install epel-release
$ sudo dnf upgrade

Adding EPEL to CentOS 7

sudo yum install epel-release

Installing snapd

sudo dnf install snapd
sudo systemctl enable --now snapd.socket
sudo ln -s /var/lib/snapd/snap /snap

3. Ensure that your version of snapd is up to date

sudo snap install core; sudo snap refresh core

4. Remove certbot-auto and any Certbot OS package

examples are sudo apt-get remove certbot, sudo dnf remove certbot, or sudo yum remove certbot.

5. Install Certbot

sudo snap install --classic certbot

6. Prepare the Certbot command

sudo ln -s /snap/bin/certbot /usr/bin/certbot

7. Choose how you'd like to run Certbot Either get and install your certificates…

sudo certbot --nginx

Or, just get a certificate

sudo certbot certonly --nginx

8. Test automatic renewal

sudo certbot renew --dry-run

The command to renew certbot is installed in one of the following locations:

systemctl list-timers

9. Confirm that Certbot worked

To confirm that your site is set up properly, visit in your browser and look for the lock icon in the URL bar.



喜欢技术,乐于开源! 乐可开源,想改变的也只有世界!



This site uses Akismet to reduce spam. Learn how your comment data is processed.