How to Setup Free SSL Certificate for Apache on Debian 10

Chưa phân loại
TLS and SSL protocols encrypt the traffic between a website (or other service) and a visitor or web browser preventing sniffers or attackers from accessing the communication. Lately Google demanded all webmasters to use SSL, even for websites without sensitive information exchange turning this protocol in a must independently of the security need.

This tutorial focuses on installing a SSL Certificate on an Apache web server under Linux Debian 10 Buster fast and simple  using Certbot. For users who need an encrypted web server but haven’t installed or configured Apache yet, the first section shows how to install and configure Apache on Debian 10 Buster to host a website.

All steps described in this tutorial are useful for recent previous versions of Debian and based Linux distributions. If you have Apache already you can jump to How to Setup Free SSL Certificate for Apache on Debian 10 Buster.

Installing Apache on Debian 10 Buster

This step is only for users who didn’t install Apache yet, if you already have Apache installed jump to the chapter “How to Setup Free SSL Certificate for Apache on Debian 10”.
If you have not Apache installed, install it  by executing:

# apt install apache2 -y

Once installed the service will automatically start and you’ll be able to access your web server from your browser through  the address (localhost).

Apache supports multiple domains too, but for this setup we will only configure the domain using the default configuration file for apache /etc/apache2/sites-enabled/000-default.conf. Run:

# nano /etc/apache2/sites-enabled/000-default.conf

The uncommented lines below show a proper configuration adapted for,

The file contains the following content opening the file (<VirtualHost *:80>), the server name, alias, contact information, root directory, logging files information and closing file (</VirtualHost>).

<VirtualHost *:80>
DocumentRoot /var/www/html
ErrorLog ${APACHE_LOG_DIR}/error.log
CustomLog ${APACHE_LOG_DIR}/access.log combined

You can rename Apache’s default index page by running:

# mv index.html oldindex.html

Then create a new page for testing purposes:

# nano test.html

Put inside any content you want:

Press CTRL+X to save and exit.

In order to allow access from outside the network, some home users will need to configure their routers to forward necessary ports to their web servers. The following image only shows an example of router configuration page for port forwarding, in your router you’ll need to forward ports 80 and 443 to your Apache computer local IP address.

Finally you will be able to access your website from outside your network.

How to Setup Free SSL Certificate for Apache on Debian 10 Buster

If you already have Apache its time to add SSL, for this purpose this tutorial shows how to install a SSL certificate in a fast and simple way using certbot, an automatic installer and configurer for Let’s Encrypt ssl certificates.

To begin install Certbot packages by running:

# apt install certbot python-certbot-apache -y

Once installed the previous packages create and instruct a redirection to https by running:

# certbot –apache

Fill the requested information:

At some point it will offer you to redirect traffic to https, press 2 to accept, then press ENTER to finish.

If the process success you’ll see the following screen:

Finally you can test your website, press CTRL+F5 and it will redirect through SSL now.

To renew the certificate run:

# certbot renew –dry-run

Conclusion on Certbot method to install a SSL certificate for Apache on Debian 10 Buster

Certbot makes installing SSL certificates extremely easy and fast allowing any inexperienced user without Plesk or Cpanel to share web content in a secure way for free. The whole process took minutes including the Apache installation.

Other free options to get free SSL certificates may include SSL for Free (, the short Comodo free SSL licences or Zerossl which I didn’t try yet, but none of them means a fast and easy method like this one.

I hope you found this brief article on How to Setup Free Certificate for Apache on Debian 10 useful, thank you for reading it.

ONET IDC thành lập vào năm 2012, là công ty chuyên nghiệp tại Việt Nam trong lĩnh vực cung cấp dịch vụ Hosting, VPS, máy chủ vật lý, dịch vụ Firewall Anti DDoS, SSL… Với 10 năm xây dựng và phát triển, ứng dụng nhiều công nghệ hiện đại, ONET IDC đã giúp hàng ngàn khách hàng tin tưởng lựa chọn, mang lại sự ổn định tuyệt đối cho website của khách hàng để thúc đẩy việc kinh doanh đạt được hiệu quả và thành công.
Bài viết liên quan

Install pngquant – Lossy PNG Compression App on Linux

If you are looking for a simple image compression tool, check out pngquant, a command-line utility and a library for lossy...

SuperTuxKart for Linux

SuperTuxKart is a great title designed to bring you the Mario Kart experience free of charge on your Linux system. It is...

PostgreSQL to Manage JSON

One of the many data types that PostgreSQL support is JSON. Since most of the web APIs communication uses JSON payload...
Bài Viết

Bài Viết Mới Cập Nhật

mua Proxy riêng ở đâu, và nó đem lại lợi ích gì cho người sử dụng

Hướng dẫn sử dụng Proxy Helper Fakeip khi thuê proxy


Mua Proxy Nuôi Zalo Giá Rẻ Tại