Setting Up Let's Encrypt SSL Certificates

Setting Up Let's Encrypt SSL Certificates

Let's Encrypt provides free, trusted SSL certificates. Certbot automates the process of obtaining and renewing them.

Prerequisites

  • A domain name pointed to your server's IP address
  • Ports 80 and 443 open in your firewall

Install Certbot for Nginx

apt install certbot python3-certbot-nginx -y

Obtain a Certificate (Nginx)

certbot --nginx -d yourdomain.com -d www.yourdomain.com

Install Certbot for Apache

apt install certbot python3-certbot-apache -y
certbot --apache -d yourdomain.com

Standalone Mode (No Web Server Running)

certbot certonly --standalone -d yourdomain.com

Test Auto-Renewal

certbot renew --dry-run

Certbot automatically installs a cron job to renew certificates before they expire (certificates are valid for 90 days).

Manual Renewal

certbot renew

View Installed Certificates

certbot certificates
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

Securing SSH Access

Securing SSH Access SSH is the main entry point to your server. Hardening it is one of the most...

Setting Up a Firewall with UFW

Setting Up a Firewall with UFW UFW (Uncomplicated Firewall) makes managing firewall rules...

Installing Fail2Ban to Prevent Brute Force Attacks

Installing Fail2Ban Fail2Ban monitors your log files and automatically bans IP addresses that...

Scanning for Rootkits with rkhunter and chkrootkit

Scanning for Rootkits Rootkits are malware that hide from standard detection tools. Two widely...

Setting Up Two-Factor Authentication for SSH

Setting Up Two-Factor Authentication for SSH Adding 2FA to SSH requires both your SSH...