Install Free SSL on your VPS with Certbot
In today's digital world, security is paramount. Installing an SSL (Secure Sockets Layer) certificate on your website not only protects your users' sensitive information but also improves your search engine ranking and builds trust. Fortunately, thanks to initiatives like Let's Encrypt, obtaining an SSL certificate is no longer a costly or complicated process. This guide will show you how to install and renew Let's Encrypt certificates for free on your Virtual Private Server (VPS) using Certbot.
A VPS from PlatiniumHost offers you the flexibility and control needed to configure your environment exactly as you need it, including managing your own SSL certificates. While PlatiniumHost offers options with control panels like cPanel that greatly simplify this task (as we will see later), this guide is designed for those who prefer a manual setup or who do not use a control panel.
Prerequisites
- SSH access to your VPS.
- A registered domain name pointing to your VPS's IP address.
- A web server (Apache or Nginx) installed and configured to serve your domain.
- Basic knowledge of the Linux command line.
Step 1: Connect to your VPS
The first step is to establish a secure connection to your VPS via SSH. Make sure to replace usuario with your SSH username and tu_ip_del_vps with your server's IP address.
Once connected, you will be prompted for your password.
Step 2: Update the System
It is good practice to ensure your operating system is fully updated before installing new software. This prevents compatibility issues and ensures you have the latest security fixes. For Debian/Ubuntu-based systems:
sudo apt upgrade -y
Step 3: Install Certbot
Certbot is the client tool recommended by Let's Encrypt for obtaining certificates. The simplest and recommended way to install Certbot is via Snapd, Canonical's universal packaging system. If you don't have Snapd installed, you can do so as follows:
Then, install Snap core and Certbot:
sudo snap refresh core
sudo snap install --classic certbot
To ensure the certbot command is available in your PATH, create a symbolic link:
Step 4: Obtain and Install the SSL Certificate
Now that Certbot is installed, you can obtain your SSL certificate. Certbot can automatically detect your web server (Apache or Nginx)