How to Install SSL Certificate on Ubuntu Server

  1010 views   1 year ago Ubuntu

SSL certificate is becoming mandatory for web application. All modern web browsers are blocking request and ask user permission to proceed.

In this article, I will share you how you can install SSL certificate using Terminal access.

After you logged in to server, First generate CSR using openssl command.

openssl req -new -newkey rsa:2048 -nodes -keyout yourdomain.key -out yourdomain.csr

This will ask few question through wizard. Answer them and proceed for next step.

Now we need to configure Apache server to use .key and .csr certificate files from home directory. Apache main configuration file located at /etc/apache2/sites-available/000-default.conf file. Open the file using nano editor and change file.

<VirtualHost *:443>
    ServerAdmin [email protected]
    DocumentRoot /var/www/html
    ServerName Domain name (Ex -
    ServerAlias www.yourdomain (
    SSLEngine on
    SSLCertificateFile /etc/apache2/ssl/c09fdeafb99483d9.crt (path from crt file which generate from godaddy (.crt file))
    SSLCertificateKeyFile /etc/apache2/ssl/bsstgulm.key (path from key file when generate the csr for domain)
    SSLCACertificateFile /etc/apache2/ssl/gd_bundle-g2-g1.crt path from crt file which generate from godaddy (.crt file))
    <Directory /var/www/html>
        Options Indexes FollowSymLinks MultiViews
        AllowOverride All
        Require all granted

<VirtualHost *:80>
       ServerName Domain name (Ex -
    ServerAlias (
    Redirect permanent /

In Terminal go to this /etc/apache2/ path and run the below command:

apache2ctl configtest
a2enmod ssl

Lastly you will need to restart Apache server.

sudo service apache2 restart

Now your domain will be ssl certificate installed. I hope this article will help you.

Author : Harsukh Makwana
Harsukh Makwana

Hi, My name is Harsukh Makwana. i have been work with many programming language like php, python, javascript, node, react, anguler, etc.. since last 5 year. if you have any issue or want me hire then contact me on [email protected]