First of all, you need to get a certificate for your Ubuntu server.
I am using Apache as my webserver.
We’re going to use the free certificate provider letsencrypt.
I recommend that you install the packages from the PPA because they are more up to date.
Go to this link:
And follow the instructions.
This is what you should do:
add-apt-repository ppa:certbot/certbot apt-get update apt-get install python-certbot-apache
Then install the certificate for your domain
certbot --apache -d domain.com,www.domain.com
apt-get install --only-upgrade certbot