1. Knowledge base
  2. Initial Setup
  3. Let’s Encrypt SSL on Debian 8 with…

Let’s Encrypt SSL on Debian 8 with Apache web server

Updated on 17 April 2023 3 min read Snel.com support team

Introduction

In this tutorial, you will learn the procedure of TLS/SSL certificate installation on Apache web server running on Debian 8 Jessie. Once you are finished, all traffic between server and client will be encrypted and safe. This is a standard practice of securing e-commerce websites and other financial services online.

Prerequisites

Before you begin working with this guide you’ll need these:

  • SSH with non root but sudo user access to the Debian 8 Jessie VPS
  • The apache web server with properly a domain and vhost configured

Installing Let’s Encrypt certbot

The first step to using Let’s Encrypt to obtain an SSL certificate is to install the certbot Let’s Encrypt client on your server. To access the certbot package, we will have to enable the Jessie backports repository as the certbot package was not available when Debian 8 was released. This repository can be used to install more recent versions of software than the ones included in the stable repositories. Add the backports repository to your server by typing:

Code
echo 'deb http://ftp.debian.org/debian jessie-backports main' | sudo tee/etc/apt/sources.list.d/backports.list

Now you should be ready to proceed further.

Code
sudo apt-get update && sudo apt-get install python-certbot-apache -t jessie- backports

Create and install the SSL certificate(s)

Generating the SSL Certificate for Apache using the Let’s Encrypt client is quite straightforward. The client will automatically obtain and install a new SSL certificate that is valid for the domains in our Apache configuration. To execute the interactive installation and obtain a certificate for all of the domains de ned in your Apache configuration, type:

Code
sudo certbot --apache

Check the SSL certificate(s) configuration

At above stage your certi cate are created and configured. Now check your domain virtualhost config with the ssl is like this or not. If not then put these manually on virtualhost’s ssl configuration:

Code
...SSLCertificateFile /etc/letsencrypt/live/<your-domain>/cert.pemSSLCertificateKeyFile /etc/letsencrypt/live/<your-domain>/privkey.pemSSLCertificateChainFile /etc/letsencrypt/live/<your-domain>/chain.pem...

Now need to test as our configuration goes right with this –

Code
sudo apachectl configtest

Finally, restart Apache and You can taste that your SSL is working. 🙂

Code
sudo service apache2 reload

Setting up for the auto 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 certificates by running this command:

Code
sudo certbot renew --dry-run

Conclusion

You have just secured your apache web server by implementing the most anticipated security feature – free SSL certificates! From now on all traffic between your domain web server and client is secure, you can be assured that no one could intercept the communication and alter or steal crucial information.

Was this article helpful?

Spot a mistake in this article? Email us at support@snel.com

This article was last checked on 17 April 2023. · 19,581 views

Your own VPS online within 2 minutes

Windows or Linux, root access and hosted in Rotterdam.

View VPS from € 6.99

Support

Can't figure it out? We are happy to help

You always talk to a real engineer. We typically respond within 15 to 30 minutes, and 24/7/365 for outages.

Call us

+31 88 3 088 099

Create a ticket

Through the client area we immediately see which service it is about.

Email us

Send your question via the contact form, also outside office hours.