How to Setup HTTPS on Debian 9 Using Lets Encrypt

As you might notice, this blog is not HTTPS enabled. As Google encourages the webmasters to enable https on our websites, I need to enable https on my websites. Today, I am going to show you how to enable https on Debian 9 using Let’s Encrypt. Let’s encrypt is a free SSL certificate services for website. Let’s Encrypt requires valid domain name in order to work properly.

Enable HTTPS on Debian 9 Using Let’s Encrypt

I am running on Debian 9 Stretch with Apache web server and I use certbot to install and enable Let’s Encrypt on my server. The required packages are available through Debian 9 repository. In case you are running Debian 8 and the certbot package is not available, please refers to this article to install and enable Let’s Encrypt on Debian 8.

Step 1. Install Certbot

apt install python-certbot-apache

Output:

root@localhost:~# apt-get install python-certbot-apache
Reading package lists… Done
Building dependency tree
Reading state information… Done
The following additional packages will be installed:
augeas-lenses certbot libaugeas0 python-acme python-augeas python-certbot
python-cffi-backend python-chardet python-configargparse python-configobj
python-cryptography python-dnspython python-enum34 python-funcsigs python-idna
python-ipaddress python-mock python-openssl python-parsedatetime python-pbr
python-pkg-resources python-psutil python-pyasn1 python-pyicu python-requests
python-rfc3339 python-setuptools python-six python-tz python-urllib3
python-zope.component python-zope.event python-zope.hookable python-zope.interface
Suggested packages:
augeas-doc python-certbot-doc augeas-tools python-acme-doc python-certbot-apache-doc
python-configobj-doc python-cryptography-doc python-cryptography-vectors
python-enum34-doc python-funcsigs-doc python-mock-doc python-openssl-doc
python-openssl-dbg python-psutil-doc doc-base python-socks python-setuptools-doc
python-ntlm
The following NEW packages will be installed:
augeas-lenses certbot libaugeas0 python-acme python-augeas python-certbot
python-certbot-apache python-cffi-backend python-chardet python-configargparse
python-configobj python-cryptography python-dnspython python-enum34 python-funcsigs
python-idna python-ipaddress python-mock python-openssl python-parsedatetime python-pbr
python-pkg-resources python-psutil python-pyasn1 python-pyicu python-requests
python-rfc3339 python-setuptools python-six python-tz python-urllib3
python-zope.component python-zope.event python-zope.hookable python-zope.interface
0 upgraded, 35 newly installed, 0 to remove and 8 not upgraded.
Need to get 3,028 kB of archives.
After this operation, 14.1 MB of additional disk space will be used.
Do you want to continue? [Y/n]

Step 2. Configure firewall

If your firewall is active, you need to allow https connections through the firewall.

Step 3. Install the certificate

Execute this command below to get the SSL certificate

certbot --authenticator webroot --installer apache

 

Output:

root@localhost:/etc/apache2/sites-available# certbot –authenticator webroot –installer apache
Saving debug log to /var/log/letsencrypt/letsencrypt.log

Which names would you like to activate HTTPS for?
——————————————————————————-
1: domain1.com
2: www.domain2.com
3: domain3.site
4: www.domain3.site
——————————————————————————-
Select the appropriate numbers separated by commas and/or spaces, or leave input
blank to select all options shown (Enter ‘c’ to cancel):

Thank you

Be the first to comment

Leave a Reply