This guide explains how to install a free Let's Encrypt SSL certificate on a Linux server running Apache using Certbot — including automatic renewal.
Prerequisites: Apache must be installed and running. The A record of your domain must point to your server's IP. Ports 80 and 443 must be open in the firewall.
Replace your-domain.com with your actual domain name:
Certbot asks for an email address and whether to redirect HTTP to HTTPS. Choose 2 for the automatic redirect.
Open your domain in a browser — you should see https:// and the padlock icon.
Test automatic renewal with a dry run:
If --dry-run succeeds, automatic renewal is working correctly.
| Error | Cause & fix |
|---|---|
| Connection refused on port 80 | Port 80 is blocked by the firewall. Open it in iptables or nftables. |
| Could not reliably determine the server's fully qualified domain name | Add ServerName your-domain.com to the Apache configuration and restart Apache. |
| DNS problem: NXDOMAIN | The domain's A record does not point to this server. Check DNS and wait for propagation. |
| AH00526: Syntax error | Certbot modified the Apache config incorrectly. Check with apache2ctl configtest and fix manually. |