Person Encoding in Laptop

How to Enable HTTPS on Your Linux Server or VPS | Hostinger

How to Enable HTTPS in Your Domain Hosted on Linux Remote Server or VPS

In today’s digital landscape, ensuring the security of your website is paramount. HTTPS, or Hypertext Transfer Protocol Secure, encrypts the data exchanged between a user’s browser and your website, safeguarding it from potential threats. Let’s delve into the process of enabling HTTPS using Let’s Encrypt on a Linux remote server or VPS.

1. Introduction to HTTPS and Let’s Encrypt

HTTPS provides a secure connection by encrypting the data transmitted between the user’s browser and the website’s server. Let’s Encrypt, operated by the Internet Security Research Group, offers X.509 certificates for TLS encryption, making it an accessible and cost-effective solution for website security.

2. Accessing Remote Server via SSH

Before initiating the HTTPS setup process, it’s essential to establish a secure connection to your remote server via SSH. Utilize the following syntax:


For instance:

ssh -p 22 root@

3. Installing Certbot and python3-certbot-apache

Certbot, a free and open-source tool, automates the process of obtaining and renewing Let’s Encrypt certificates on Apache servers. Ensure to install Certbot and its Apache plugin, python3-certbot-apache:

apt install certbot python3-certbot-apache

4. Verifying Web Server Ports and Firewall Status

Check the status of your web server ports and ensure they are open and allowed through the firewall:

ufw status verbose

5. Obtaining an SSL Certificate

Execute Certbot’s Apache plugin to obtain an SSL certificate:

certbot --apache

6. Checking the Status of Certbot

Verify the status of the Certbot timer to ensure automatic renewal of SSL certificates:

systemctl status certbot.timer

7. Dry Run SSL Renewal

Conduct a dry run SSL renewal to ensure the renewal process functions smoothly:

certbot renew --dry-run


Enabling HTTPS on your website hosted on a Linux remote server or VPS enhances security and user trust. By leveraging Let’s Encrypt and Certbot, you can seamlessly encrypt data transmissions, safeguarding your website and its visitors from potential threats.


  1. Why is HTTPS important for my website?
    HTTPS encrypts data transmitted between users and your website, ensuring privacy and security.
  2. What is Let’s Encrypt, and why is it free?
    Let’s Encrypt is a non-profit certificate authority that aims to secure the web by providing free SSL/TLS certificates.
  3. Do I need technical expertise to enable HTTPS with Let’s Encrypt?
    While some technical knowledge is beneficial, Certbot simplifies the process, making it accessible to website owners of varying skill levels.
  4. How often do I need to renew my SSL certificate?
    SSL certificates issued by Let’s Encrypt are typically valid for 90 days and need to be renewed periodically.
  5. Can I automate the SSL certificate renewal process?
    Yes, Certbot includes a timer service that automates SSL certificate renewal, ensuring continuous security for your website.