How to install free ssl certificates on nginx on Ubuntu 14.04

April 2nd, 2017 . 2 minutes read
Blog featured image

Install free SSL certificates on Nginx:

Buying SSL certificates cost between 10$ to 200$ for a year. We can avoid this. We can use free SSL certificates from letsencrypt. Let’s Encrypt is a free, automated, and open Certificate Authority. Even it is free still it is really safe. It is sponsored by many big companies. See the sponsor list here.



How to install SSL on Nginx on Ubuntu 14.04:

On Ubuntu systems, the Certbot team maintains a PPA. Once you add it to your list of repositories all you’ll need to do is apt-get the following packages.



Get Started
Certbot supports a number of different “plugins” that can be used to obtain and/or install SSL certificates.

Since your server architecture doesn’t yet support automatic installation you should probably use the certonly command to obtain your certificate.

certbot certonly
This will allow you interactively select the plugin and options used to obtain your free SSL certificate. If you already have a web server running, we recommend choosing the “webroot” plugin.

Alternatively, you can specify more information on the command line.

To obtain a cert using the “webroot” plugin, which can work with the webroot directory of any web server software:



This command will obtain a single cert for example.com, www.example.com, thing.is, and m.thing.is; it will place files below /var/www/example to prove control of the first two domains, and under /var/www/thing for the second pair.

To use the webroot plugin, your server must be configured to serve files from hidden directories. If /.well-known is treated specially by your web server configuration, you might need to modify the configuration to ensure that files inside /.well-known/acme-challenge are served by the web server.

To obtain a cert using a built-in “standalone” web server (you may need to temporarily stop your existing web server if any) for example.com and www.example.com:


Automating renewal

The Certbot packages on your system come with a cron job that will renew your certificates automatically before they expire. Since Let’s Encrypt certificates last for 90 days, it’s highly advisable to take advantage of this feature. You can test automatic renewal for your free SSL certificates by running this command:


More detailed information and options about renewal can be found in the full documentation.

We hope you enjoy this post, comment in the box if you have any query. We are best mobile app development and web development company.

Share with your friends if you enjoy this post.

Author: morwal89