1. Install CertbotRun this command on the command line on the machine to install Certbot.
    • sudo snap install --classic certbot
  2. Prepare the Certbot commandExecute the following instruction on the command line on the machine to ensure that the certbot command can be run.
    • sudo ln -s /snap/bin/certbot /usr/bin/certbot
  3. SSH into the serverSSH into the server running your HTTP website as a user with sudo privileges.
  4. Install snapdYou’ll need to install snapd and make sure you follow any instructions to enable classic snap support.Follow these instructions on snapcraft’s site to install snapd.install snapd
  5. Remove certbot-auto and any Certbot OS packagesIf you have any Certbot packages installed using an OS package manager like aptdnf, or yum, you should remove them before installing the Certbot snap to ensure that when you run the command certbot the snap is used rather than the installation from your OS package manager. The exact command to do this depends on your OS, but common examples are sudo apt-get remove certbotsudo dnf remove certbot, or sudo yum remove certbot.
  6. Install CertbotRun this command on the command line on the machine to install Certbot.
    • sudo snap install --classic certbot
  7. Prepare the Certbot commandExecute the following instruction on the command line on the machine to ensure that the certbot command can be run.
    • sudo ln -s /snap/bin/certbot /usr/bin/certbot
  8. Choose how you’d like to run CertbotEither get and install your certificates…Run this command to get a certificate and have Certbot edit your nginx configuration automatically to serve it, turning on HTTPS access in a single step.sudo certbot –nginxOr, just get a certificateIf you’re feeling more conservative and would like to make the changes to your nginx configuration by hand, run this command.
    • sudo certbot certonly --nginx
  9. Test automatic renewalThe Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command:sudo certbot renew –dry-runThe command to renew certbot is installed in one of the following locations:
    • /etc/crontab/
    • /etc/cron.*/*
    • systemctl list-timers
  10. Confirm that Certbot workedTo confirm that your site is set up properly, visit https://yourwebsite.com/ in your browser and look for the lock icon in the URL bar.
  11. Test automatic renewalThe Certbot packages on your system come with a cron job or systemd timer that will renew your certificates automatically before they expire. You will not need to run Certbot again, unless you change your configuration. You can test automatic renewal for your certificates by running this command:sudo certbot renew –dry-run

By ziggle