Shubham S Nimje logo
Shubham Nimje
HTTPS

How to Enable HTTPS on Your Linux Server or VPS

How to Enable HTTPS on Your Linux Server or VPS
3 min read
#HTTPS

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.

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:

ssh -p PORT USERNAME@HOSTIP

For instance:

ssh -p 22 root@216.32.44.12

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

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

Obtaining an SSL Certificate

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

certbot --apache

Checking the Status of Certbot

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

systemctl status certbot.timer

Dry Run SSL Renewal

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

certbot renew --dry-run

Conclusion

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.

FAQs

Why is HTTPS important for my website?
HTTPS encrypts data transmitted between users and your website, ensuring privacy and security.

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.

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.

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.

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.