How to Install Let's Encrypt SSL Certificates on Apache (Ubuntu/Debian)

Let’s Encrypt provides free SSL certificates that are trusted by most browsers. Securing your website with HTTPS is essential for both trust and SEO.

1. Install Certbot

sudo apt update
sudo apt install certbot python3-certbot-apache

2. Obtain an SSL Certificate

Replace yourdomain.com with your actual domain:

sudo certbot --apache -d yourdomain.com -d www.yourdomain.com

Follow the prompts to configure HTTPS automatically.

3. Auto-Renewal Check

Let’s Encrypt certificates expire every 90 days. Certbot automatically adds a cron job, but you can test it:

sudo certbot renew --dry-run

4. Check Apache Configuration

Once the SSL is installed, Certbot will update your Apache configuration. You can verify it with:

sudo apache2ctl configtest

Then reload Apache if needed:

sudo systemctl reload apache2

5. Verify in Browser

Navigate to https://yourdomain.com. You should now see a secure padlock in the address bar.

Security Tip

Redirect HTTP to HTTPS for all traffic. Certbot usually offers to do this automatically. If not, manually add the following to your Apache config:

<VirtualHost *:80>
    ServerName yourdomain.com
    Redirect permanent / https://yourdomain.com/
</VirtualHost>

Summary

Let’s Encrypt is an easy and cost-free way to secure your websites with SSL. With Certbot and Apache, the process takes only a few minutes and greatly improves your site's credibility and security.

War diese Antwort hilfreich? 0 Benutzer fanden dies hilfreich (0 Stimmen)