How to setup free ssl in apache ?

Ujjwal Thakur

I am a FullStack Engineer, having 6+ years of experience, mostly worked in React.JS, TypeScript, JavaScript, JQuery, Laravel (PHP), MVC Arcticture, MySqli, Redis, REST APIs etc..

Having good knowledge of JIRA, AWS Cognito, S3 Bucket, EC2 Instances, Elastic IP, Bitbucket, Git, CICD Pipelines, Linux etc..

Latest Posts


 You can set up a free SSL certificate from Let’s Encrypt to use with Apache by following these steps:

  1. Install Certbot:

    sudo apt-get update sudo apt-get install certbot
  2. Obtain a certificate:

    sudo certbot certonly --webroot --webroot-path /var/www/html -d

    Replace with your own domain name.

  3. Update Apache virtual host:

    sudo nano /etc/apache2/sites-available/

    Add the following lines inside the VirtualHost block:

    SSLEngine on SSLCertificateFile /etc/letsencrypt/live/ SSLCertificateKeyFile /etc/letsencrypt/live/ SSLCertificateChainFile /etc/letsencrypt/live/

    Save and exit the file.

  4. Test Apache configuration:

    sudo apachectl configtest

    If the output is “Syntax OK,” restart Apache:

    sudo systemctl restart apache2

Your Apache server should now be configured to use the Let’s Encrypt SSL certificate. You can test it by visiting in a web browser.

Leave a Reply

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