First install certbot: (instrcution fotr ubuntu below)
sudo apt-get update
sudo apt-get install software-properties-common
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
We are going to use this command to issue the certificate: