- SSH into the Ubuntu server.
-
Install snapd:
=>sudo apt update
=>sudo apt install snapd
To test if snapd installed correctly, run:
=>sudo snap install hello-world
Output should include something like:
hello-world 6.4 from Canonical installed
Then run:
=>hello-world
Output: Hello world! -
Update snapd:
=>sudo snap install core; sudo snap refresh core -
Remove any pre-installed versions of certbot:
=>sudo apt-get remove certbot -
Install classic certbot with snap:
=>sudo snap install --classic certbot -
Check if certbot is installed correctly:
=>sudo ln -s /snap/bin/certbot /usr/bin/certbot -
Generate and install certificate:
=>sudo certbot --nginx
Now follow the instructions from certbot to complete the installation.
When finished, it will:- Update the Nginx config file
- Create a cron job to automatically renew the SSL before expiry
-
Test if the auto-renewal is working:
=>sudo certbot renew --dry-run
How to install Let's Encrypt SSL with auto-renewal - Ubuntu Server
March 23, 2023
Leave a Comment