How to set up HTTPS for your website with a free certificate
HTTPS encrypts traffic between visitors and your site and is expected by browsers today. The good news: certificates can be free and renew automatically.
How free certificates work
Let's Encrypt is a nonprofit certificate authority that issues free certificates. To get one, you prove you control the domain, usually by serving a special file over HTTP or adding a DNS record. Certificates are short-lived, so automatic renewal is essential.
Easiest options, by setup
- Hosting platforms (static hosts, app platforms): HTTPS is usually automatic once you connect your domain.
- Caddy web server: obtains and renews certificates by itself when you put your domain in the config.
- Nginx or Apache: use Certbot or a similar ACME client, which can edit the config and schedule renewals.
- Behind a CDN or proxy service: the provider may handle the public certificate; you still want encryption between it and your server.
Checklist
- Make sure your domain's DNS points to the server.
- Open ports 80 and 443 in the firewall.
- Issue the certificate.
- Redirect HTTP to HTTPS.
- Confirm auto-renewal is scheduled and test it.
Common problems
- DNS not updated yet, so validation fails
- Port 80 blocked, which breaks HTTP-based validation
- Mixed content warnings from images or scripts still loaded over
http://
Which approach did you use for your first site? Has a certificate ever expired on you unexpectedly?
Comments · 4
Let's Encrypt plus an auto-renewal script via certbot is how most of the web does it. Set it up once and forget it.
If you're on a static host like Netlify or GitHub Pages, it's often a single checkbox. Check before doing anything manual.
What happens if auto-renewal quietly fails? Is there a way to get warned before the certificate expires?
Set up an expiry monitor or email alert. Many hosts and Let's Encrypt itself send reminder emails, and uptime tools can check the certificate date.