How to Install a Free SSL Certificate (Let's Encrypt) via SSH on a VPS Hosting

How to Install a Free SSL Certificate (Let’s Encrypt) via SSH on a VPS Hosting

  • July 10, 2024
  • in Web Tech
  • by AW Bali Digital

Securing your website with SSL (Secure Socket Layer) is essential to protect your data and ensure the trust of your visitors. Let’s Encrypt provides free SSL certificates, and installing one on a VPS (Virtual Private Server) is straightforward with SSH access. This guide will walk you through the process of installing a free SSL certificate from Let’s Encrypt via SSH on your VPS hosting.


Before you start Install Free SSL Certificate, ensure you have the following:

  1. A VPS hosting account with root access.
  2. A registered domain name pointing to your VPS.
  3. An SSH client like PuTTY (for Windows) or Terminal (for macOS/Linux).

Step-by-Step Guide

Step 1: Access Your VPS via SSH

First, log in to your VPS using SSH. Open your SSH client and enter your VPS IP address:

ssh root@your_vps_ip

Replace your_vps_ip with the actual IP address of your VPS. Enter your root password when prompted.

Step 2: Update Your Server

Before installing any new software, it’s a good practice to update your server packages. Run the following commands:

sudo apt update sudo apt upgrade -y
Step 3: Install Certbot

Certbot is a free tool that automates the process of obtaining and installing SSL/TLS certificates from Let’s Encrypt. Install Certbot using the following commands:

sudo apt install certbot

If you are using Nginx or Apache as your web server, install the corresponding Certbot plugin:

  • For Nginx:
    sudo apt install python3-certbot-nginx
  • For Apache:
    sudo apt install python3-certbot-apache
Step 4: Obtain an SSL Certificate

Now, you can use Certbot to obtain an SSL certificate for your domain. Replace your_domain with your actual domain name:

  • For Nginx:
    sudo certbot --nginx -d your_domain -d www.your_domain
  • For Apache:
    sudo certbot --apache -d your_domain -d www.your_domain

Certbot will prompt you to enter an email address for renewal notifications and agree to the terms of service. Follow the on-screen instructions to complete the process.

Step 5: Verify SSL Installation

After obtaining the SSL certificate, Certbot will automatically configure your web server to use it. You can verify that SSL is working by opening your website in a browser and checking for the padlock icon in the address bar.

Step 6: Set Up Automatic Renewal

Let’s Encrypt certificates are valid for 90 days, but Certbot can automate the renewal process. Ensure the automatic renewal is set up by running:

sudo certbot renew --dry-run 

This command simulates the renewal process and ensures everything is set up correctly.


Installing a free SSL certificate from Let’s Encrypt on your VPS hosting via SSH is a straightforward process with Certbot. By following the steps outlined above, you can secure your website and gain the trust of your visitors. Always remember to keep your server updated and monitor your SSL certificate’s expiration to ensure continuous security.

For further assistance, feel free to reach out to your hosting provider or consult the official Certbot documentation.

By following this guide for Install Free SSL Certificate, you can enhance your website’s security and provide a safer browsing experience for your users.

AW Bali Digital

© 2024 by PT BIKIN INOVASI TEKNOLOGI, All Rights Reserved.