# add repository
sudo apt-add-repository -r ppa:certbot/certbot
# update system
sudo apt update
# install certbot
sudo apt install certbot python3-certbot-nginx
# generate and create SSL for server
certbot --nginx -d example.com -d www.example.com