Skip to content

Instantly share code, notes, and snippets.

@afriza
Created April 11, 2019 03:48
Show Gist options
  • Save afriza/8be7701a167c07fbd5400a10f7e796b4 to your computer and use it in GitHub Desktop.
Save afriza/8be7701a167c07fbd5400a10f7e796b4 to your computer and use it in GitHub Desktop.
Installing HTTPS for NGINX with Let's Encrypt on Ubuntu 18.04

Installing HTTPS for NGINX with Let's Encrypt on Ubuntu 18.04

  • First, install add-apt-repository
    sudo apt install software-properties-common
  • Then, install certbot
    sudo add-apt-repository ppa:certbot/certbot
    sudo apt install python-certbot-nginx
  • Make sure server_name is set in the server block with the corresponding domain that we want to add SSL because certbot will use this information to deploy the certificate.
  • Finally, obtain an SSL certificate
    sudo certbot --nginx -d example.com -d www.example.com

References

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