Skip to content

Instantly share code, notes, and snippets.

@manishjaingit
Created October 6, 2018 18:47
Show Gist options
  • Save manishjaingit/3d554cf1f3e536f6026a40f0a5b3bf83 to your computer and use it in GitHub Desktop.
Save manishjaingit/3d554cf1f3e536f6026a40f0a5b3bf83 to your computer and use it in GitHub Desktop.
setup lets encrypt in Ubuntu 16.04
### To apply ssl certificate free via lets encrypt. ###
Step 1
sudo add-apt-repository ppa:certbot/certbot
sudo apt-get update
sudo apt-get install python-certbot-nginx
sudo nano /etc/nginx/sites-available/default
# change serverName yourdomainname.com
sudo systemctl reload nginx
sudo ufw allow 'Nginx Full'
sudo ufw delete allow 'Nginx HTTP'
sudo ufw status
# if show inactive
sudo ufw enable
sudo certbot --nginx -d lmsindia.xyz -d www.lmsindia.xyz
# give some question answer and then run below command to renew the ssl.
sudo certbot renew --dry-run
@manishjaingit
Copy link
Author

sudo apt-get install python-certbot-nginx

please make sure by running this command because it got replace by sudo apt-get install python3-certbot-nginx

@manishneedsmet
Copy link

sudo ufw allow ssh

sudo ufw allow 443/tcp

@naumankhan21
Copy link

After successfully installation of ssl certificate make sure to comment the #port80 line in ssl server block, which creates after the ssl

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment