Check the system requirements before installation.
sudo nano /etc/nginx/sites-enabled/YOURDOMAIN.COM
hostname -I | awk '{print $1}'
sudo apt update -y
sudo apt install -y certbot
sudo apt install -y python3-certbot-nginx
certbot certonly --nginx -d YOURDOMAIN.COM
sudo crontab -e
and add the line from below to the bottom of it for attempting renewal every day.0 23 * * * certbot renew --quiet --deploy-hook "systemctl restart nginx"
sudo nano /etc/nginx/sites-enabled/YOURDOMAIN.COM
hostname -I | awk '{print $1}'