[[ which should start nano and edit the crontab file for root user ]]
insert a line something like this at the bottom: 03 30 * * * /usr/bin/certbot renew --nginx
That will attempt to renew your cert(s) using nginx each day at 3:30 AM.
Feel free to adjust the time as you see fit - but do not need to be run more than once a day.
just save and exit … CTRL-X ?
It will handle the location.
Once you have successfully added it to nextcloud (which seems to be using nginx), you can add: -q --deploy-hook 'service nginx restart'
to the crontab entry line. So that it will restart nginx whenever a cert is actually renewed.
That presumes that the nginx/nextcloud config can “use” the cert right from its’ current location: /etc/letsencrypt/live/bobscloud.ddns.net/fullchain.pem /etc/letsencrypt/live/bobscloud.ddns.net/privkey.pem
If not, then you may have to take some additional nextcloud related step(s).
with more details
sudo crontab -e
no crontab for root - using an empty one
Select an editor. To change later, run ‘select-editor’.
/bin/ed
/bin/nano <---- easiest
/usr/bin/vim.basic
/usr/bin/vim.tiny
Choose 1-4 [2]: 2
crontab: installing new crontab
“/tmp/crontab.RvhMup/crontab”:23: bad hour
errors in crontab file, can’t install.
Do you want to retry the same edit? (y/n)
sorry I may have given the hours and minutes in reversed order...
Try: 30 03 * * * /usr/bin/certbot renew --nginx
DOH!
30 is a bad hour indeed!
If you don't care too much about possible nginx restarts (when cert renews - every 60 days), just use: 30 03 * * * /usr/bin/certbot renew --nginx -q --deploy-hook 'service nginx restart'
either will renew the cert.
The longer string also restarts nginx.
But to be crystal clear: You have a cert and it should be set to automatically renew. But you are NOT yet using it anywhere.
That is now a nextcloud question/answer/setup thing.
Unless…
You also intend on using that same cert for any other unrelated (to nextcloud) service.