Level-5; Sheikh Hasina Software Technology Park, Jessore, Bangladesh
+8801976062011
shahanur.sharif84

Install Letsencrypt in Nginx

Read all about software development and Coding

Install Letsencrypt in Nginx

The first step to using Let’s Encrypt to obtain an SSL certificate is to install the Certbot software on your server.

Certbot is in very active development, so the Certbot packages provided by Ubuntu tend to be outdated. However, the Certbot developers maintain a Ubuntu software repository with up-to-date versions, so we’ll use that repository instead.

sudo add-apt-repository ppa:certbot/certbot

You’ll need to press ENTER to accept. Then, update the package list to pick up the new repository’s package information.

sudo apt-get update

And finally, install Certbot’s Nginx package with apt-get.

sudo apt-get install python-certbot-nginx

Certbot is now ready to use, but in order for it to configure SSL for Nginx, we need to verify some of Nginx’s configuration.

Certbot provides a variety of ways to obtain SSL certificates, through various plugins. The Nginx plugin will take care of reconfiguring Nginx and reloading the config whenever necessary:

certbot certonly

After you run this command you will see this confirmation message

Saving debug log to /var/log/letsencrypt/letsencrypt.log

How would you like to authenticate with the ACME CA?
-------------------------------------------------------------------------------
1: Spin up a temporary webserver (standalone)
2: Place files in webroot directory (webroot)
-------------------------------------------------------------------------------
Select the appropriate number [1-2] then [enter] (press 'c' to cancel): 2
Please enter in your domain name(s) (comma and/or space separated) (Enter 'c'
to cancel): blog.microdreamit.com
Obtaining a new certificate
Performing the following challenges:
http-01 challenge for blog.microdreamit.com

Select the webroot for blog.microdreamit.com:
-------------------------------------------------------------------------------
1: Enter a new webroot
-------------------------------------------------------------------------------
Press 1 [enter] to confirm the selection (press 'c' to cancel):

Press 1

Then another message will be shown:

Input the webroot for blog.microdreamit.com: (Enter 'c' to cancel):

Then enter path like ‘var/www/microdreamit.com’

Then you should see this congratulation message:

Waiting for verification...
Cleaning up challenges

IMPORTANT NOTES:
- Congratulations! Your certificate and chain have been saved at:
/etc/letsencrypt/live/blog.microdreamit.com/fullchain.pem
Your key file has been saved at:
/etc/letsencrypt/live/blog.microdreamit.com/privkey.pem
Your cert will expire on 2018-08-24. To obtain a new or tweaked
version of this certificate in the future, simply run certbot
again. To non-interactively renew *all* of your certificates, run
"certbot renew"
- If you like Certbot, please consider supporting our work by:

Donating to ISRG / Let's Encrypt: https://letsencrypt.org/donate
Donating to EFF: https://eff.org/donate-le

Creator of Shapecss, full stack developer and founder of MicroDreamIT. I wish to feel good if my blog help you developing your coding and career. I am also looking for project and consultancy. Please keep in touch with me in my twitter, facebook or other social network.

 

Leave a Reply

Your email address will not be published. Required fields are marked *